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

License: MIT

Fast API & DB MySQL Setup
https://fuwari.vercel.app/posts/fast-api-structure/
Author
Soy Vitou
Published at
2025-03-21
License
@SoyVitou