Backend foundation for the AI tool entry.
POST /auth/loginGET /auth/meGET /health
This is the first module. Future AI-related APIs can live here as well.
Copy .env.example to .env and fill:
DATABASE_URLAUTH_SECRETCORS_ORIGINMODEL_API_BASE_URLMODEL_API_KEYMODEL_MODELMODEL_PROVIDERMODEL_API_PATHMODEL_SYSTEM_PROMPT
If you deploy the backend on Alibaba Cloud and use GitHub Actions or a similar
pipeline, keep DATABASE_URL and AUTH_SECRET as deployment secrets. The
frontend must not read DATABASE_URL; it only needs the auth service URL.
If you want /ai/chat to call a cloud model, set MODEL_API_BASE_URL and
MODEL_API_KEY to an OpenAI-compatible endpoint. If those are missing, the
backend falls back to the built-in local reply.
Run sql/schema.sql in PostgreSQL first.
cd /opt/svaf-backend
pnpm install
pnpm startcd /opt/svaf-backend
[email protected] PASSWORD='your-password' DISPLAY_NAME='Admin' ROLE=admin pnpm seed-usercd /opt/svaf-backend
pnpm hash-passwordUse the printed hash if you want to insert users manually.