- Create
studyhub-frontendwith Vite (or CRA) -
npm install - Clean starter files
- Install dependencies
-
react-router-dom -
axios(or plan to usefetch)
-
- Create folder structure
-
/src/clients(api.tsHTTP client) -
/src/components(Navbar.tsx) -
/src/context(AuthProvider.tsx) -
/src/pages(AuthPage.tsx,HomePage.tsx,ProjectsPage.tsx,ProjectDetailsPage.tsx) -
/src/types(index.tsfor shared types)
-
- Ensure entry files
-
/src/App.tsx -
/src/main.tsx
-
- Add
.envfor frontend-
VITE_API_BASE_URL="https://<your-backend-on-render>/api"
-
- Create
AuthProviderin/src/context/AuthProvider.tsx- Store
userandtokenin state - Load
userandtokenfromlocalStorageon startup - Provide
login,logout, and optionalregisterhelpers via context
- Store
- Wrap app in
AuthProviderinmain.tsx - Define auth-related types in
/src/types/index.ts(e.g.,User,AuthResponse) - Set up routing in
App.tsx(react-router-dom)-
/→HomePage -
/auth(or/login) →AuthPage -
/modules→ProjectsPage -
/modules/:moduleId→ProjectDetailsPage
-
- Implement protected route logic *** revisit
- Create a
RequireAuth/PrivateRoutewrapper component (in/src/components) - Redirect to
/authif no token for protected pages (/modules,/modules/:moduleId)
- Create a
- Auth UI (
AuthPage.tsx)- Login form (email/password)
- Call
POST /api/auth/loginviaapi.ts - Save token + user to context and
localStorage - Redirect to
/moduleson success
- Call
- Register form (name/email/password) or tab
- Call
POST /api/auth/register - Either auto-login or redirect to login view
- Call
- Login form (email/password)
- Modules dashboard page (
ProjectsPage.tsxat route/modules)- On mount, fetch
GET /api/moduleswithAuthorizationheader usingapi.ts - Display list of modules owned by the logged-in user
- Link each module to
/modules/:moduleId(ProjectDetailsPage.tsx)
- On mount, fetch
- Add new module form (component in
/src/components, used inProjectsPage.tsx)- Call
POST /api/modules - Refresh module list on success
- Call
- Optional module actions
- Edit module name/description (
PUT /api/modules/:id) - Delete module (
DELETE /api/modules/:id) and remove from UI
- Edit module name/description (
- Module detail page (
ProjectDetailsPage.tsxat route/modules/:moduleId)- Fetch module info (
GET /api/modules/:id) - Fetch tasks for module (
GET /api/modules/:moduleId/tasks)
- Fetch module info (
- Display tasks list
- Show title, description, status for each task
- Status dropdown or buttons
- On change, call
PUT /api/tasks/:taskIdto update status
- On change, call
- Add new task form (component in
/src/ components, used inProjectDetailsPage.tsx) ** revisit- Call
POST /api/modules/:moduleId/tasks - Refresh tasks list on success
- Call
- Delete task
- Button to call
DELETE /api/tasks/:taskId - Remove task from UI without full page reload
- Button to call
- Add loading states for API calls (modules, tasks, auth)
- Add error handling and messages for failed API calls
- Basic layout with header/nav
- Use
Navbar.tsxto show app name + nav links (e.g., Modules, Logout)
- Use
- Responsive design for mobile/tablet
- Ensure pages use layout components and CSS in
index.css
- Ensure pages use layout components and CSS in
- Clean up unused components, assets, and code
- Deploy backend to Render (Web Service)
- Environment variables set (MONGO_URI, JWT_SECRET, PORT)
- Deploy frontend (Static Site – Render or Netlify)
-
VITE_API_BASE_URLpointing to deployed backend URL
-
- From live frontend:
- Register & login user
- Create a module
- Add tasks to a module
- Update task status
- Delete tasks/modules
- Final
README.mdat root or in each repo- Project summary
- Tech stack
- Setup steps
- Deployed URLs