mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-28 23:43:43 +08:00
Add the NestJS backend with PostgreSQL and Redis, local setup, and independent frontend and fullstack source archives. Enforce permissions across redirects, let users dismiss the 403 page, and restore missing translation warnings in development.
14 lines
2.1 KiB
Markdown
14 lines
2.1 KiB
Markdown
# Optional NestJS server
|
|
|
|
Use this topic for the fullstack distribution, database persistence, authentication, permissions, Redis limits/cache, security, logs, and server startup.
|
|
|
|
Read the [server guide](../../apps/server/README.md), [platform contract](../../apps/server/src/platform/README.md), [shared contracts](../../packages/api-contracts/README.md), and [source distribution guide](../../apps/docs/guide/distributions.md).
|
|
|
|
- [Bootstrap](../../apps/server/src/app.ts) owns Nest modules and platform lifecycle. [Platform](../../apps/server/src/platform/index.ts) owns environment validation, Redis, request logging, security headers, CORS, limits, and health checks.
|
|
- [Database](../../apps/server/src/infrastructure/database.ts) owns Prisma lifetime and transaction retries. [Schema](../../apps/server/prisma/schema.prisma) and migrations are server-only. [Seed](../../apps/server/src/seed.ts) must preserve existing data.
|
|
- [Authentication](../../apps/server/src/modules/auth/auth.service.ts) checks live sessions and permission grants. Credential/session state must not use the reusable data cache.
|
|
- [Users](../../apps/server/src/modules/users/users.service.ts) validates and authorizes writes inside transactions. [Routes](../../apps/server/src/modules/routes/routes.controller.ts) use the shared route parser and generated catalog.
|
|
- [Fullstack launcher](../../scripts/fullstack.mjs) creates local configuration and orchestrates services. [Distribution exporter](../../scripts/distributions.mjs) projects independent frontend/fullstack workspaces; it never publishes branches or releases.
|
|
|
|
`pnpm harness verify server` runs type checks, unit/platform tests, and the backend build without requiring PostgreSQL. Real HTTP integration is explicit: set `TEST_DATABASE_URL` and `TEST_REDIS_URL`, then run `pnpm server:test:integration`. Tests own random schemas/prefixes and clean only those resources. Run the full Harness at integration completion and browser verification for the affected login, user and routing flows. Container builds and remote publication require independent evidence.
|