141 words
Fast API & DB MySQL Setup
π FastAPI Pro Project & Auto create DB MySQL
This is a professional backend project using FastAPI, MySQL, Docker, and SQLAlchemy (async). Itβs structured for scalability, developer happiness, and clean architecture.
π¦ Tech Stack
- FastAPI β lightning-fast Python web framework
- SQLAlchemy (async) β async DB access
- MySQL 8 β production-grade relational DB
- Docker β containerized database
- Pydantic v2 β schema validation
- Uvicorn β ASGI server
- Makefile β automated CLI commands
π Getting Started
π 1. Clone the repo
git clone https://github.com/soyvitoupro/fast_api_structure.git
cd fast_api_structure
π 2. Create virtual environment
make create_env
π¦ 3. Install dependencies
make install_deps
π³ 4. Start MySQL using Docker
make db_up
π 5. Initialize the database
make init_db
π 6. Run the FastAPI server
make run_server
π§ͺ Example API Endpoints
GET / β Hello, World!
POST /api/v1/users β create a new user
GET /api/v1/users β list all users
GET /api/v1/users/{id} β get user by ID
PUT /api/v1/users/{id} β update user
DELETE /api/v1/users/{id} β delete user
MIT License
Copyright (c) 2025 Master Soy Vitou
Fast API & DB MySQL Setup
https://fuwari.vercel.app/posts/fast-api-structure/