How effuone/nodemap works
Purpose and Topology
Nodemap is a two-application SaaS for generating and managing visual, node-based learning roadmaps. The React browser client lives in apps/web; the NestJS API lives in apps/api. Development infrastructure provisions PostgreSQL and Redis through docker-compose.dev.yml.
Application Entry Points
The API bootstraps NestJS from apps/api/src/main.ts, assembling feature modules in apps/api/src/app.module.ts. The web client boots React in apps/web/src/main.tsx and defines application navigation in apps/web/src/routes.tsx. Primary user surfaces are authentication, home, and roadmap views under apps/web/src/pages/AuthPage.tsx, apps/web/src/pages/HomePage.tsx, and apps/web/src/pages/RoadmapPage.tsx.
API Boundary and Cross-Cutting Runtime
NestJS exposes HTTP endpoints with centralized environment validation, request logging, and exception handling in apps/api/src/core/env-validation-schema.ts, apps/api/src/core/logger.middleware.ts, and apps/api/src/core/http.exception-filter.ts. Health checking is a distinct operational boundary through apps/api/src/health/health.controller.ts and database health support in apps/api/src/database/database.health.ts.
Identity and Access Control
Authentication is a dedicated API subsystem: controllers/services in apps/api/src/auth/auth.controller.ts and apps/api/src/auth/auth.service.ts, backed by JWT and refresh-token Passport strategies in apps/api/src/auth/strategies/jwt.strategy.ts and apps/api/src/auth/strategies/jwt-refresh-token.strategy.ts. Protected API access is enforced by guards. The browser holds auth state and applies request interception through apps/web/src/lib/auth/auth.context.tsx, apps/web/src/lib/auth/auth.interceptor.ts, and apps/web/src/lib/auth/auth.layout.tsx.
Persistence and User Domain
PostgreSQL is the durable system of record, modeled with Prisma in apps/api/prisma/schema.prisma and accessed through apps/api/src/database/database.service.ts. The database module owns connection and database exception boundaries (apps/api/src/database/database.module.ts, apps/api/src/database/database.exception-filter.ts). User-specific operations are grouped in apps/api/src/user/user.module.ts and apps/api/src/user/user.service.ts.
Roadmap Generation and Realtime Delivery
The roadmap subsystem is the core domain boundary: it accepts create/update DTOs, persists/manipulates roadmap entities, and delivers graph updates through a gateway. Its principal files are apps/api/src/roadmap/roadmap.module.ts, apps/api/src/roadmap/roadmap.service.ts, and apps/api/src/roadmap/roadmap.gateway.ts. The README identifies OpenAI content generation and Redis/BullMQ background jobs as generation infrastructure; Redis is externally provisioned, while the visible roadmap structure seed/template is apps/api/src/roadmap/struct.json.
Browser Graph Experience
The client calls backend/AI-facing functions in apps/web/src/api/getBrowserData.tsx and apps/web/src/api/getGPTDescription.tsx, then transforms generated content through apps/web/src/shared/utils/transformGPTObject/index.ts. React Flow-oriented graph rendering is decomposed into main/child node and edge components: apps/web/src/components/mainNode.tsx, apps/web/src/components/childNode.tsx, and apps/web/src/components/mainPathEdge.tsx. Generation interaction is centered on apps/web/src/components/generate-dialog.tsx.
Deployment Shape
The API has container and process definitions in apps/api/Dockerfile and apps/api/Procfile. The Vite frontend has Vercel deployment configuration at apps/web/vercel.json. Required external runtime services are PostgreSQL, Redis, and OpenAI; environment contracts are represented by apps/api/.env.example and apps/web/.env.example.
Components 18
React browser client
- React bootstrap
apps/web/src/main.tsx - Application routes · Navigates authentication, home, and roadmap surfaces.
apps/web/src/routes.tsx - Browser auth boundary · Maintains auth state and attaches protected requests.
apps/web/src/lib/auth/auth.context.tsx - Generation interaction · Requests browser and GPT-derived roadmap content.
apps/web/src/components/generate-dialog.tsx - Graph data transform
apps/web/src/shared/utils/transformGPTObject/index.ts - Roadmap graph renderer · Renders main nodes, child nodes, and path edges.
apps/web/src/components/mainNode.tsx
NestJS API
- Nest bootstrap
apps/api/src/main.ts - API module assembly
apps/api/src/app.module.ts - HTTP runtime boundary · Centralizes environment validation, request logging, and exception handling.
apps/api/src/core/env-validation-schema.ts - Authentication and guards · Issues and validates access and refresh-token identities.
apps/api/src/auth/auth.service.ts - User domain
apps/api/src/user/user.service.ts - Roadmap domain · Creates and updates roadmap entities.
apps/api/src/roadmap/roadmap.service.ts - Graph update gateway · Delivers realtime roadmap graph updates.
apps/api/src/roadmap/roadmap.gateway.ts - Database access boundary · Owns database connections and persistence access.
apps/api/src/database/database.service.ts - Health endpoint · Reports API and database health.
apps/api/src/health/health.controller.ts
External runtime services
- PostgreSQL · Prisma data model is defined in the API schema.
apps/api/prisma/schema.prisma - Redis and BullMQ · Supports roadmap generation jobs.
- OpenAI
Connections 19
- React bootstrap → Application routes: starts
- Application routes → Browser auth boundary: protects routes
- Application routes → Generation interaction: roadmap UI
- Generation interaction → Browser auth boundary: authenticated requests
- Generation interaction → Roadmap domain: generation requests
- Generation interaction → Graph data transform: generated content
- Graph data transform → Roadmap graph renderer: graph-ready data
- Nest bootstrap → API module assembly: boots
- API module assembly → HTTP runtime boundary: configures
- HTTP runtime boundary → Authentication and guards: routes protected access
- Authentication and guards → User domain: identity operations
- User domain → Database access boundary: persists users
- Roadmap domain → Database access boundary: persists roadmaps
- Database access boundary → PostgreSQL: reads and writes
- Roadmap domain → Redis and BullMQ: queues generation jobs
- Roadmap domain → OpenAI: generates content
- Roadmap domain → Graph update gateway: publishes graph updates
- Graph update gateway → Roadmap graph renderer: realtime updates
- Health endpoint → Database access boundary: checks database