Master Backend Plan v3.0 + Government Portal + Implementation Order

This commit is contained in:
Bernt
2026-07-02 18:23:50 +00:00
parent ca43443119
commit 4080c7add8
10 changed files with 1081 additions and 0 deletions
+30
View File
@@ -500,3 +500,33 @@ Includes version info (Environment, Version, Commit, Build time) and exit criter
### Sprint 0 Mål
> En pilotanvändare får en länk, installerar appen via TestFlight eller Google Play Internal Testing, loggar in och genomför ett uppdrag mot https://pilot.landvex.com utan hjälp från en utvecklare.
## 2026-07-02 18:21 UTC — Pre-compaction memory flush
### Gateway Development Started
- Created `/packages/gateway/` package — LandveX Master Gateway
- `package.json` with Express, CORS, Helmet, rate limiting, HTTP proxy, Stripe, JWT, PostgreSQL, Winston
- `tsconfig.json` — TypeScript strict, ES2022
- `src/index.ts` — Full gateway with proxies to Intelligence Lab (3002), Apollo CRM (3001), Ledger (3250), Incidents (3303)
- `simple-gateway.js` — Zero-dependency fallback using only Node.js built-in modules
- Gateway runs on port 3004 with CORS, rate limiting, health checks
- Health check includes service status for all backend services
- **Issue**: npm install fails due to cache permissions (`EACCES: permission denied, mkdir '/home/bernt/.npm/_cacache'`)
- **Workaround**: Using `simple-gateway.js` (no external dependencies) until npm issue resolved
### Gateway Status
- Port 3004: RUNNING
- Intelligence Lab (3002): proxied via `/api/v1/*` — WORKING
- Apollo CRM (3001): configured but service not running
- Ledger (3250): configured but service not running
- Incidents (3303): configured but service not running
- Health endpoint: `GET /health` returns service status for all registered services
### Next Steps for Gateway
1. Fix npm cache permissions to install TypeScript dependencies
2. Start Apollo CRM service (port 3001)
3. Verify Ledger service (port 3250)
4. Verify Incidents service (port 3303)
5. Test end-to-end proxying for all services
6. Implement Stripe webhook handler
7. Add JWT authentication middleware