manicanldes-backend/README.md

34 lines
1.9 KiB
Markdown

# Mani Candles backend
Phase 1A provides the service foundation. Phase 1B adds staff account provisioning, authentication, sessions, recovery, configurable RBAC, and audit records. Phase 1C implements core commerce APIs.
## Setup
Use Node 24 LTS and pnpm 11.19.0. Copy `.env.example` to `.env` and set a PostgreSQL connection URL. Never commit credentials.
```sh
pnpm install --frozen-lockfile
pnpm db:generate
pnpm db:deploy
pnpm check
pnpm build
pnpm start
```
Development: run `pnpm dev` to compile on changes and `pnpm start:watch` in a second terminal after the first compilation. HTTP endpoints: `GET /api/v1/health/live` and `GET /api/v1/health/ready`. Readiness returns 503 when the database query fails. Health responses deliberately omit infrastructure details.
## Layout
- `src/config`: validated configuration, injected once.
- `src/database`: Prisma connection lifecycle and database probes.
- `src/health`: controller and application service.
- `prisma/migrations`: ordered, committed SQL migrations.
- `test`: configuration, lifecycle, and HTTP tests.
- `docs`: delivery roadmap and engineering workflow.
Production must use a managed secret store, TLS termination, a restricted database account, backups, and the deployment migration command. Do not expose this foundation as a completed commerce platform.
Identity: see [API contract](docs/identity-api.md) and [setup/release guide](docs/identity-operations.md).
Phase 1C adds catalog, private addresses and inventory. See [commerce API](docs/commerce-api.md), [errors](docs/error-contract.md), [migrations](docs/migrations.md), [security preparation](docs/vapt-readiness.md) and [verification](docs/verification.md).
Phase 1D adds versioned carts, coupons, atomic checkout and private order snapshots. See [checkout API and pricing boundary](docs/checkout-api.md). Payment remains disabled until tax, shipping and payment rules are finalized.