This project leverages authentication and authorization using jwt
token based user managment in the Ruby on Rails tech stack to add user session management.
Before you embark on this adventure, ensure you have the following tools installed on your system:
- Ruby on Rails framework
- Postman
For instance, if you have GitHub SSH configured on your machine:
git clone git@github.com:arbinydv/rails-user-management.git
- Install Dependencies
-
Database:
PostgreSQL
🐘 -
Gems
- JWT token based authentication
- Bcrypt
- JWT
- JSON Builder
- json
- Modal Serializers
- active_model_serializers
- CORS Handler
- rack-cors
- JWT token based authentication
-
Project
bundle install
-
-
Generating secret key using Rails.application.secrets.secret_key_base
-
Securing the Key : Run the command on your terminal to manage credentials and master key for encryption-decryption
EDITOR="code --wait" rails credentials:edit
Ensure that your PostgreSQL database is properly configured in database.yml
rake db:create
rake db:migrate
rake db:seed
- Running Project 🏃
- Rails Server
rails server || rails s
Now, your project is up and running at http://localhost:3000 🌐
If you wish to use docker to build and deploy the project, please follow the steps below
docker-compose build
docker-compose up
Database Migration
docker-compose run app rails db:create
docker-compose run app rails db:migrate
docker-compose run app rails db:seed
ActiveRecord:
docker-compose run app rails c
docker-compose down
- Please refer to this Postman Collection inside this google drive for all endpoints
Feel free to explore and give feedbacks! 🎉