Roda API project.
To run this project you need:
- Ruby 2.6.x
- Postgres +10.x
- roda 3.26.0
To start development, clone the project and run:
$ bundle install
Update the file located in roda_api/config/db.rb
replace the credentials and DB name with yours.
rake db:create # Create the database
rake db:drop # Drop the database
rake db:migrate # Perform migration up to latest migration available
rake db:migrate:down # Perform migration down (erase all data)
rake db:migrate:up # Perform migration up to latest migration available
or created the database with the pg commands
sudo -u postgres psql
CREATE DATABASE my_development_db;
In root
we have all known rails folders there from the MVC pattern, also we interduce those folders:
irb -r /models.rb
In this project I prefered to use dotenv and keep all the keys in the env file.
.env.example
will used as placeholder for the required keys to run the application.- in case there are new keys, please add a placeholder for it in
.env.example
so other developers know about it. - use
.env
to set your own keys and your own settings based on you machine, this file is ignored from the repo, so dont push it.
## -------------------- Requirements -------------------- ##
## ----------------------- Scopes ----------------------- ##
## --------------------- Constants ---------------------- ##
## ----------------------- Enums ------------------------ ##
## -------------------- Associations -------------------- ##
## -------------------- Validations --------------------- ##
## --------------------- Callbacks ---------------------- ##
## ------------------- Class Methods -------------------- ##
## ---------------------- Methods ----------------------- ##
Before Commit
- lint ruby files by running
rubocop --auto-correct
, it will auto correct what can be corrected - Overcommit will run automatically on commit and will show you Whitespace and Rubocop errors, and will run Rspec on push