A Minimal Expenses Tracking Application built with Ruby on Rails!
It is a SPA thanks to Hotwire / Turbo that comes with Rails 7. Also, Bootstrap and a bit of Stimulus were used for frontend part.
- Signing up and signing in with the login and password.
- Spendings can be created, updated and deleted and has such fields: title, description, category and amount.
- When creating a spending, a category is chosen from the list of predefined by default or created by user categories.
- Categories has their own management screen, where they can be created, updated and deleted.
- Main screen is the list of user's spendings with a total value and search filters with the support of several parameters (e.g., category, amount).
- User is able to share (with a button on the main screen) the non-editable list of his spendings with another user (even if the other user isn't logged in).
- The share link is unique and generated each time user presses the share button.
In order to set up and run the project on your local machine you need this software installed:
- Ruby
- PostgreSQL
- Node.js and yarn
Clone the project from this repository to your projects folder:
$ cd <your_projects_root_folder>
$ git clone <link_to_mexta_repo>
$ cd mexta
Install one of the tools for ruby version management (if you don't have it yet) - RVM or rbenv
Install Ruby 3.2.2 version:
with RVM:
$ rvm install 3.2.2
$ rvm use 3.2.2
or with rbenv:
$ rbenv install 3.2.2
$ rbenv local 3.2.2
Install PostgreSQL database.
In order to prevent possible problems with rake db
or rails db
commands
when applying changes to the database, do this:
- Open the postgres config file with your text editor (nano, vim etc...)
If you're on Debian / Ubuntu:
$ sudo <text_editor> /etc/postgresql/<version>/main/pg_hba.conf
If you're on Fedora:
$ sudo <text_editor> /var/lib/pgsql/data/pg_hba.conf
-
Find the line with content like:
local all postgres peer
-
Comment it out and paste this line below:
local all all md5
-
Restart your Postgres server:
$ sudo systemctl restart postgresql.service
Install NVM, if you don't have it yet.
With NVM, install Node.js 18.14 (LTS) version:
$ nvm install 18.14
After Node.js install, enable yarn through enabling Corepack:
$ corepack enable
or through installing it with npm:
$ npm install --global yarn
Install necessary yarn dependencies:
$ yarn install
Install bundler:
$ gem install bundler
Run bundler to install the project's dependencies:
$ bundle
Create .env file in the app's root and add there such environment variables with your values:
export DB_USERNAME=<value>
export DB_PASSWORD=<value>
export DB_PRODUCTION_USERNAME=<value>
export DB_PRODUCTION_PASSWORD=<value>
Create and migrate the database:
$ rake db:create
$ rake db:migrate
Congratulations, you have set up the project!
$ bin/dev # start up
[ctrl + c] # shut down
When up, the project is available on http:://localhost:3000.
$ rails c # start up
> exit # shut down
$ rspec
$ rubocop