Skip to content

FastAPI project to manage restaurants, products and offers 🍔

Notifications You must be signed in to change notification settings

RafaelEmery/rafood-api

Repository files navigation

RaFood API

FastAPI project to manage restaurants, products and offers 🍔

About the project

It was based on this backend challenge and a opportunity to learn and apply some concepts of FastAPI

Tools used 🔨

  • Python (3.10)
  • Poetry
  • FastAPI
  • Pydantic
  • SQLAlchemy
  • Alembic
  • Pre-commit
  • PostgreSQL
  • Docker & Docker Compose

ER Model

er-model

Swagger

FastAPI generates an OpenAPI docs on /docs endpoint.

Contexts

Based on the ER Model there are 5 folder to separate contexts:

  • Restaurants and restaurant schedules
  • Products
  • Offers and offers schedules
  • Categories
  • Users

Running the API 🏃

To install the app:

poetry install

To run poetry shell:

make shell

To run the API:

make run

Start dependencies

To start and stop the Docker dependencies:

make dep-start

make dep-stop

Alembic migrations

To create a new revision (migration file based on the models definitions):

make create-migration name=<revision-name>

To migrate or rollback

make migrate

make rollback

Linter

The pre-commit is enable to run linter before each commit, but you can run any time. To run linter manually:

make lint

Tests

To be defined


✅ Major technical TODOs

  • Query params on lists endpoints
  • Improve body data validation
  • Return all relations correctly on 'get by ID' endpoints
  • Refactor to use services and core classes
  • Fix on error on alembic env.py file
  • Add tests for all endpoints and contracts
  • Improve exception handling errors
  • Improve logging
  • Solve minor TODOs
  • Write README docs

Made with 🔮 for studies by RafaelEmery

About

FastAPI project to manage restaurants, products and offers 🍔

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published