🇨🇳 简体中文
Standard React FastAPI Environment
🇺🇸 English | 🇮🇳 हिंदी | 🇯🇵 日本語 | 🇨🇳 简体中文 | 🇪🇸 Español | 🇧🇷 Português (Brasil) | 🇰🇷 한국어 | 🇩🇪 Deutsch | 🇫🇷 Français
Mobile UI

Web UI

一个开箱即用的 full-stack starter container,用于将 Expo React Native app 连接到 FastAPI backend。
该 template 包含 Expo React Native frontend、FastAPI backend、PostgreSQL、JWT authentication、CRUD APIs、Docker Compose、backend tests、frontend tests,以及 GitHub Actions CI。
当你想使用 Expo 构建 mobile 或 web app,并将其连接到 FastAPI backend 时,可以使用这个 repository。
full-stack development environment 使用:
- Frontend: Expo (React Native + TypeScript)
- 使用单一 codebase 运行在 Web、Android 和 iOS 上
- Backend: FastAPI (Python)
- Database: PostgreSQL
- Container: 使用 Docker Compose 保持一致的 development setup
Features
- 基于 Expo 的 Cross-platform frontend
- 可作为 web app 运行,也可通过 Expo Go 或 standalone builds 运行在 Android/iOS devices 上
- CRUD operations : 创建、读取、更新、删除 records
- Auth operations : Signup、Signin、Signout
- 带有 automatic docs 的 FastAPI backend
/api/v1下的 versioned REST API,并提供 Swagger UI (/docs)
🚀 Getting Started
1. Prerequisites
- Docker Compose
- Expo Go (用于 Android/iOS testing)
2. Build 并 start 所有 services:
# set environment variables:
export REACT_NATIVE_PACKAGER_HOSTNAME=${YOUR_HOST}
# Build the image
docker compose build
# Run the container
docker compose up
3. Test:
# Backend pytest
docker compose \
-f docker-compose.test.yml run \
--rm \
--entrypoint /bin/sh backend_test \
-lc ' pytest -q '
# Backend Lint
docker compose \
-f docker-compose.test.yml run \
--rm \
--entrypoint /bin/sh backend_test \
-lc 'ruff check /app /tests'
# Frontend Test
docker compose \
-f docker-compose.test.yml run \
--rm frontend_test
4. 访问 services:
-
Backend API: http://localhost:8000/docs

- Frontend UI (WEB): http://localhost:8081
- Frontend UI (mobile): exp://${YOUR_HOST}:8081: 使用 Expo 提供的 QR 进行 access。

License
- Apache License 2.0