Add admin-frontend and user-frontend standalone projects, certification/invoice/discovery features, fix auth header and theme consistency
This commit is contained in:
@@ -15,16 +15,24 @@
|
||||
# Backend (from project root — .env is there)
|
||||
cd backend && source venv/bin/activate && uvicorn app.main:app --reload --port 8000
|
||||
|
||||
# Frontend
|
||||
# Frontend — uni-app (mobile)
|
||||
cd uni-app && npm run dev:h5
|
||||
|
||||
# Admin frontend (PC management)
|
||||
cd admin-frontend && npm run dev # port 5173, base: /admin/
|
||||
|
||||
# User workspace (PC workbench)
|
||||
cd user-frontend && npm run dev # port 5174, base: /workspace/
|
||||
|
||||
# Tests (backend — needs PostgreSQL running with foreign_trade_test DB)
|
||||
cd backend && venv/bin/pytest # all
|
||||
venv/bin/pytest tests/test_auth_api.py # single file
|
||||
venv/bin/pytest tests/ -k "test_login" # keyword filter
|
||||
|
||||
# Frontend build (produces uni-app/dist/build/h5/)
|
||||
cd uni-app && npm run build:h5
|
||||
# Builds
|
||||
cd uni-app && npm run build:h5 # uni-app (mobile H5)
|
||||
cd admin-frontend && npm run build # admin => /www/wwwroot/trade.yuzhiran.com/admin/
|
||||
cd user-frontend && npm run build # workspace => /www/wwwroot/trade.yuzhiran.com/workspace/
|
||||
|
||||
# Alembic migrations
|
||||
cd backend && alembic upgrade head
|
||||
@@ -34,10 +42,12 @@ alembic revision --autogenerate -m "desc"
|
||||
## Deployment
|
||||
|
||||
- **Landing page** at `trade.yuzhiran.com/` — static marketing HTML
|
||||
- **SPA** at `trade.yuzhiran.com/app/` — uni-app build
|
||||
- **Nginx**: `location /app/ { try_files $uri $uri/ /app/index.html; }` for SPA fallback
|
||||
- **vite config**: `base: '/app/'` so all asset paths are `/app/assets/...`
|
||||
- **API**: proxied via nginx `location /api/` to `127.0.0.1:8000`
|
||||
- **SPA** at `trade.yuzhiran.com/app/` — uni-app build (mobile)
|
||||
- **Admin** at `trade.yuzhiran.com/admin/` — Vue 3 + Element Plus (standalone)
|
||||
- **Workspace** at `trade.yuzhiran.com/workspace/` — Vue 3 + Element Plus (standalone)
|
||||
- **Nginx**: SPA fallbacks for `/app/`, `/admin/`, `/workspace/`
|
||||
- **vite config**: each project has its own `base` path and dev port
|
||||
- **API**: proxied via nginx `location /api/` to `127.0.0.1:8002`
|
||||
|
||||
## Critical Quirks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user