BookCar RESTful API for the BookCar reservation application, enabling car data management, reservations, and user authentication. Developed as the Microverse Full-Stack Web Development Capstone Project, demonstrating Ruby on Rails, React, database design, API development, and collaboration skills.
Team Members
ER Diagram The API is designed as per the ER Diagram shown below which dictates the association of models and their relationships.
Programming Language
- Ruby 3.2.2
Web Application Framework
- Rails 7.1.2
Database
- PostgreSQL (pg gem)
Web Server
- Puma
Performance Optimization
- Bootsnap
Testing
- Debug
- Factory Bot (factory_bot_rails gem)
- RSpec (rspec-rails gem)
- Capybara
- Selenium Webdriver
Code Quality
- Rubocop
Development Tools
- Web Console (web-console gem)
Authentication
- Devise (devise gem)
- Devise-jwt (devise-jwt gem)
Authorization
- CanCanCan (cancancan gem)
- Database Design:
- Schema: Design the entities (cars, reservations, users, roles) and their relationships.
- Migrations: Create/modify database schema changes.
- Models & Associations:
- Rails Models: Build Car, Reservation, User, and associated models.
- Image Storage: Ensure robust integration with Active Storage for car image handling.
- API Endpoints:
- CRUD for Cars: GET (fetch car lists, details), POST (admin adds car), DELETE (admin removes car).
- Reservations: GET (user's reservations), POST (book a car).
- Authentication: Login, signup (if supported), session management.
- Authorization (CanCanCan): Define rules for admin-only actions.
- API Documentation: Maintain concise yet informative documentation
To get a local copy up and running, follow these steps:
Before you begin, ensure you have the following prerequisites installed on your system:
- Ruby: You need Ruby to run the Ruby on Rails application.
- Bundler: Bundler is used to manage gem dependencies for your Ruby project.
In your terminal, navigate to the folder of your choice and clone the repository with the following commands:
git clone https://github.com/fmanimashaun/book-car-api.git
After cloning the project, change into the project directory:
cd cd book-car-api
bundle install
In order to create databases and run the tests, you need to follow this steps:
- Remove
config/credentials.yml.enc
if they exist. - If you use Windows run:
$env:EDITOR="code --wait"; rails credentials:edit
If you use Linux run:EDITOR="code --wait" bin/rails credentials:edit
- Close the editor. New master.key, credentials.yml.enc files will be generated.
This application uses PostgreSQL as the database. Here are the steps to set it up:
-
Ensure PostgreSQL is installed on your machine and running.
-
Update the config/database.yml file with your PostgreSQL username and password in the default section.
-
Create the database:
rails db:create
- Run migrations to set up the database schema:
rails db:migrate
- Load default date to database:
rails db:seed
This should start your local server on http://localhost:4000/ using rails s
. Now, you can use the REST API client of your choice to interact with the API.
For guide on how to setup the database, refer to the video recording
For deployment on render, you need to add your AWS credentials to the setup, see Rails guides for assistance and additional video guide
To run tests, navigate to the directory where the project is located on your machine, open your terminal, and follow these steps:
Test Suite This project contains a suite of unit tests which you can run to ensure everything is functioning as expected. To run these tests, you need RSpec installed.
bundle exec rspec ./spec/requests
bundle exec rspec ./spec/models
👤 Fisayo Michael Animashaun
- GitHub: @fmanimashaun
- Twitter: @fmanimashaun
- LinkedIn: Fisayo Michael Animashaun
👤 Tomás Matías Esquivel
- GitHub: @tomasesquivelgc
- Twitter: @EsquivelTomas
- LinkedIn: Tomas Esquivel
👤 Timothy Njoroge
- GitHub: @simplegoose
- LinkedIn: @Timothy Njoroge
👤 Anwar Hussaini
- GitHub: Anwar Hussaini
- LinkedIn: Anwar Hussaini
👤 Esteban Palacios
- GitHub: @Estete9
- Twitter: @NaughTban
- LinkedIn: Esteban Palacios
- Advanced Filtering/Search: Allow users to search/filter by:
- [ ]Car make and model.
- [ ]Specific dates with a visual calendar/picker.
- [ ]Features/amenities (e.g., transmission type, seating capacity).
- User Profiles: Allow users to save preferences, view past reservations, and perhaps offer loyalty points/rewards.
- Reviews and Ratings: A simple system for users to rate cars or provide feedback on experiences.
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project please feel free to send us corrections for make it better we would feel glad to read your comments. And think If you enjoy it gift us a star.
- Behance and Murat Korkmaz for the original design
- Microverse for providing the opportunity to learn in a collaborative environment.
-
Can I use with a templeate your project?
- Of course we would feel honored.
-
Your project is free license?
- Yeah, you can use it completely.
This project is licensed under the MIT License - you can click here to have more details MIT.