Skip to content

Latest commit

Β 

History

History
129 lines (90 loc) Β· 3.09 KB

File metadata and controls

129 lines (90 loc) Β· 3.09 KB

πŸ“š MiBook-Server

A modern RESTful API server built with FastAPI for managing family recipes and cookbook collections.

πŸš€ Tech Stack

  • 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

πŸ“‹ Prerequisites

Before running this project, make sure you have installed:

πŸ› οΈ Installation & Setup

  1. Clone the repository
    git clone <repository-url>
    cd MiBook-Server

πŸš€ Running the Project

Using Docker Compose (Recommended)

  1. Start all services

    docker-compose up --build
  2. The API will be available at:

  3. Stop the services

    docker-compose down

Running in Development Mode

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.

πŸ“¦ Services

The project includes three main services:

Service Port Description
πŸš€ API 8000 FastAPI application server
πŸ—„οΈ PostgreSQL 5432 Database server
⚑ Redis 6379 Cache server

πŸ—‚οΈ Project Structure

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

πŸ”§ Development

Running Tests

docker-compose exec api pytest

Code Formatting

docker-compose exec api black .

Linting

docker-compose exec api flake8

🌍 Environment Variables

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

πŸ“ API Endpoints

  • GET / - Welcome message
  • GET /docs - Swagger UI documentation
  • GET /redoc - ReDoc documentation

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the terms specified in the LICENSE file.

πŸ‘€ Author

Luis Silva


Made with ❀️ using FastAPI