How taborda18/iris_to_do works
1. System purpose and entry points
A full-stack todo application: an Angular web client consumes a Node/Express REST API for user authentication and per-user task management. Backend startup flows through api/src/server.ts and api/src/app.ts; frontend browser and SSR entry points are web-app/src/main.ts, web-app/src/main.server.ts, and web-app/src/server.ts.
2. Backend composition and HTTP boundary
The API is organized in Clean Architecture-style feature modules. Express application setup mounts routes and cross-cutting middleware in api/src/app.ts. Auth and task HTTP adapters—controllers, route definitions, request schemas, and presenters—translate REST input/output at:
• api/src/modules/auth/interfaces/routes/auth.routes.ts
• api/src/modules/tasks/interfaces/routes/task.routes.ts
• api/src/interfaces/http/middleware/authenticate.ts
Async exception forwarding and centralized HTTP error mapping form the API failure boundary: api/src/interfaces/http/async-handler.ts, api/src/interfaces/http/middleware/error-handler.ts, and api/src/shared/errors.ts.
3. Authentication flow
Auth routes validate credentials, invoke application use cases, and use infrastructure adapters for persistence, password hashing, and signed tokens. The core separation is:
• domain contracts/types: api/src/modules/auth/domain/auth.ts
• application orchestration: api/src/modules/auth/application/auth.ts
• adapters: api/src/modules/auth/infrastructure/prisma-user-repository.ts, api/src/modules/auth/infrastructure/bcrypt-password-hasher.ts, api/src/modules/auth/infrastructure/jwt-token-service.ts
Authenticated requests cross JWT middleware before protected task operations. Cookie-specific response handling resides in api/src/modules/auth/interfaces/cookie.ts.
4. Task lifecycle
Task operations follow the same domain → application → persistence path. Controllers accept validated requests, call task use cases, then present API responses:
• api/src/modules/tasks/domain/task.ts
• api/src/modules/tasks/application/tasks.ts
• api/src/modules/tasks/infrastructure/prisma-task-repository.ts
• api/src/modules/tasks/interfaces/controllers/task.controller.ts
The authentication boundary associates task access with the calling user; task DTO shaping is isolated in api/src/modules/tasks/interfaces/task-presenter.ts.
5. Persistence and runtime infrastructure
The backend is TypeScript on Node.js/Express. Prisma is the database integration point, with data model/schema in api/prisma/schema.prisma and shared client lifecycle in api/src/infrastructure/prisma.ts. Runtime environment configuration is centralized in api/src/config/env.ts. The concrete database engine is not inferable from the supplied tree alone.
6. Angular client architecture
The Angular application uses standalone-style application configuration and routes:
• web-app/src/app/app.config.ts
• web-app/src/app/app.routes.ts
• web-app/src/app/app.ts
Login and registration pages feed auth services; the protected task dashboard composes task creation, filtering, listing, and metrics UI:
• web-app/src/app/pages/login/login.ts
• web-app/src/app/pages/register/register.ts
• web-app/src/app/pages/task-dashboard/task-dashboard.ts
7. Client/API control flow and SSR
Frontend API services isolate HTTP protocol from client state/domain models. Auth services manage session state, route protection, and request interception at web-app/src/app/services/auth/auth-api.service.ts, web-app/src/app/services/auth/auth.guard.ts, and web-app/src/app/services/auth/auth.interceptor.ts. Task API, mapping, and client state layers are web-app/src/app/services/task/task-api.service.ts, web-app/src/app/services/task/task.mapper.ts, and web-app/src/app/services/task/task.service.ts.
The client is configured for server rendering through web-app/src/app/app.config.server.ts and web-app/src/app/app.routes.server.ts; production requires both the Angular SSR server runtime and the separate Express/Prisma API service.
Main entry points: app.ts Express app · tasks.ts Task use cases · task.routes.ts Task REST adapters · auth.ts Auth use cases
Components 19
Express API
- API startup
api/src/server.ts - Express app
api/src/app.ts - Failure boundary · Forwards async failures and maps shared errors to HTTP responses.
api/src/interfaces/http/middleware/error-handler.ts - JWT authentication
api/src/interfaces/http/middleware/authenticate.ts - Prisma data layer · Shared client lifecycle and database model definition.
api/src/infrastructure/prisma.ts
Auth module
- Auth REST adapters
api/src/modules/auth/interfaces/routes/auth.routes.ts - Auth use cases
api/src/modules/auth/application/auth.ts - Auth contracts
api/src/modules/auth/domain/auth.ts - Auth infrastructure
api/src/modules/auth/infrastructure/prisma-user-repository.ts
Task module
- Task REST adapters
api/src/modules/tasks/interfaces/routes/task.routes.ts - Task use cases
api/src/modules/tasks/application/tasks.ts - Task contracts
api/src/modules/tasks/domain/task.ts - Task persistence adapter
api/src/modules/tasks/infrastructure/prisma-task-repository.ts - Task response presenter
api/src/modules/tasks/interfaces/task-presenter.ts
Angular web app
- Browser and SSR entrypoints · Browser bootstrap and server-rendering runtime.
web-app/src/main.ts - App routing and config
web-app/src/app/app.config.ts - Client auth boundary · Manages session state, route protection, and authenticated requests.
web-app/src/app/services/auth/auth-api.service.ts - Client task layers
web-app/src/app/services/task/task.service.ts - Login, register, dashboard · Dashboard composes task creation, filtering, listing, and metrics.
web-app/src/app/pages/task-dashboard/task-dashboard.ts
Connections 21
- API startup → Express app: starts
- Express app → Auth REST adapters: mounts
- Express app → JWT authentication: applies
- Express app → Task REST adapters: mounts
- Express app → Failure boundary: handles failures
- Auth REST adapters → Auth use cases: invokes
- Auth use cases → Auth contracts: uses contracts
- Auth use cases → Auth infrastructure: uses
- Auth infrastructure → Prisma data layer: persists users
- JWT authentication → Task REST adapters: authorizes access
- Task REST adapters → Task use cases: invokes
- Task use cases → Task contracts: uses contracts
- Task use cases → Task persistence adapter: uses
- Task persistence adapter → Prisma data layer: persists tasks
- Task use cases → Task response presenter: shapes responses
- Browser and SSR entrypoints → App routing and config: bootstraps
- App routing and config → Login, register, dashboard: routes to
- Login, register, dashboard → Client auth boundary: sign-in and session
- Login, register, dashboard → Client task layers: task actions
- Client auth boundary → Auth REST adapters: REST requests
- Client task layers → Task REST adapters: authenticated REST