How clement127001/todo_assignment works
ZipTrrip is a full-stack TODO application. Users register or log in, then use the React client to create, list, inspect, update, and delete their own TODOs. The backend validates requests, authenticates protected operations with JWTs, enforces user ownership, and persists users and TODOs with Mongoose. The graph includes the principal client and API stages plus validation and error handling. Client-to-API details are documented at product level; unsampled client wiring is not inferred.
Main entry points: app.ts Express app · App.tsx Client application · auth.ts Auth routes · todo.ts TODO routes
Components 24
React client
- Client application
client/src/App.tsx - Auth screens
client/src/components/auth - TODO screens
client/src/components/todo - TODO data hooks
client/src/hooks - Login state
client/src/contexts/LoginProvider.tsx
API runtime
- Server startup
server/src/server.ts - Express app
server/src/app.ts - Auth routes
server/src/router/auth.ts - TODO routes
server/src/router/todo.ts - Health route
server/src/router/health.ts
Auth and TODO domain
- JWT middleware
server/src/middlewares/authentication.ts - Auth controller
server/src/controller/auth.ts - TODO controller
server/src/controller/todo.ts - Ownership checks
server/src/utils/todo.ts - User model
server/src/models/user.ts - TODO model
server/src/models/todo.ts
Validation and persistence
- User validation
server/src/modules/user/user.schema.ts - TODO validation
server/src/modules/todo/todo.schema.ts - Request validator
server/src/utils/validate.ts - Error handling
server/src/middlewares/error-handler.ts - Database config
server/src/config/db.ts - Environment config
server/src/config/env.ts
Other components
- User
- MongoDB
Connections 28
- User → Client application: uses
- Client application → Auth screens: offers authentication
- Client application → TODO screens: offers TODO management
- TODO screens → TODO data hooks: loads and changes TODOs
- Auth screens → Login state: stores authentication
- Client application → Express app: sends API requests
- Express app → Auth routes: routes auth requests
server/src/app.ts - Express app → TODO routes: routes protected requests
server/src/app.ts - Express app → Health route: routes health checks
server/src/app.ts - Express app → Error handling: handles errors
server/src/app.ts - Express app → JWT middleware: protects TODO routes
server/src/app.ts - Auth routes → Request validator: validates requests
server/src/router/auth.ts - Auth routes → User validation: uses schema
server/src/router/auth.ts - Auth routes → Auth controller: dispatches auth
server/src/router/auth.ts - TODO routes → Request validator: validates requests
server/src/router/todo.ts - TODO routes → TODO validation: uses schema
server/src/router/todo.ts - TODO routes → TODO controller: dispatches TODO operations
server/src/router/todo.ts - JWT middleware → TODO controller: attaches user context
- Auth controller → User model: reads and creates users
server/src/controller/auth.ts - TODO controller → TODO model: performs TODO operations
server/src/controller/todo.ts - TODO controller → Ownership checks: checks ownership
server/src/controller/todo.ts - Ownership checks → TODO model: checks user-owned TODO
server/src/utils/todo.ts - Server startup → Express app: starts
server/src/server.ts - Server startup → Database config: connects database
server/src/server.ts - Database config → Environment config: reads settings
server/src/config/db.ts - User model → MongoDB: persists users
- TODO model → MongoDB: persists TODOs
- Error handling → User: returns error response