How malikbasiq/todo-fullstack-nest-react works
Project type and purpose
• This is a monorepo full-stack Todo application.
• Frontend: React + Vite SPA, client-side routing, Axios HTTP client.
• Backend: NestJS REST API with JWT authentication, role-based access (NORMAL_USER_ROLE, ADMIN), PostgreSQL persistence.
File structure
• Top level:
• react-app-vite/ → React SPA
• todo-backend/ → NestJS API
• Frontend details:
• src/pages/ → page components (Login, SignUp, ActiveTodos, CompletedTodos, UsersPage)
• src/components/ → reusable UI (NavBar, ActiveTodoList, CompletedTodoList)
• src/axios/AxiosSetup.ts → Axios instance + interceptors (attach JWT)
• src/api/ApiConstants.ts → endpoint definitions
• src/utils/LoginInfo.ts → JWT token management
• src/Routing.tsx & ProtectedRoute.tsx → route guards
• Backend details:
• src/app.controller.ts → HTTP endpoints (CRUD todos, users)
• src/app.service.ts → business logic layer
• src/app.module.ts → NestJS module definitions (imports, providers, controllers)
• src/main.ts → bootstrap Nest application
• Configuration: nest-cli.json, tsconfig, .env (PORT, DATABASE_URL, JWT_SECRET)
• Testing: src/app.controller.spec.ts, test/app.e2e-spec.ts
Key architecture insights from README
• Monolithic backend with layered MVC (Controllers → Services → Database).
• JWT-based stateless authentication.
• Role-based authorization: NORMAL_USER_ROLE vs ADMIN.
• Frontend-driven UI with async calls to the NestJS API.
Elements
• Clear labels: “React SPA”, “Axios HTTP Client”, “NestJS Controller”, “NestJS Service”, “PostgreSQL”
• User → React SPA
• React SPA → Axios→ NestJS Controller
• Controller → Service → Database
• Auth flows: Login request → AuthController → JWT issuance → localStorage
• Blue rectangles for frontend components
• Green rectangles for backend modules