rent-a-scooter-back-end
Backend application for user accounts creation and authentication, add and remove items to user reservations. The application also provides and api for items (scooters) names, prices, photos and descriptions.
Live link for API
Built With
- Ruby version 3.0.1
- RoR version 7.0.2.4
- VScode
- Rubocop
- Git and GitHub
Getting Started
The back-end application will receive POST requests to create user accounts, and reservations and GET requests to view scooters and reservations. The base URL is: https://cryptic-anchorage-52984.herokuapp.com
If you want to view scooters you can call this endpoint:
/api/v1/items
To do the same but with reservations call this endpoint:
/api/v1/reserveds/:user_id
APIs endpoints will return content in JSON form with the following format:
For items:
{
"id": 1,
"name": "XS 420 model",
"price": 100,
"image": "image_url",
"created_at": "2022-01-01T00:00:00.000Z",
"updated_at": "2022-01-01T00:00:00.000Z",
"description": "This is an electric scooter, ...etc "
}
For reserveds:
{
"id": 1,
"user_id": 1,
"item_id": 1,
"created_at": "2022-01-01T00:00:00.000Z",
"updated_at": "2022-01-01T00:00:00.000Z",
}
You can view the details for a specific scooter by calling this endpoint:
/api/v1/items/:id
Same for reservations:
/api/v1/reserveds/:id
If you need further information about the endpoints you can view the documentation navigating to /api-docs
.
Or you can just click this link
If you prefer to clone the project locally, you can also get to the docs by navigating to http://domain
:port
/api-docs. Where domain
is the domain of your server and port
is the port of your server.
For example, if your server is running on port 3000, you can navigate to http://localhost:3000/api-docs.
There you will see a list of all endpoints and their descriptions.
The project comes shipped with linters config for ruby, so ensure you have Rubocop installed in your local environment
-
Ensure you have postgresql, nodejs, ruby and rails set up on your machine
-
To get a local copy of the repository please run the following commands on your terminal:
$ git clone https://github.com/Rayan84/rent-a-scooter-back-end.git
-
$ to test or consume the api you can git clone this react app front-end and set up locally
-
$ run
cd rent-a-scooter-back-end
to navigate to the project root folder -
$ run
bundle install
to couple all dependacies in gem files -
$ run
rails db:create db:migrate db:seed
-
$ run
rails s
to start rails server -
$ browse
http://<domain>:<port>/api-docs
to view swagger api documentations and test end points
Database creation
Run rails db:create db:migrate db:seed
Seeding adds 9 scooters, one user and one reservation.
Kanban Board
Here you will see some images of our Kanban boards at the beggining of the project.
Back-end kanban: Kanban board image
Front-end kanban: Front end kanban image
And this is the current link to the kanban board: Kanban Board Link
Authors
Our team is composed of:
👤 Oluwafemi Awoyemi
- GitHub: @phelian23
- LinkedIn: Oluwafemi Awoyemi
👤 Munsa Mibenge
👤 Rayan Rassam
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Show your support
Give a ⭐️ if you like this project!
Acknowledgments
- Alexey Savitskiy for the awesome design for our front-end.
📝 License
- This project is MIT licensed.