/food-delivery-service-react-rails

Food Delivery Service is a Minimum Viable Product (MVP) application of an online food ordering and delivery platform based on iFood.

Primary LanguageRuby

Food delivery MVP

🌐 Para a versão em português deste README, clique aqui.

Food Delivery Service is a Minimum Viable Product (MVP) application of an online food ordering and delivery platform based on iFood.
Logo Swagger UI Logo Ruby on Rails Logo React js GitHub top language GitHub release (latest by date)

Summary

1. Requirements:

  • Backend
    • Ruby 2.7.3
    • Rails 6.1.3
    • SQLite
  • Frontend
    • React
    • TypeScript
    • Vite
    • Yarn

2. Installation:

Clone the repo:

git clone https://github.com/EuCarlos/food-delivery-service-react-rails.git && cd food-delivery-service-react-rails

2.1. Backend

Install dependencies using Yarn or NPM:

cd backend && bundle install

Configuration:

Database creation

rails db:create

Database initialization

rails db:migrate

Run the project

rails s

2.2. Frontend

Install the dependencies using Yarn:

cd frontend && yarn install

Run the project

yarn dev

3. Routes API

OBS.: All route information has been documented with Swagger UI, and can be found in the /api-docs route

Prefix Verb URI Pattern Controller#Action
categories GET /api/categories(.:format) categories#index {:format=>:json}
restaurants GET /api/restaurants(:format) restaurants#index {:format=>:json}
restaurant GET /api/restaurants/:id(.:format) restaurants#show {:format=>:json}
orders POST /api/orders(.:format) orders#create {:format=>:json}
order GET /api/orders/:id(.:format) orders#show {:format=>:json}
available_cities GET /api/available_cities(.:format) available_cities#index {:format=>:json}

POST -> Orders

{
    "order":{
        "name": "Carlos Alves",
        "phone_number": "22912345678",
        "restaurant_id": 1,
        "city": "Curitiba",
        "street": "São João",
        "neighborhood": "Tingui",
        "number": "115",
        "complement": "apartamento 4",
        "order_products_attributes": [
            { "quantity": 1, "product_id": 1 },
            { "quantity": 9, "product_id": 2 }
        ]
    }
}

4. Filters

curl http://localhost:3000/api/restaurants?
    q=bravo             # filter by query
    &city=Maceio        # filter by city
    &category=mexicana  # filter by category

5. How to contribute to this project?

Before starting, check and follow the instructions for contributing to the repository. If not, you can follow the instructions below:

  1. Fork the project
  2. Create a new branch: git checkout -b nova-branch
  3. Commit your changes: git commit -m 'I added something'
  4. Push to branch: git push origin nova-branch
  5. Open a Pull Request

6. How do I report a bug or request a feature?

If you want to report a bug or request a feature, go to Issue on the GitHub Project and add your request.


Created with 💜 by Carlos Alves