WELIFE Docs Swagger Admin Web

Repository · Mobile · Environment Audit — 2026-08-06

Field Value
WP WP-REPOSITORY-ARCH-ENV-AUDIT-01
Path D:\welife
Device / emulator NOT TESTED
Secrets printed NO

Repository

Item Value
Package manager npm
Workspace None (custom multi-app; root scripts --prefix)
Build orchestrator None
Main apps api · mobile · partner · driver · dashboard
Shared packages NOT PRESENT (packages/ missing)

Git status before (summary)


Tree / statistics

Outputs:

Scope Files .ts .tsx Tests .env* Media
Walk (excl. node_modules/dist/…) 1007 299 267 20 23 73

(Per-folder breakdown in tree report.)


Architecture verdict

Area Verdict Notes
Repository structure PARTIAL Clear apps; no workspaces/packages/shared
Mobile structure PASS (local) Feature folders · single API client · SecureStore · React Navigation
API structure PASS (local) Nest modules · Prisma in services · /api/v1 · Socket.IO
Shared packages PARTIAL Missing; client API logic triplicated
Documentation PASS Architecture docs + inventories added this WP

Mobile

Item Value
Framework Expo 54
Navigation React Navigation
State AuthContext (no Redux/RQ)
API client src/services/api.ts + src/config/env.ts
Storage SecureStore tokens · AsyncStorage flags
Features 36 domains · ~126 screens
Native config scheme welife · cloud.minhtien.welife
Device test NOT PERFORMED

API

Item Value
Framework NestJS 11
Modules 39
Database Prisma + Postgres/PostGIS
Redis OTP + token blacklist
Object storage MinIO/S3
Email SMTP / Mailpit
WebSocket /socket.io · ns /chat · /rides
Health /api/v1/health · index /api/v1
Config assertSecureBoot + env:check

Partner / Driver / Dashboard

Surface Kind Static tsc Notes
Partner Expo 57 thin PASS SDK drift vs mobile 54
Driver Expo 57 thin PASS SDK drift
Dashboard Vite React PASS Admin modules

Environment

Metric Count / status
Vars referenced in code 87 (ENV-INVENTORY.md)
Live PRESENT 61
Live MISSING 24 (mostly optional/unused-on-this-machine)
Live PLACEHOLDER 1 (Google)
Live EMPTY 1
CRITICAL*SECRET_EXPOSURE (EXPO_PUBLIC* + server secret pattern) 0
.env.example apps root · api · mobile · dashboard · partner · driver

Cross-app: Google FE/BE PLACEHOLDER → OWNER_REQUIRED. Validation: Google placeholder reject · JWT distinct · prod OTP_DEV ban.


Critical findings

  1. Google OAuth Client ID PLACEHOLDER — Sign-In e2e blocked (OWNER).
  2. No packages/shared — DTO/API client duplication FE surfaces (deferred WP).

High findings

  1. Expo SDK drift — mobile 54 vs partner/driver 57.
  2. mobile/src/services/api.ts size — maintainability; future split by domain.
  3. .env-backups/ on disk — ensure never committed (gitignored pattern present).

Medium findings

  1. Firebase native files present locally but not wired in app.json (OK until FCM WP).
  2. Nested mobile/.git historically warned (structure audit) — still OWNER decision.
  3. api/.agents local AI clutter — non-blocking.

Low findings

  1. Root only orchestration — acceptable; document as non-workspace.
  2. Few automated FE unit tests vs API.

Files created / changed (this WP)

Created

Changed


Bugs fixed

  1. Root cause: Public env reads scattered in api.ts without typed hub. Fix: config/env.ts + wire API base/WS/debug. Evidence: mobile tsc exit 0.

Tests (re-run after changes)

Check Result
npm run env:check PASS
API tsc PASS
Mobile tsc PASS
Dashboard tsc PASS
Partner tsc PASS
Driver tsc PASS
Unit (api-root + google util) 9/9 PASS
API smoke health/root/chat PASS
Lint full-repo NO SCRIPT at root
Device NOT TESTED

Secrets

Secret printed: NO
Secret invented: NO
Secret committed: NO (examples only tracked)
Rotation required: NO (unless OWNER previously committed secrets outside this audit)

Remaining OWNER requirements

Recommended work packages

  1. WP-SHARED-CONTRACTS-01 — scaffold packages/shared types + zod (no big FE rewrite day-1)
  2. WP-EXPO-SDK-ALIGN-01 — partner/driver ↔ mobile SDK alignment plan
  3. WP-MOBILE-API-SPLIT-01 — split services/api.ts by domain
  4. WP-AUTH-GOOGLE-E2E-01 — after OWNER Client ID

Final verdict

REPOSITORY STRUCTURE: PARTIAL
MOBILE ARCHITECTURE: PASS
API ARCHITECTURE: PASS
ENVIRONMENT COVERAGE: PARTIAL (Google OWNER + optional vars missing)
LOCAL DEVELOPMENT READINESS: PASS
PRODUCTION READINESS: PARTIAL
DEVICE / EMULATOR: NOT TESTED
APPLICATION REGRESSION: NO