How prateekjaiswal16/taskflow works
Project Type and Purpose
• This is a full-stack task management application.
• Frontend: React (Vite) single-page app that handles UI for tasks and users.
• Backend: Node.js + Express REST API providing auth, task and user endpoints.
• Database: MongoDB for persisting Users and Tasks.
• File storage: Supabase (user note: MongoDB is used for primary data; files are stored in Supabase).
• CI/CD: GitHub Actions + Docker Compose for orchestration.
Key Architectural Components
a. Frontend (React/SP A)
• Components: Pages (Dashboard, Login, Register, TaskDetail), Layouts, UI primitives, Task & User components
• State management: Zustand stores (useAuthStore, useTaskStore, useUserStore)
• Services: authService, taskService, userService call backend REST endpoints via axios
b. Backend (Express API)
• Entry point: server.js
• Routes (authRoutes, taskRoutes, userRoutes) → Controllers → Models (Mongoose schemas)
• Middleware:
– authMiddleware: JWT verification
– errorMiddleware: centralized error handling
– uploadSupabase: handles file uploads to Supabase
• Utils: generateToken (JWT), supabaseClient (SDK)
• Config: db.js initializes MongoDB connection
c. Database
• MongoDB collections: users, tasks
d. External Services
• Supabase: object storage for file uploads
e. DevOps / Deployment
• Dockerfiles for frontend & backend
• compose.yml brings up API, Web, MongoDB, Supabase emulator (if any)
• GitHub Actions (cicd.yml) for build/test/deploy pipelines
Interactions and Data Flow
1. User interacts with React UI → triggers actions (e.g., login, fetch tasks)
2. Frontend Service calls REST API over HTTP(S) → Express routes
3. Express Controller validates/authenticates via JWT → interacts with Mongoose Models
4. Models read/write to MongoDB
5. For uploads, Express middleware streams file → Supabase storage via supabaseClient
6. Response sent back to frontend → UI updates via state store
Architectural Patterns and Principles
• MVC in backend (Routes → Controllers → Models)
• JWT stateless authentication
• Separation of concerns: UI components vs. business logic vs. data access
• Containerization (Docker) + Infrastructure as code (compose.yml)
• Single-page app with client routing (ProtectedRoute, AdminRoute)