Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.1
3.2.2
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.2.1'
ruby '3.2.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '~> 7.0.5'
Expand Down Expand Up @@ -74,7 +74,6 @@ group :test do
gem 'capybara'
# gem 'debug', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
gem 'rails-controller-testing'
gem 'rspec-rails'
gem 'selenium-webdriver'
gem 'webdrivers'
Expand Down
7 changes: 1 addition & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ GEM
activesupport (= 7.0.5)
bundler (>= 1.15.0)
railties (= 7.0.5)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
Expand Down Expand Up @@ -287,7 +283,6 @@ DEPENDENCIES
pg (~> 1.1)
puma (~> 5.0)
rails (~> 7.0.5)
rails-controller-testing
rails_heroicon
rails_live_reload
rspec-rails
Expand All @@ -301,7 +296,7 @@ DEPENDENCIES
webdrivers

RUBY VERSION
ruby 3.2.1p31
ruby 3.2.2p53

BUNDLED WITH
2.4.12
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [🚀 Live Demo](#live-demo)
- [Video Link 🚀](#video-link)
- [💻 Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
Expand Down Expand Up @@ -95,24 +96,35 @@ Clone this repository to your desired folder:
ITo begin with, you need to get your Rails application server running. This is like live preview in the browser for rails applications. Run :


```sh
$ bin/dev
Install the required gems:

```
bundle install

OR
Set up the database:

```sh
$ rails server
rails db:create

```
rails db:migrate

rake assets:precompile

To run the server:

rails s or ./bin/dev


visit [localhost](http://localhost:3000/) in your browser!

To exit server enter “Control (^ )+ C”

<p align="right">(<a href="#readme-top">back to top</a>)</p>

### LIVE DEMO
[Budgetron](https://budgetron.onrender.com)

### Video Link 🚀
[Video here](https://www.loom.com/share/8a34d5db634f4dc1a271b2849bf131f3)

<!-- AUTHORS -->

## 👥 Authors <a name="authors"></a>
Expand Down
6 changes: 3 additions & 3 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*= require_self
*/

@font-face {
font-family: 'Proxima Nova';
src: url('Proxima_Nova.otf') format('opentype');
@font-face {
font-family: 'Proxima Nova';
src: url('Proxima_Nova.otf') format('opentype');
}
2 changes: 1 addition & 1 deletion app/controllers/categories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class CategoriesController < ApplicationController

# GET /categories or /categories.json
def index
@categories = Category.includes(:financial_transactions).all
@categories = Category.includes(:financial_transactions).order(created_at: :desc).all
end

# GET /categories/1 or /categories/1.json
Expand Down
8 changes: 0 additions & 8 deletions app/controllers/financial_transactions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ def create
@financial_transaction.user_id = current_user.id

category_id = financial_transaction_params[:category_ids].reject(&:empty?)[0]
# @financial_transaction.create_financial_transaction_categories(category_ids)

# if category_ids.empty?
# flash[:error] = "Please choose at least one category"
# # render :new # or redirect to the appropriate action
# else
# @financial_transaction.create_financial_transaction_categories(category_ids)
# end

respond_to do |format|
if @financial_transaction.save
Expand Down
2 changes: 1 addition & 1 deletion app/models/category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Category < ApplicationRecord

has_one_attached :icon

has_many :financial_transaction_categories
has_many :financial_transaction_categories, dependent: :destroy
has_many :financial_transactions, through: :financial_transaction_categories

# Validations
Expand Down
14 changes: 7 additions & 7 deletions app/models/financial_transaction.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class FinancialTransaction < ApplicationRecord
before_save :create_financial_transaction_categories
# before_save :create_financial_transaction_categories

belongs_to :user

Expand All @@ -11,10 +11,10 @@ class FinancialTransaction < ApplicationRecord
validates :amount, presence: true, numericality: { greater_than: 0 }
validates :category_ids, presence: { message: 'Please choose at least one checkbox' }

def create_financial_transaction_categories()
categories = Category.where(id: category_ids)
categories.each do |cat|
financial_transaction_categories.build(category: cat)
end
end
# def create_financial_transaction_categories()
# categories = Category.where(id: category_ids)
# categories.each do |cat|
# financial_transaction_categories.build(category: cat)
# end
# end
end
3 changes: 1 addition & 2 deletions app/views/categories/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
</div>

<div>

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Necessitatibus eligendi qui deleniti
A short description of the category and its purpose.
</div>

<div class="border-2 border-slate-200 mx-4 "></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


<nav class='flex justify-between bg-primary-blue p-4 text-white align-center mb-4'>
<%= link_to :back do%>
<%= link_to :root do%>
<%= heroicon "arrow-small-left" %>
<%end%>
<h2 class='text-center'>LOGIN</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p class='text-primary-gray-1'> Transaction No. <%= financial_transaction.author_id[0,8] %></p>
<p class='flex text-sm text-primary-gray-3'>
<%= heroicon "calendar"%><%= financial_transaction.created_at.strftime("%d %b %y at %l:%m %P")%>
<%= heroicon "calendar"%><%= financial_transaction.created_at.strftime("%d %b %y at %l:%M %P")%>
</p>


Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</head>

<body>
<main class="container flex-col">
<main class="container flex-col max-h-screen h-screen">


<div class='flex-col '>
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/splash.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="text-center h-[800px] flex justify-center items-center ">
<div class="text-center h-5/6 flex justify-center items-center ">
<h1 class='text-5xl'>Budgetron</h1>
</div>

Expand Down
8 changes: 8 additions & 0 deletions bin/render-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# exit on error
set -o errexit

bundle install
bundle exec rake assets:precompile
bundle exec rake assets:clean
bundle exec rake db:migrate
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Budgetron
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA1

# Configuration for the application, engines, and railties goes here.
#
Expand Down
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
U9dpgYcPhOwJE6i7KmSsvZsTikWBAnelIuwUfO9t6+UAJujxkTJWM9betbw6HttS1ouH8TfFZV5GGDhfLzfwXe3JJbpoR7Vy40oYR1y1RnUKqmh5hOo6qaSNrfxcPwITH2OUChdInOFDlZmoloYMIFp4rWiQb2YwQKYoekBKZHbzXbXeeD58B8JhdR1nqNtJ8f5hmfWyBe1NTZzlkKg/0rBhOrzlqbHb6axJhlA6zOFEX4W/07j6vZe3mUPiGZTzZhQlC2XDWElBDbof+AWkxGEt2dTAycuGKvLS6nxrQoVrWSZbceKIqaQmIfJ9Lid++5+5h5IWs9QZom0AQNXAo8rLkuBRQA8OJje/BS/NVAb6v/POkIB0aVoFh98IJ/8ofHGtEXia4EM0wI01CviJCzjL3zp3z10xSDzlYowsUCw9--r3L8JTdvFnJcE0bR--BNCk1lY8X+zNzPf+p7BrdA==
3IzPJQSE29nzniYxIXtAy0aAAo8crzlhOzI8M2A/dhVRVTRMy/vmQIrWCO7Q6KB+QmkPA1rtYkhTcIndZWB7Nwg4pS2SiLUiQN3KgzI8mHlsndaMssFFUcE4PvnrPu6z0RbaeCS7/e73ghtUNNM6GnQoJHFkVt0jaMAm+UYnM4F9naCtXCvw9bl1Z5QJqcRl2fRHaGAd6KA+KwyOG5oFn5d06oEAmgiTj+3BuRuAY96KOcWssBvjp7PaM4dltbIi3Y/UtjN8nXa3OTgkYsf1eifk6Hrl2+wBLwitbsEST0Eky0s8NWWVkoIfAv8MDCtlpdI3mxKisGK+RfzIdtFCCHckSxoZD5xb5d2PkEr7OqOGBZOin0brYwMmOkArDbeo0jQligTmqdEmkoLUmnFZ8AMdMKehjKJcy4Tz--cIUjs/hINmqHe9ra--4eF9SI8HhQ189HFoc2TPtQ==
2 changes: 1 addition & 1 deletion config/credentials/production.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Ww1Y/9i0XCRqjZzqA0mJQG+eDqv99qI/v/GrAC4jGfyGlgvW4lpwVBvynbAXDOItLt4pLykZmb0cW2ZmLkg4p/MXK4PcY64oqPjaiAlE/zZYFiDjtKzauTYs9/xergu5qIEQ8voVxA3GLUi5y4AaeUy+8PD4gJz2PlDuj+lTWY5GFWEnaLrHM8iUX14+UE3vbRGVjBracausyFGJbckwt6itVprDFQHot7OxhxCnjkDfaAyBg38oRBBRnr2GTf55fuhSfz2QFIkDwuXp/nS33ttWSg0HMDKseatzlWA=--XEaybu7wBO4lnrJo--UPYpMfl3VFZlww4lDWhQKQ==
mwodCY4y2seI24KQFg1GAWwIAg7KKnf388Fn35mCaR/uBWKN0x7pgajHak7jJy3sEvJ8Fs53PgjjJbT3kDKJDBcX6PiK4MCbmIUMtij+zPL46xvvccoWcTYfqEpQtwt4ZGu0nkPewo7Cm5OxzSsMw+Tm2ICa7fgSnUXGnk4u8mh0dXWLfGx2apW7n+sXLa3g1ZfWDtj0kwv/JsVgYLAaEj2VS6liYWIiO+JiyxIKtmwyIBflTiXNy5KvUwdYDq/bUGOB+0y63B3cyeMNzQ6xuuoMgb8JlKc5qhCoG5ar--wNlN98asAwGtzRPp--MJw70LlaNoQSYuHtR23KwQ==
13 changes: 7 additions & 6 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ development:
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: Budgetron_test
# test:
# <<: *default
# database: Budgetron_test
# username: <%= ENV["DATABASE_USERNAME"] %>
# password: <%= ENV["DATABASE_PASSWORD"] %>
# host: localhost

# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
Expand All @@ -83,6 +86,4 @@ test:
#
production:
<<: *default
database: Budgetron_production
username: <%= ENV["DATABASE_USERNAME"] %>
password: <%= ENV["DATABASE_PASSWORD"] %>
url: <%= ENV['DATABASE_URL'] %>
6 changes: 5 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
config.require_master_key = true

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
Expand Down Expand Up @@ -90,4 +90,8 @@

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? || ENV['RENDER'].present?
end
4 changes: 2 additions & 2 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# confirmation, reset password and unlock tokens in the database.
# Devise will use the `secret_key_base` as its `secret_key`
# by default. You can change it below and use your own secret key.
# config.secret_key = 'daf1f5f84bef88f220a131b84f29004db7eb2e9967c22a13f439d62ab1907c022d3cadc85487cc6f3cc2f928b038712b52b6a9ed2905a4efbbebf4457f843422'
# config.secret_key = 'b6aa4f9719b483f8c0183d995dad21b07d8cbb1cb2fa96b9a0e5bd7403a09352b32282ee0225fd39d3e4b68bd39d6d587eaffe6fcfb8aabbda9288848a83d859'

# ==> Controller configuration
# Configure the parent class to the devise controllers.
Expand Down Expand Up @@ -126,7 +126,7 @@
config.stretches = Rails.env.test? ? 1 : 12

# Set up a pepper to generate the hashed password.
# config.pepper = '6e451013188a16a3571fb93ead3a6d68f6eebd6b760438940c58c0911d2d1044004067345cded8910b868e4eccf1ad80fa05c3d07926012f252e37db584828bf'
# config.pepper = 'e576662b154b1f5c1a555ed988bf0412f1e327e2e4b34182cd11cbc192c5cd8158a40414c04b60af2dbdb0cb934607ef861730b1420e70cc48938d249e6fa9f1'

# Send a notification to the original email when the user's email is changed.
# config.send_email_changed_notification = false
Expand Down
2 changes: 1 addition & 1 deletion config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
workers ENV.fetch("WEB_CONCURRENCY") { 2 }

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
Expand Down
Loading