fastapi-fullstack

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

FastAPI Full Stack

FastAPI全栈项目

A Python full-stack application with FastAPI backend.
一个基于FastAPI后端的Python全栈应用。

Tech Stack

技术栈

  • Backend: FastAPI, Python
  • Frontend: React
  • Database: PostgreSQL
  • ORM: SQLAlchemy
  • 后端: FastAPI, Python
  • 前端: React
  • 数据库: PostgreSQL
  • ORM: SQLAlchemy

Prerequisites

前置要求

  • Python 3.11+
  • Docker (recommended)
  • Python 3.11+
  • Docker(推荐)

Setup

设置步骤

1. Clone the Template

1. 克隆模板

bash
git clone --depth 1 https://github.com/tiangolo/full-stack-fastapi-template.git .
If the directory is not empty:
bash
git clone --depth 1 https://github.com/tiangolo/full-stack-fastapi-template.git _temp_template
mv _temp_template/* _temp_template/.* . 2>/dev/null || true
rm -rf _temp_template
bash
git clone --depth 1 https://github.com/tiangolo/full-stack-fastapi-template.git .
如果目录非空:
bash
git clone --depth 1 https://github.com/tiangolo/full-stack-fastapi-template.git _temp_template
mv _temp_template/* _temp_template/.* . 2>/dev/null || true
rm -rf _temp_template

2. Remove Git History (Optional)

2. 移除Git历史记录(可选)

bash
rm -rf .git
git init
bash
rm -rf .git
git init

3. Setup with Docker (Recommended)

3. 使用Docker设置(推荐)

bash
docker compose up -d
bash
docker compose up -d

4. Or Setup Manually

4. 或手动设置

bash
cd backend
pip install -r requirements.txt
bash
cd backend
pip install -r requirements.txt

Development

开发运行

With Docker:
bash
docker compose up -d
Manual:
bash
cd backend
uvicorn main:app --reload
使用Docker:
bash
docker compose up -d
手动运行:
bash
cd backend
uvicorn main:app --reload