English | 简体中文
A modern enterprise-level admin management system with dual backend options (Django/FastAPI) + Vue3 + Element Plus
Account: yangfei
Password: 123456
For questions or suggestions, please contact us via:
-
Issue: GitHub Issues
-
Email: jiangzhikj@outlook.com
-
WeChat: dlpuzcl
-
QQ Group: 1073561328
zq-platform is a comprehensive enterprise-level admin management system solution with a separated frontend and backend architecture. It offers two backend options: Django 5.2 + Django Ninja or FastAPI + SQLAlchemy async ORM, while the frontend is based on Vue 3 + Vben Admin + Element Plus to create a modern management interface.
- 🎯 Complete RBAC Permission System - Multi-dimensional permission control for users, roles, permissions, departments, and positions
- 🔐 JWT Authentication - Secure token authentication with Access Token and Refresh Token support
- 📊 System Monitoring - Server monitoring, Redis monitoring, database monitoring for real-time system status
- 📁 File Management - Comprehensive file upload, download, and preview functionality
- 📝 Operation Logs - Detailed login logs and operation auditing
- 🗂️ Data Dictionary - Flexible dictionary management with multi-level classification support
- ⏰ Task Scheduling - APScheduler-based scheduled task management
- 🔌 WebSocket Support - Real-time communication capabilities
- 🌐 Multi-Database Support - MySQL, PostgreSQL, SQL Server, SQLite
- 🎨 Modern UI - Responsive design with dark mode support
- 📦 Monorepo Architecture - Frontend engineering solution based on pnpm workspace
Django Backend (backend-django)
- Core Framework: Django 5.2.7
- API Framework: Django Ninja 1.4.5 (High-performance API framework)
- Authentication: PyJWT 2.8.0
- Task Scheduling: APScheduler 3.10.4
- Caching: Redis + django-redis
- WebSocket: Django Channels 4.2
- Database Drivers: psycopg2-binary, pymysql, pyodbc
- Server: Uvicorn 0.38.0 / Gunicorn 23.0.0
- Others: openpyxl, geoip2, psutil, cryptography
FastAPI Backend (backend-fastapi)
- Core Framework: FastAPI 0.115+
- ORM: SQLAlchemy 2.0+ (Async)
- Database: PostgreSQL 16+
- Migration: Alembic
- Authentication: JWT
- Caching: Redis
- Python: 3.12+
- Core Framework: Vue 3.x
- Build Tool: Vite 5.x
- UI Component Library: Element Plus
- State Management: Pinia
- Router: Vue Router
- HTTP Client: Axios
- Utility Libraries: VueUse, dayjs, lodash-es
- Code Standards: ESLint, Prettier, Stylelint
- Package Manager: pnpm 10.14.0
- Monorepo: Turbo
zq-platform/
├── backend-django/ # Django Backend
│ ├── application/ # Project Configuration
│ ├── core/ # Core Business Modules
│ │ ├── auth/ # Authentication & Authorization
│ │ ├── user/ # User Management
│ │ ├── role/ # Role Management
│ │ ├── permission/ # Permission Management
│ │ ├── dept/ # Department Management
│ │ ├── post/ # Position Management
│ │ ├── menu/ # Menu Management
│ │ ├── dict/ # Dictionary Management
│ │ ├── login_log/ # Login Logs
│ │ ├── file_manager/ # File Management
│ │ ├── server_monitor/ # Server Monitoring
│ │ ├── redis_monitor/ # Redis Monitoring
│ │ ├── redis_manager/ # Redis Management
│ │ ├── database_monitor/ # Database Monitoring
│ │ └── database_manager/ # Database Management
│ ├── scheduler/ # Task Scheduling Module
│ ├── common/ # Common Modules
│ ├── env/ # Environment Configuration
│ ├── requirements.txt # Python Dependencies
│ └── manage.py # Django Management Script
│
├── backend-fastapi/ # FastAPI Backend (Optional)
│ ├── app/ # Core Application Module
│ ├── core/ # Core Business Modules
│ ├── scheduler/ # Task Scheduling Module
│ ├── scripts/ # Utility Scripts
│ ├── alembic/ # Database Migration
│ ├── env/ # Environment Configuration
│ ├── requirements.txt # Python Dependencies
│ └── main.py # Application Entry
│
└── web/ # Vue Frontend (Monorepo)
├── apps/
│ └── web-ele/ # Element Plus Main Application
│ ├── src/
│ │ ├── api/ # API Interfaces
│ │ ├── views/ # Page Components
│ │ ├── router/ # Router Configuration
│ │ └── store/ # State Management
│ └── package.json
├── packages/ # Shared Packages
│ ├── @core/ # Core Packages
│ ├── effects/ # Effects Packages
│ ├── hooks/ # Hooks
│ ├── icons/ # Icons
│ ├── locales/ # Internationalization
│ ├── stores/ # State Management
│ └── utils/ # Utility Functions
├── internal/ # Internal Tools
└── package.json # Root Configuration
-
Backend
- Python >= 3.10
- MySQL >= 5.7 / PostgreSQL >= 12 / SQL Server
- Redis >= 5.0
-
Frontend
- Node.js >= 20.10.0
- pnpm >= 9.12.0
- Clone the Project
git clone https://github.com/jiangzhikj/zq-platform.git
cd zq-platform/backend-django- Create Virtual Environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows- Install Dependencies
pip install -r requirements.txt- Configure Environment Variables
cp env
# Edit the .env file to configure database, Redis, JWT keys, etc.Main configuration items:
# JWT Keys
JWT_ACCESS_SECRET_KEY=your-jwt-access-secret
JWT_REFRESH_SECRET_KEY=your-jwt-refresh-secret
# Database Configuration
DATABASE_TYPE=MYSQL # MYSQL/POSTGRESQL/SQLSERVER/SQLITE3
DATABASE_HOST=127.0.0.1
DATABASE_PORT=3306
DATABASE_USER=root
DATABASE_PASSWORD=password
DATABASE_NAME=zq_admin
# Redis Configuration
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=2- Database Migration
python manage.py makemigrations core scheduler
python manage.py migrate- Initialize Data
python manage.py loaddata db_init.json- Start Service
# Development Environment
python manage.py runserver 0.0.0.0:8000
- Start Task Scheduler (Optional)
# Production Environment
python start_scheduler.py- Navigate to FastAPI Directory
cd zq-platform/backend-fastapi- Create Virtual Environment
conda create -n zq-fastapi python=3.12
conda activate zq-fastapi- Install Dependencies
pip install -r requirements.txt- Configure Environment Variables
cp env/example.env env/dev.env
# Edit env/dev.env to configure database connection- Database Migration
alembic revision --autogenerate -m "init tables"
alembic upgrade head
# Import initial data (optional)
python scripts/loaddata.py db_init.json- Start Service
python main.py
# or
uvicorn main:app --reload --host 0.0.0.0 --port 8000- Access API Documentation
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Navigate to Frontend Directory
cd zq-platform/web- Install Dependencies
pnpm install- Configure Environment Variables
cd apps/web-ele
cp .env.development .env
# Edit the .env file to configure backend API address- Start Development Server
# In web root directory
pnpm dev- Build for Production
pnpm build:eleAfter initializing data, you can login with the following account:
- Username:
superadmin - Password:
123456or contact administrator
- User Management: CRUD operations for users, password reset, status management
- Role Management: Role permission assignment, data permission control
- Permission Management: Fine-grained API and button permission control
- Department Management: Tree-structured department management
- Position Management: Position information maintenance
- Menu Management: Dynamic menu configuration, route management
- Dictionary Management: System dictionary maintenance
- Server Monitoring: Real-time monitoring of CPU, memory, disk, network
- Redis Monitoring: Redis performance metrics, key-value management
- Database Monitoring: Database connection, performance monitoring
- Login Logs: User login records, IP geolocation
- Scheduled Tasks: Cron expression configuration
- Task Logs: Execution history, result viewing
- Task Management: Start, stop, execute immediately
- File Upload: Multi-file upload support
- File Preview: Online preview for images and documents
- File Download: Batch download functionality
Django Backend
- Swagger UI:
http://localhost:8000/api/docs - ReDoc:
http://localhost:8000/api/redoc
FastAPI Backend
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
-
Adding New Modules
- Create in
core/or create a new app - Define models, schemas, services, api
- Register routes in router
- Create in
-
API Development Standards
- Use Django Ninja decorators
- Unified return format
- Exception handling
- Permission verification
-
Adding New Pages
- Create page components in
src/views/ - Add routes in
src/router/routes/modules/ - Add API definitions in
src/api/
- Create page components in
-
Component Development Standards
- Use Element Plus components
- Prefer Tailwind CSS
- Support dark mode
- Import icons from
@vben/icons
-
Backend Deployment
- Use Gunicorn + Nginx
- Configure Supervisor process daemon
- Configure SSL certificates
-
Frontend Deployment
- Execute
pnpm buildto build - Deploy
distdirectory to Nginx - Configure reverse proxy
- Execute
Issues and Pull Requests are welcome!
- Fork this project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Django - Powerful Python web framework
- Django Ninja - Fast Django REST framework
- Vue Vben Admin - Excellent Vue3 admin template
- Element Plus - Vue 3 component library
