Technical & Operations
Technical & Operations Manual
Technical & Operations Architecture Manual
Comprehensive architectural specifications, technology stack, directory layout, environment configuration, local development runbook, automated test suites, and database disaster recovery procedures.
Three-Tier System Architecture
UI
Client Tier
Port 3000- Turbopack compiler with App Router
- Tailwind CSS + Lucide Icons
- Bilingual LTR / RTL Architecture
- PWA Optical Barcode & ePOD Signature
API
Application Tier
Port 4050- Node.js 22 LTS with TypeScript
- Global ValidationPipe with DTOs
- JwtAuthGuard & Multi-Tenant RolesGuard
- Decimal.js minor-unit financial math
DB
Data & Ledger Tier
Port 5432- Prisma ORM 5.22 client mappings
- Double-entry balanced JournalEntry
- ACID transaction boundaries ($transaction)
- Target DB: fromto_shipping_test
Environment Configuration Variables
| Variable | Required | Default Value | Description |
|---|---|---|---|
| PORT | Yes | 4050 | TCP port on which the NestJS 10 backend listens for incoming HTTP requests. |
| DATABASE_URL | Yes | postgresql://postgres:admin@localhost:5432/fromto_shipping_test?schema=public | PostgreSQL 18 connection URI for the authoritative test database. |
| JWT_SECRET | Yes | fromto_secret_key_demo_2026_xyz | Cryptographic secret string utilized for signing and validating session bearer tokens. |
| JWT_EXPIRES_IN | Optional | 7d | Lifespan and expiration window for authenticated user tokens. |
| NEXT_PUBLIC_API_URL | Optional | http://localhost:4050/api/v1 | Base URL used by the Next.js frontend client to communicate with backend endpoints. |
| NODE_ENV | Optional | development | Runtime mode flag controlling stack traces and Turbopack compiler behaviors. |
Local Development & Execution Runbook
1. Launch Backend API Service (Port 4050)
node scripts/start-backend.js
2. Launch Frontend Application (Port 3000)
node node_modules/next/dist/bin/next dev --turbopack -p 3000
3. Run Master Domain Acceptance Suites (17 Domain Engines)
node scripts/run-all-verifications.js
4. Audit Financial Invariants & Trial Balance
node scripts/reconcile-database.js
PostgreSQL Database Backup & Recovery
Binary pg_dump Command:
pg_dump -h localhost -p 5432 -U postgres -d fromto_shipping_test -F c -b -v -f "fromto_backup.dump"
Produces a compressed binary custom-format dump including all tables, audit logs, and ledger lines.
Database Restore Command:
pg_restore -h localhost -p 5432 -U postgres -d fromto_shipping_test -v --clean "fromto_backup.dump"
Restores schema and records, dropping old tables with --clean and recreating relational constraints.