How notsogaurab/three-tier-todo-app works
This repository implements a browser-based todo app backed by an Express API and a database. Users add, view, edit, and delete tasks in the React interface; the frontend API module sends requests to backend routes, whose controllers delegate operations through a service and model to Knex. The tree includes a database migration, but README content is empty, and the sampled sources do not establish the database’s runtime connection details or confirm the frontend/backend port configuration.
Main entry points: App.tsx Todo app · todoService.ts Todo service · TodoModel.ts Todo model · todoRoute.ts Todo routes
Components 14
Frontend
- Todo app
frontend/src/App.tsx - Todo item
frontend/src/components/Todo.tsx - Todo API client
frontend/src/api/todo.ts
Backend API
- Express server
backend/src/index.ts - Todo routes
backend/src/routes/todoRoute.ts - Todo controller
backend/src/controllers/TodoController.ts - Todo service
backend/src/services/todoService.ts - Error handler
backend/src/middlewares/errorHandler.ts - Todo domain
backend/src/domain/Todo.ts
Persistence
- Todo model
backend/src/models/TodoModel.ts - Knex connection
backend/src/db/knex.ts - Todo migration
backend/src/db/migrations/20240222091221_three_tier.ts - Database
database/createdb.sql
Other components
- User
Connections 15
- User → Todo app: uses
- Todo app → Todo item: renders
- Todo item → Todo app: dispatches edits
- Todo app → Todo API client: requests todos
- Todo API client → Todo routes: HTTP requests
- Express server → Todo routes: mounts routes
- Todo routes → Todo controller: dispatches
- Todo controller → Todo service: calls
- Todo service → Todo model: calls
- Todo model → Knex connection: queries
- Knex connection → Database: reads and writes
- Todo migration → Database: defines schema
- Express server → Error handler: registers middleware
- Todo service → Todo domain: uses type
- Todo model → Todo domain: uses type