This is a little project to show some skills.
- Rails 6.1.1
- Ruby 3.0
- PostgreSQL 13.1
Generate a secret key running the next command and then copy and paste the secret key into the .env
file.
rails secret
It will easy just need to run the next commands after downloaded the project.
rails db:create db:migrate db:seed
after run migrations run the next command
bundle install
Now start the server
rails s
Now after run the server we'll use Postman to retrieve data and you can download the postman collection here.
If you run correctly the seed command you can use whatever of this users to login.
- Admin: Manage all
email: [email protected],
password: valid_password
- Partner: Read and Write just for a specific method to retrieve data.
email: [email protected],
password: valid_password
- Visitor: Read
email: [email protected],
password: valid_password
In the previous request (login) we expect to receive a Status: 200, and all the information from the database for that particular users.
Now you need to copy the authorization token that you can find it in the headers section or you could create a global variable too.
After set up the previous token you can retrieve the correct data from any endpoint.