Skip to content

BookCar RESTful API for the BookACar 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.

License

Notifications You must be signed in to change notification settings

fmanimashaun/book-car-api

Repository files navigation

📗 Table of Contents

📖 BookCar Api

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.

(back to top)

🛠 Built With

Tech Stack

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)

Key Features

  • 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

(back to top)

💻 Getting Started

To get a local copy up and running, follow these steps:

Prerequisites

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.

Setup

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

Install

After cloning the project, change into the project directory:

cd cd book-car-api

bundle install

Credentials setup

In order to create databases and run the tests, you need to follow this steps:

  1. Remove config/credentials.yml.enc if they exist.
  2. If you use Windows run: $env:EDITOR="code --wait"; rails credentials:edit If you use Linux run: EDITOR="code --wait" bin/rails credentials:edit
  3. Close the editor. New master.key, credentials.yml.enc files will be generated.

Database Setup

This application uses PostgreSQL as the database. Here are the steps to set it up:

  1. Ensure PostgreSQL is installed on your machine and running.

  2. Update the config/database.yml file with your PostgreSQL username and password in the default section.

  3. Create the database:

rails db:create
  1. Run migrations to set up the database schema:
rails db:migrate
  1. 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

(back to top)

Tests

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

(back to top)

👥 Authors

👤 Fisayo Michael Animashaun

👤 Tomás Matías Esquivel

👤 Timothy Njoroge

👤 Anwar Hussaini

👤 Esteban Palacios

(back to top)

🔭 Future Features

  • 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.

(back to top)

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

⭐️ Show your support

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.

(back to top)

🙏 Acknowledgments

  • Behance and Murat Korkmaz for the original design
  • Microverse for providing the opportunity to learn in a collaborative environment.

(back to top)

❓ FAQ (OPTIONAL)

  • 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.

(back to top)

📝 License

This project is licensed under the MIT License - you can click here to have more details MIT.

(back to top)

About

BookCar RESTful API for the BookACar 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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages