This folder contains the canonical pnpm + Nx monorepo for the Tejo storefront and API.
Start here:
- Source of truth runbook:
docs/MASTER_PLAN.md - Package manager: pnpm-only
- Task runner: Nx (preferred via
pnpm exec nx)
| Path | Package | Purpose |
|---|---|---|
apps/web/ |
@tejo/web |
Next.js (Pages Router) storefront (webpack dev for i18n) |
apps/api/ |
@tejo/api |
NestJS API (module architecture) |
packages/shared/ |
@tejo/shared |
Shared types/utils (one-way imports only) |
- Node.js 20+
- pnpm 9+
- Docker Desktop (for canonical Postgres/Redis)
pnpm installQuick sanity check for canonical vs legacy drift, env presence, and basic prerequisites:
pnpm tejo:preflightCreates missing env files from committed templates without overwriting existing files.
pnpm env:bootstrappnpm db:bootstrap:flowpnpm live- Web: http://localhost:3003
- API: http://localhost:8003
- Canonical backend health is
GET /api/v1/healthon the API host. - In proxy mode (Next.js),
http://localhost:3003/api/healthis expected and rewrites to the backend health route. - Some files under
archive/may still mention legacy/healthpaths.
- E2E smoke test checklist: docs/WHOLESALE_CATALOG_REQUEST_SMOKE_TEST.md
- Automation entrypoint:
pnpm verify:wholesale(runs proxy mode + direct API mode) - Unfinished B2B pages are default-off behind
NEXT_PUBLIC_ENABLE_B2B_WHOLESALE(see apps/web/.env.example)
To keep frontend and backend running independently 24/7:
pnpm stack:up # Start db, redis, backend, frontend
pnpm stack:ps # Check statusNote: On first startup (or after DB restarts), the backend may take a bit longer to become healthy while it runs Prisma schema sync. The Docker startup uses a small retry loop to avoid failing on transient database readiness.
- Frontend: http://localhost:3003 (healthcheck enabled)
- Backend: http://localhost:8003 (health: http://localhost:8003/api/v1/health)
Manage services:
pnpm stack:stop # Stop backend & frontend (keep db/redis)
pnpm stack:restart # Restart backend & frontend
pnpm stack:logs # Follow logs (tail 100)
pnpm stack:down # Stop all & remove containers- E2E (Playwright):
pnpm test:e2e - Typecheck (all):
pnpm typecheck
This repo also contains older/parallel implementations under backend/, frontend/, and other directories. Those are not the canonical Nx + pnpm workflow documented in docs/MASTER_PLAN.md.
If you're unsure what is canonical, start with: docs/CANONICAL_WORKSPACE_AND_LEGACY.md.
Tip: pnpm check:working-tree prints a quick canonical vs legacy summary.
For historical docs, see archive/old-docs/README.md.