Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fmanimashaun/book-car-api

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.
https://github.com/fmanimashaun/book-car-api

api cancancan devise devise-jwt postgersql rails-api-backend rails7 rspec-testing rswag-api

Last synced: 1 day ago
JSON representation

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.

Awesome Lists containing this project

README

        



# πŸ“— Table of Contents

- [πŸ“— Table of Contents](#-table-of-contents)
- [πŸ“– final_capstone_back_end ](#-final_capstone_back_end-)
- [πŸ›  ER Diagram ](#-er-diagram-)
- [πŸ’» link to front end ](#-link-to-front-end-)
- [πŸ’» link to Kanban board information ](#-link-to-kanban-board-information-)
- [πŸ›  Built With ](#-built-with-)
- [Tech Stack ](#tech-stack-)
- [Key Features ](#key-features-)
- [πŸ’» Getting Started ](#-getting-started-)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install](#install)
- [Database Setup](#database-setup)
- [Usage](#usage)
- [πŸ’» Tests ](#tests-)
- [πŸ‘₯ Authors ](#-authors-)
- [πŸ”­ Future Features ](#-future-features-)
- [🀝 Contributing ](#-contributing-)
- [⭐️ Show your support ](#️-show-your-support-)
- [πŸ™ Acknowledgments ](#-acknowledgments-)
- [❓ FAQ (OPTIONAL) ](#-faq-optional-)
- [πŸ“ License ](#-license-)

# πŸ“– BookCar Api

**BookCar RESTful API** for the [BookCar](https://github.com/fmanimashaun/book-car) 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.

- [BookCar (Frontend) Kanban Board](https://github.com/users/fmanimashaun/projects/16)
- [BookCar Api (Backend) Kanban Board](https://github.com/users/fmanimashaun/projects/16/views/1)

**Team Members**

- [Anwar Hussaini](https://github.com/M-Anwar-Hussaini)
- [Esteban Palacios](https://github.com/Estete9)
- [Timothy Njoroge](https://github.com/simplegoose)
- [Tomas Esquivel](https://github.com/tomasesquivelgc)
- [Animashaun Fisayo Micahel](https://github.com/fmanimashaun)

**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:

```sh
git clone https://github.com/fmanimashaun/book-car-api.git

```

### Install

After cloning the project, change into the project directory:

```sh
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:

```bash
rails db:create
```

4. Run migrations to set up the database schema:

```bash
rails db:migrate
```

5. Load default date to database:

```bash
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](https://www.loom.com/share/b9872f0da1e8491080b5b2a54a798abd?sid=6441add3-18a9-41e8-bfb8-38e308f2287d)__

__For deployment on render, you need to add your AWS credentials to the setup, see [Rails guides](https://edgeguides.rubyonrails.org/active_storage_overview.html#s3-service-amazon-s3-and-s3-compatible-apis) for assistance and additional [video guide](https://gorails.com/episodes/blog-posts-with-file-uploads-using-activestorage-and-amazon-s3)__

(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**

- GitHub: [@fmanimashaun](https://github.com/fmanimashaun)
- Twitter: [@fmanimashaun](https://twitter.com/fmanimashaun)
- LinkedIn: [Fisayo Michael Animashaun ](https://linkedin.com/in/fmanimashaun)

πŸ‘€ **TomΓ‘s MatΓ­as Esquivel**
- GitHub: [@tomasesquivelgc](https://github.com/tomasesquivelgc)
- Twitter: [@EsquivelTomas](https://twitter.com/EsquivelTomas)
- LinkedIn: [Tomas Esquivel](https://www.linkedin.com/in/tomΓ‘s-esquivel-b2160568/)

πŸ‘€ **Timothy Njoroge**
- GitHub: [@simplegoose](https://github.com/simplegoose)
- LinkedIn: [@Timothy Njoroge](https://linkedin.com/in/timothy-njoroge-mwangi)

πŸ‘€ *Anwar Hussaini*

- GitHub: [Anwar Hussaini](https://github.com/M-Anwar-Hussaini)
- LinkedIn: [Anwar Hussaini](https://www.linkedin.com/in/anwar-hussaini/)

πŸ‘€ **Esteban Palacios**

- GitHub: [@Estete9](https://github.com/Estete9)
- Twitter: [@NaughTban](https://twitter.com/NaughTban)
- LinkedIn: [Esteban Palacios](https://www.linkedin.com/in/dev-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](https://github.com/fmanimashaun/book-a-car-api/issues).

(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](https://www.behance.net/gallery/26425031/Vespa-Responsive-Redesign)
- [Microverse](https://www.microverse.org/) 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](./LICENSE).

(back to top)