A minimal Rails application for tracking expenses, featuring sorting and pagination functionalities. Developed using Docker for containerization.
Money Spent Counter a minimal expenses tracking application using Ruby on Rails framework. Deployed to Heroku and available online.
In the application you can:
The setups steps expect following tools installed on the system.
git clone https://github.com/Synkevych/money_spent_counter.git
cd money_spent_counter
docker compose up
docker compose run web rake db:create db:migrate db:seed
Run the following commands to create and setup the database, and application libraries.
rails db:create
rails db:setup
rails db:migrate
rails db:seed # for create some default data
bundle install
yarn install
You can start the rails server using the command given below.
rails s
And now you can visit the site with the URL http://localhost:3000
You can run all 60 tests(coverage 88.17%) using the command given below.
$ rails generate rspec:install # first setup rspec gem
$ rspec spec
# Default: Run all spec files (i.e., those matching spec/**/*_spec.rb)
$ rspec
# Run all spec files in a single directory (recursively)
$ rspec spec/models
# Run a single spec file
$ rspec spec/requests/invoices_request_spec.rb
# Run a single example from a spec file (by line number)
$ rspec spec/requests/invoices_request_spec.rb:43
# See all options for running specs
$ rspec --help
# another useful commands
$ rails g rspec:controller users # generate new test for controller
$ rails g rspec:model user # generate new test for model
heroku login
- login to your profile
heroku create money-spent-counter
- create new heroku app with specific name
heroku buildpacks:add --index 1 heroku/nodejs
- because of yarn lib you need use Multiple Buildpacks
git push heroku main
- push you project to Heroku server
heroku run rake db:migrate
- run migration on Heroku server
heroku pg:reset
- drop database on Heroku server
heroku open
- open and test your website
Feel free to send me feedback on Twitter or file an issue. Feature requests are always welcome.