A modern RESTful API server built with FastAPI for managing family recipes and cookbook collections.
- FastAPI - Modern, fast web framework for building APIs
- PostgreSQL - Powerful relational database
- Redis - In-memory cache for improved performance
- Docker - Containerization for easy deployment
- Python 3.13 - Latest Python version
Before running this project, make sure you have installed:
- π³ Docker (version 20.10 or higher)
- π³ Docker Compose (version 2.0 or higher)
- Clone the repository
git clone <repository-url> cd MiBook-Server
-
Start all services
docker-compose up --build
-
The API will be available at:
- π API: http://localhost:8000
- π Interactive API Docs: http://localhost:8000/docs
- π Alternative API Docs: http://localhost:8000/redoc
-
Stop the services
docker-compose down
The project is configured to run in development mode with hot-reload enabled. Any changes you make to the code will automatically restart the server.
The project includes three main services:
| Service | Port | Description |
|---|---|---|
| π API | 8000 | FastAPI application server |
| ποΈ PostgreSQL | 5432 | Database server |
| β‘ Redis | 6379 | Cache server |
MiBook-Server/
βββ src/
β βββ main.py # FastAPI application entry point
β βββ ...
βββ db-data/ # PostgreSQL data (auto-generated)
βββ docker-compose.yml # Docker services configuration
βββ Dockerfile # API service container configuration
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
docker-compose exec api pytestdocker-compose exec api black .docker-compose exec api flake8| Variable | Default | Description |
|---|---|---|
DB_HOST |
db | Database host |
DB_NAME |
family_recipes | Database name |
DB_USER |
postgres | Database user |
DB_PASS |
postgres | Database password |
DB_PORT |
5432 | Database port |
DEBUG |
- | Enable debug mode |
SECRET_KEY |
- | Application secret key |
ALLOWED_HOSTS |
- | Allowed hosts for CORS |
GET /- Welcome messageGET /docs- Swagger UI documentationGET /redoc- ReDoc documentation
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the terms specified in the LICENSE file.
Luis Silva
- Email: luisgsilva26@gmail.com
Made with β€οΈ using FastAPI