zhangtao 007864051a fix(frontend): 修复 5 条 P0(生产构建开关、令牌刷新、上传路径、WS 与开发地址)
- web/vite.config.ts:生产判据由 `mode === "prod"`(恒 false)改为 `production || prod`,
  压缩/去 console/剔除 vue-devtools 插件真正生效;同时修正 terser `comments: true`
  (是「保留全部注释」,与注释文字相反)为 `"some"`,保留 @license 等版权声明
- app 刷新令牌:改为发送 JSON 字符串(后端为 Body(str)),与 web 端已知可用实现一致,
  修掉移动端 token 过期必然 422 强制登出
- app 上传:路径补 /common(真实路径 /api/v1/common/file/upload),并改走统一 http 层的
  wd-upload upload-method 钩子,Authorization 由 http 层注入,不再页面自拼 URL
- app 生产 WS:ws://localhost:5180/ws → wss://service.fastapiadmin.com;开发 WS 指向本机
- app 开发接口地址:改为 http://127.0.0.1:8001,与 web 端开发策略一致

复核证据(队长独立执行):web/app type-check 均 exit 0;build:prod 与 build:h5 均 exit 0;
生产包内第一方 console 特征串 9/9 全部 0 命中(剩余 5 处 console 为字符串文案或
第三方 typeof 守卫,非可执行调用);H5 产物内 localhost:5180 命中 0、wss 域名命中 1、
裸 /file/upload 命中 0、/common/file/upload 命中 1。
2026-10-04 04:33:42 +08:00

logo

FastApiAdmin v3.0.0

🚀 Exceptional Code Quality, Production-Ready Admin Dashboard in 5 Minutes

Full-stack rapid development platform powered by FastAPI + Vue3 + TypeScript. Web, H5, and Mini Program — all in one project.

Gitee Stars GitHub Stars GitHub Forks
License Commit Activity

English | 简体中文

🖥️ Screenshots

Web

Dashboard

Mobile (H5 / Mini Program / App from one codebase)

💡 Why FastapiAdmin?

You Need FastapiAdmin Django Admin Frontend-Only
🎯 Ready-to-use admin system ✅ ⚠️ Limited ❌ UI only
⚡ FastAPI async high-performance backend ✅ ❌ Sync-first ❌ No backend
🔐 RBAC menu/button/data level permissions ✅ ❌ Basic ❌
🤖 Code generator (table → full CRUD) ✅ ❌ ❌
📱 Mobile (H5 + Mini Program) included ✅ ❌ ❌
🐳 Docker one-click deploy (Nginx + SSL) ✅ ❌ ❌

👉 Full comparison: Why FastapiAdmin?

🍪 Live Demo

URL Account
💻 Web service.fastapiadmin.com/web admin / 123456
📱 Mobile service.fastapiadmin.com/app admin / 123456
📖 Official Docs service.fastapiadmin.com No login

🚀 5-Minute Quick Start

# 1. Clone
git clone https://github.com/fastapiadmin/FastapiAdmin.git

# 2. Configure environments
cp backend/env/.env.example backend/env/.env.dev
cp frontend/web/.env.development.example frontend/web/.env.development

# 3. Start backend (auto-creates tables + seed data on first run)
cd backend && uv sync && uv run main.py run --env=dev

# 4. Start frontend
cd ../frontend/web && pnpm install && pnpm run dev

# ✅ Open http://127.0.0.1:5173, login with admin/123456
Requirements
Python ≥ 3.12 Node.js ≥ 20 + pnpm
MySQL 8.0+ / PostgreSQL 14+ Redis 6.x / 7.x

🐳 Or: One-Command Docker Deployment

cp docker/.env.example docker/.env    # Fill in MySQL / Redis passwords
./deploy.sh                           # Build images and start the full stack (Nginx + SSL included)

For ports, SSL certificates and frontend builds, see the Docker deployment guide.

📦 Structure

FastapiAdmin/            # Monorepo full-stack project
├─ backend/              # FastAPI backend (Pydantic 2.0 + SQLAlchemy + Alembic)
├─ frontend/
│   ├── web/             # Vue3 Web (Element Plus + TypeScript)
│   ├── app/             # UniApp Mobile (H5 + Mini Program + App)
│   └── docs/            # VitePress documentation
├─ docker/               # Docker Compose deploy (Nginx + SSL)
├─ deploy.sh             # One-click deploy script
└─ LICENSE               # MIT

📌 Built-in Features

200+ REST endpoints · MySQL / PostgreSQL / SQLite · SFTP / S3 / OSS / COS / OBS storage adapters · Trim modules with a single ENABLED_MODULES entry

Core Modules (always enabled, cannot be removed)

Module Capabilities
📊 Dashboard Workbench, Analytics
⚙️ System Management Users, Roles, Menus, Departments, Positions, Dicts, Config, Notices, Tickets, Versions
👀 Monitoring Online users, Server monitoring, Cache monitoring
📝 Logs Operation audit
🧰 Dev Tools API Docs

Extension Modules (enabled by default, trim via ENABLED_MODULES)

Module Capabilities Toggle
🧩 Task Management Scheduled tasks + visual workflow orchestration (built-in business nodes) task
🔧 Code Generator Table → full frontend/backend code generator
📁 Storage Unified file / object storage (SFTP / S3 / OSS / COS / OBS) storage
🤖 AI Chat Agno-powered agent conversations ai
💬 Internal Chat Text-only private / group chat between users (WebSocket real-time push + unread badge) chat

🔧 Module Toggling

Extension modules can be enabled/disabled on demand via ENABLED_MODULES in backend/app/config/setting.py — just remove an item from the list; no code or menu deletion needed. The corresponding REST endpoints, WebSocket endpoints and initialization logic will not be loaded automatically:

# e.g. Disable internal chat and AI assistant, keep the rest
ENABLED_MODULES = ["generator", "task", "storage"]

🚦 Deployment Notes

  • Chat scope: Internal chat is positioned as lightweight internal communication — text-only messages. No file transfer, recall, read receipts, or multi-device sync (IM features). For strong IM needs, integrate mature products such as WeCom / DingTalk / Feishu. It can be disabled anytime by removing chat from ENABLED_MODULES.
  • Single-instance deployment: Real-time features (internal chat WebSocket, scheduled task scheduler) rely on in-memory connections and local scheduling within a single instance — please deploy as a single instance. For horizontal scaling, integrate Redis Pub/Sub or a message queue yourself.
  • Key security: Configure all third-party keys (AI, cloud storage, etc.) in the backend/env/.env.* environment variables. Never commit them to the repository or store them in the database.
  • Database migrations: Manage schema changes with Alembic migrations in production (uv run alembic upgrade head); create_all is only a fallback for first-time initialization.

📷 More Screenshots

Login Code Generator AI Assistant
Login Code Generator AI

📖 Documentation

🤝 Contributing

Issues and PRs are welcome! See Contributing Guide.

👥 Community

⭐ Star History

Star History Chart

👥 Contributors

Thank you to all contributors who have contributed code to FastapiAdmin.

🙏 Acknowledgments

If you find this project useful, please give it a ⭐️ Star!

S
Description
基于 FastAPI + Vue3 + TypeScript 的全栈快速开发平台,Web / H5 / 小程序一站式交付
Readme MIT
157 MiB
Languages
Vue 33.5%
JavaScript 26%
Python 23.2%
TypeScript 13.8%
SCSS 1.2%
Other 2.2%