This REST API was built with Ruby on Rails, and Postgres for the databases as the final project at Microverse. With this API, records (measurements) and items (things to measure) can be added, edited, and removed manually interacting with the database in the front-end application.
As the final project at Microverse, this REST API was constructed using Ruby on Rails and Postgres for database management. It facilitates adding, editing, and removing records (measurements) and items (things to measure) via direct interaction with the database within the front-end application.
To understand its functionality, you can explore the Tracking App with React, the corresponding front-end application integrated with this API.
Please check how this API works in the Tracking App with React, which is the front-end application built with React, corresponds to this API.
A list of commonly used resources that I find helpful is listed in the acknowledgments.
To get a local copy up and running, follow these simple example steps.
Code
.bundle install
rails db:setup
rails server
to run rails application in your local serverrspec
to run rspec testsGo to puma.rb in config/initializers, and rewrite the port from 3000 to 3001 like below:
e.g. port ENV.fetch("PORT") { 3001 }
Go to cors.rb in config/initializers, and rewrite the origins path for your frontend path in both local and production
headers: { 'Content-Type': 'application/json', Authorization:
Bearer ${token}, },
This API administrator can create an admin user through the rails console in the local environment or using the rails database seed file whichever you like. For example, in the console, run IRB by rails c
, then in the IRB console, you can create an admin user like below:
User.create(username: 'admin', password: 'admin', admin: true)
By default, I created the seeds file in this repository to create an admin user. So after rails db:setup
at step 9 in the “Getting Started” section, the admin user will be automatically created.
👤 Yoko Saka
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Give a ⭐️ if you like this project!
This project is MIT licensed.