Test task to check basic knowledge of Ruby. Here implemented, registration based on Device, sorting by column name, basic Bootstrap style and tests on RSpec.
Money Spent Counter a minimal expenses tracking application using Ruby on Rails framework. Deployed to Heroku and available online.

In the application you can:
- Register to app or login
- Create new invoice with title, description, category and amount
- Show all user invoices paginated by 10 pear page and sorting option
- Ability to copy invoice link and send them to another user
- Handle all errors like not found to default 404 page
The setups steps expect following tools installed on the system.
git clone https://github.com/Synkevych/money_spent_counter.git
cd money_spent_counterdocker 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 installYou can start the rails server using the command given below.
rails sAnd 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 modelheroku 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.