How hritvibhole/student--task-manager works
Purpose and topology
Student Task Manager is a full-stack task-tracking system for placement-prep work. It is a two-app repository: a React SPA consumes an Express REST API, which persists tasks in SQLite through Prisma. Root deployment definitions target Render for the API and Vercel for the SPA: render.yaml, frontend/vercel.json.
Backend bootstrap and HTTP boundary
The API process starts in backend/src/server.ts; application wiring, middleware order, CORS, routes, docs, and error handling live in backend/src/app.ts. Route aggregation is centralized in backend/src/routes/index.ts, with versioned API routing under the configured /api/v1 prefix and a health endpoint. Swagger/OpenAPI documentation is configured by backend/src/docs/swagger.ts.
Task domain pipeline
Tasks are the implemented core domain. Routes map REST operations—including list/search/filter/sort/pagination, statistics, CRUD, and completion toggling—to controllers, then services:
• backend/src/features/tasks/task.routes.ts
• backend/src/features/tasks/task.controller.ts
• backend/src/features/tasks/task.service.ts
Requests are validated before controllers using Zod schemas in backend/src/features/tasks/task.validation.ts and backend/src/middleware/validateRequest.ts. Services own Prisma queries and aggregate statistics, isolating persistence from HTTP concerns.
API cross-cutting behavior
The request pipeline includes request logging, validation, controller execution, and centralized failure normalization. asyncHandler forwards async failures; ApiError represents expected HTTP failures; errorHandler converts application, Zod, and Prisma errors into the API’s consistent JSON envelope.
• backend/src/middleware/errorHandler.ts
• backend/src/utils/ApiResponse.ts
• backend/src/utils/ApiError.ts
Authentication files exist as an intended extension point, but README states authentication is not currently implemented: backend/src/middleware/authenticate.ts, backend/src/features/auth/auth.routes.ts.
Persistence and infrastructure
Prisma defines a single Task model with string-backed status, priority, and category; indexed fields support common filters and due-date queries. SQLite is accessed with Prisma’s rust-free client engine and better-sqlite3 adapter. Schema evolution and seed data are repository-managed:
• backend/prisma/schema.prisma
• backend/prisma/migrations/20260721045907_init/migration.sql
• backend/prisma/seed.ts
Backend configuration validates environment values and creates shared logger/Prisma instances: backend/src/config/env.ts, backend/src/config/prisma.ts. Render SQLite storage is ephemeral unless a persistent disk is configured; production can migrate to PostgreSQL without application-layer redesign.
Frontend composition and navigation
The SPA enters through frontend/src/main.tsx, composes providers in frontend/src/App.tsx, and declares lazy client routes in frontend/src/routes/router.tsx. Pages provide dashboard, task list, and task create/edit workflows:
• frontend/src/pages/DashboardPage.tsx
• frontend/src/pages/TasksPage.tsx
• frontend/src/pages/TaskFormPage.tsx
Layout and task-specific components separate navigation/presentation from page orchestration: frontend/src/components/layout/DashboardLayout.tsx, frontend/src/components/tasks/TaskTable.tsx.
Client data flow and state boundaries
Axios is centralized in frontend/src/api/apiClient.ts, using the environment-selected API base URL. Feature API modules call backend endpoints; TanStack Query hooks manage server-state reads, cache keys, invalidation, and optimistic delete/completion updates:
• frontend/src/features/tasks/api/taskApi.ts
• frontend/src/features/tasks/hooks/useTasks.ts
• frontend/src/features/tasks/hooks/useTaskMutations.ts
Provider boundaries establish query cache, theme, and toasts: frontend/src/providers/QueryProvider.tsx, frontend/src/providers/ThemeProvider.tsx, frontend/src/providers/ToastProvider.tsx. Forms use client-side schemas mirroring backend task enum constraints in frontend/src/features/tasks/taskFormSchema.ts.
Main entry points: TasksPage.tsx Task pages · app.ts Express app · render.yaml Render + Vercel · main.tsx SPA entry
Components 21
React SPA
- SPA entry
frontend/src/main.tsx - App providers · Establishes query cache, theme, and toast boundaries.
frontend/src/App.tsx - Client router
frontend/src/routes/router.tsx - Task pages · Dashboard, list, and create/edit task workflows.
frontend/src/pages/TasksPage.tsx - Task UI · Layout and task table components.
frontend/src/components/tasks/TaskTable.tsx - Task query hooks · Owns cache keys, invalidation, and optimistic task mutations.
frontend/src/features/tasks/hooks/useTaskMutations.ts - Task API module
frontend/src/features/tasks/api/taskApi.ts - Axios client · Uses the environment-selected API base URL.
frontend/src/api/apiClient.ts - Task form schema · Mirrors backend task enum constraints.
frontend/src/features/tasks/taskFormSchema.ts
Express API
- API server
backend/src/server.ts - Express app · Wires middleware, CORS, versioned routes, docs, and errors.
backend/src/app.ts - Route aggregation · Mounts versioned routes and health endpoint.
backend/src/routes/index.ts - Task routes · Exposes task list, statistics, CRUD, and completion operations.
backend/src/features/tasks/task.routes.ts - Request validation · Validates task requests before controllers.
backend/src/middleware/validateRequest.ts - Task controller
backend/src/features/tasks/task.controller.ts - Task service · Owns queries and task statistics aggregation.
backend/src/features/tasks/task.service.ts - Error pipeline · Normalizes async, Zod, Prisma, and application errors into JSON responses.
backend/src/middleware/errorHandler.ts
Data & deployment
- Prisma client · Shared SQLite client using the better-sqlite3 adapter.
backend/src/config/prisma.ts - Task schema & migrations · Defines the Task model, indexes, migrations, and seed lifecycle.
backend/prisma/schema.prisma - SQLite database · Render storage is ephemeral without a persistent disk.
- Render + Vercel · API deploys to Render and SPA deploys to Vercel.
render.yaml
Connections 21
- SPA entry → App providers
- App providers → Client router: composes
- Client router → Task pages: loads
- Task pages → Task UI: renders
- Task pages → Task form schema: validates forms
- Task pages → Task query hooks: uses
- Task query hooks → Task API module: fetches and mutates
- Task API module → Axios client: uses
- Axios client → Express app: REST /api/v1
- API server → Express app: starts
- Express app → Route aggregation: mounts
- Route aggregation → Task routes: routes
- Task routes → Request validation: validates
- Request validation → Task controller: passes valid requests
- Task controller → Task service: delegates
- Task service → Prisma client: queries
- Prisma client → SQLite database: persists tasks
- Task schema & migrations → SQLite database: defines and evolves
- Express app → Error pipeline: normalizes failures
- Render + Vercel → API server: deploys API
- Render + Vercel → SPA entry: deploys SPA