Skip to content

Commands Reference

A root Makefile wraps all common operations. Run make (or make help) for the full list.

MOD=xxx denotes a positional argument: e.g. make cli-init MOD=inventory.

Backend

RawMakePurpose
uv syncmake installInstall backend deps
uv run python run.pymake runStart backend dev server (:9999)
uv run ruff check app/
uv run ruff format --check app/
make lintRuff lint (no fix)
uv run ruff check --fix app/
uv run ruff format app/
make fmtRuff fix + format
uv run basedpyright appmake typecheckStatic type check
uv run pytest tests/ -vmake testUnit tests
make checkfmt + typecheck + test

Database

RawMakePurpose
uv run python -m app.cli initdbmake initdbFirst-time DB init (tables + base data)
uv run tortoise makemigrationsmake makemigrationsGenerate migration files from model changes
uv run tortoise migratemake migrateApply pending migrations
make mmmakemigrations + migrate in one go
uv run tortoise historymake dbhistoryMigration history

CLI code generation

RawMakePurpose
uv run python -m app.cli init <MOD>make cli-init MOD=xxxCreate module skeleton (models.py only)
uv run python -m app.cli gen <MOD>make cli-gen MOD=xxxParse models.py, generate backend schemas/controllers/api
uv run python -m app.cli gen-web <MOD>make cli-gen-web MOD=xxx [CN=Chinese-Name]Parse models.py, generate frontend service/typings/views/i18n fragments
make cli-gen-all MOD=xxx [CN=Chinese-Name]Run cli-gen + cli-gen-web

For details see Development guide.

Frontend

RawMakePurpose
cd web && pnpm installmake web-installInstall frontend deps
cd web && pnpm devmake web-devFrontend dev server (:9527)
cd web && pnpm buildmake web-buildProduction build
cd web && pnpm lintmake web-lintESLint + oxlint
cd web && pnpm typecheckmake web-typecheckvue-tsc
make web-checkweb-lint + web-typecheck

Full stack

CommandPurpose
make install-allInstall backend + frontend deps
make devRun backend (:9999) + frontend (:9527) together; Ctrl+C stops both
make check-allRun all backend + frontend quality checks

Docker

RawMakePurpose
docker compose up -dmake upStart full stack (nginx :1880 + fastapi :9999 + redis)
docker compose up -d --buildmake rebuildRebuild images and recreate containers (after code / Dockerfile changes)
docker compose downmake downStop & remove containers
docker compose logs -fmake logsTail all logs; pass SVC=app|nginx|redis to filter, TAIL=N for line count

Typical workflow

bash
# 1. install (first time)
make install-all

# 2. init DB (first time)
make initdb

# 3. create module skeleton
make cli-init MOD=inventory

# 4. edit app/business/inventory/models.py — define Tortoise models

# 5. generate backend code
make cli-gen MOD=inventory

# 6. generate frontend code
make cli-gen-web MOD=inventory CN=Inventory

# 5+6 in one shot:
# make cli-gen-all MOD=inventory CN=Inventory

# 7. run migrations
make mm

# 8. start dev servers
make dev

# 9. pre-push gate
make check-all

基于 MIT 协议发布