- Ruby 3
- Ruby on Rails 6
- PostgreSQL for using as SQL database
- dotenv to load environment variables from .env into ENV
- RuboCop for Ruby static code analysis
- Docker for production deployment, NOT for development
- GitHub Actions for testing, linting, and building Docker image
- Lograge for single-line logging
- Clone the repo locally:
git clone [email protected]:valdrinkuchi/okr_app.git
cd okr_app
- Install PostgreSQL. On a Mac with HomeBrew, run this to install from the
Brewfile
:
brew bundle
- Setup the application to install gems and create the database:
bin/setup
- Setup Database. The
seed.rb
file has dummy data to get started.
rails db:setup
- Start the application locally:
rails s
docker-compose up
- Run Ruby tests:
bin/rails test
- Run RuboCop:
bin/rubocop
-
Create and Update User:
POST: 0.0.0.0:3000/api/v1/users PATCH: 0.0.0.0:3000/api/v1/users/:id { "user": { "email": "[email protected]", "password": 123456, "password_confirmation": 123456, "first_name": "Test", "last_name": "User" } }
-
Login and Logout User:
POST: 0.0.0.0:3000/api/v1/sessions DELETE: 0.0.0.0:3000/api/v1/sessions/:id { "email": "[email protected]", "password" : 123456 }
The Authentication token will be recieved as a response from Login. Authorization token should be used in the headers in order to access goals and key_results controllers.
-
CRUD operation Goals:
GET: 0.0.0.0:3000/api/v1/goals or 0.0.0.0:3000/api/v1/goals/:id POST: 0.0.0.0:3000/api/v1/goals DELETE: 0.0.0.0:3000/api/v1/goals/:id PATCH: 0.0.0.0:3000/api/v1/goals/:id
-
CRUD operation Key Results:
GET: 0.0.0.0:3000/api/v1/key_results or 0.0.0.0:3000/api/v1/key_results/:id POST: 0.0.0.0:3000/api/v1/key_results DELETE: 0.0.0.0:3000/api/v1/key_results/:id PATCH: 0.0.0.0:3000/api/v1/key_results/:id
In the seed.rb
there are two users created and assigned Goals and Key Results
.
When Emma Doe
with email [email protected]
and password 123456
is signed_in
through POST
http://0.0.0.0:3000/api/v1/sessions
the authorization token is received in the response.
This token can be used to retrieve Goals and Key Results
that belong to Emma through http://0.0.0.0:3000/api/v1/key_results
and http://0.0.0.0:3000/api/v1/goals
.