Thank you for using Otter. This Ruby on Rails app is designed to handle the database and API for its eponym Otter, a budgeting visualizer that helps users manage their personal finance through visual demonstration of their monthly spendings.
View demo
To get started with Otter back-end, fork and clone this repository to your local machine, cd
into the project, and run bundle install
. Then, run rake db:setup
to seed the database. Make sure you have postgreSQL installed and running on your local machine. Also make sure you change all the necessary URL variables in the React application so that the changes made locally will reflect your own database.
Otter uses total of three models:
The user
model has many-to-many relationship with the category
model, and one-to-many relationship with the transaction
model. User is able to have many categories through transaction.
The category
model has many-to-many relationship with the user
model, and one-to-many relationship with transaction
model. Category has many users through transaction. There are fixed number of categories for some control over categorical database.
The transaction
model is a join table between a user
instance and a category
instance. When a logged-in user creates a new transaction with a selected category, a transaction
instance is created in the database. When a logged-in user updates an existing transaction, the front-end sends a PATCH
request to the back-end. Once the back-end receives the request, the database searches for that particular transaction
instance with its id
number and updates it. User is also able to send a DELETE
request to the back-end and delete a particular transaction
instance.
This repository welcomes contributions, so feel free to submit a pull request.