2023-04-20 21:16:12 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00
2023-04-19 11:05:49 +08:00

FastAPI Best Architecture

This is a base project of the FastAPI framework.

Its purpose is to allow you to develop your project directly with it as your base project

Skill

  • FastAPI
  • Pydantic
  • SQLAlchemy
  • Alembic
  • MySQL
  • Redis
  • APScheduler
  • Docker

Clone

git clone https://github.com/wu-clan/fastapi_best_architecture.git

Use:

1Tradition

  1. Install dependencies

    pip install -r requirements.txt
    
  2. Create a database fba, choose utf8mb4 encode

  3. Install and start Redis

  4. View backend/app/core/conf.py, update database configuration information

  5. Perform a database migration alembic

    cd backend/app/
    
    # Generate the migration file
    alembic revision --autogenerate
    
    # Perform the migration
    alembic upgrade head
    
  6. Execute the backend/app/main.py file startup service

  7. Browser access: http://127.0.0.1:8000/v1/docs


2Docker

  1. Run the one-click start command in the directory where the docker-compose.yml file is located

    docker-compose up -d --build
    
  2. Wait for the command to finish automatically

  3. Browser access: http://127.0.0.1:8000/v1/docs

Init the test data

Execute the backend/app/init_test_data.py file

Description
FastAPI Best Architecture is an enterprise-grade backend architecture solution built with FastAPI. FastAPI 最佳架构是使用 FastAPI 构建的企业级后端架构解决方案
Readme MIT 9.4 MiB
Languages
Python 96.8%
Jinja 2.2%
HTML 0.5%
Dockerfile 0.3%
Shell 0.1%