This frontend is now fully integrated with the backend API. Follow these steps to get started:
npm installcp .env.local.example .env.localEdit .env.local:
NEXT_PUBLIC_API_URL=http://localhost:5000/api/v1
NEXT_PUBLIC_WS_URL=http://localhost:5000-
Start Backend (in separate terminal)
# Navigate to your backend directory cd ../backend # Start backend server npm start # Backend should be running on http://localhost:5000
-
Start Frontend
npm run dev
-
Access Application
- Open browser: http://localhost:3000
- You'll see the sign-in page
- Register a new account or login
If backend is not running, the frontend will show connection errors, which is expected. You can still view the UI but won't be able to interact with data.
-
Register an Account
- Go to http://localhost:3000/sign-up
- Fill in your details:
- First Name
- Last Name
- Password (min 8 chars, uppercase, lowercase, number)
- Click "Create account"
-
Login
- After registration, you'll be auto-logged in
- Or go to http://localhost:3000/sign-in
- Enter email and password
- Click "Sign in"
-
Create Your First Project
- You'll land on the projects page
- Click "New Project"
- Fill in project details
- Click "Create Project"
-
Create Tasks
- Click on your project
- Click "Add Task" or the + button in a column
- Fill in task details
- Click "Create Task"
- Open two browser windows side-by-side
- Login to the same account in both
- Open the same project in both windows
- Create/move/delete a task in one window
- Watch it update instantly in the other window
# Development
npm run dev # Start dev server on port 3000
# Production
npm run build # Build for production
npm start # Start production server
# Linting
npm run lint # Check for code issues/app # Next.js pages
/sign-in # Login page
/sign-up # Registration page
/dashboard # Dashboard
/projects # Projects list & detail
/settings # Settings page
/components # React components
/ui # UI components library
protected-route.tsx # Route protection
/contexts # React contexts
auth-context.tsx # Authentication state
projects-context.tsx # Projects state
tasks-context.tsx # Tasks state
/services # API services
auth.service.ts # Auth operations
projects.service.ts # Project operations
tasks.service.ts # Task operations
websocket.service.ts # WebSocket
/lib # Core utilities
api-client.ts # HTTP client
api-config.ts # API configuration
types.ts # TypeScript types
utils.ts # Utilities
1. User visits any protected page
↓
2. ProtectedRoute checks authentication
↓
3. If not authenticated → redirect to /sign-in
↓
4. User logs in → token stored
↓
5. Redirect to requested page
↓
6. WebSocket connects automatically
↓
7. Real-time updates enabled
POST /auth/register- Register new userPOST /auth/login- Login userPOST /auth/logout- Logout userPOST /auth/refresh-token- Refresh access tokenGET /auth/me- Get current user
GET /projects- List all projectsPOST /projects- Create projectGET /projects/:id- Get project detailsPATCH /projects/:id- Update projectDELETE /projects/:id- Delete project
GET /tasks/projects/:projectId/tasks- List project tasksPOST /tasks/projects/:projectId/tasks- Create taskPATCH /tasks/:taskId- Update taskDELETE /tasks/:taskId- Delete taskPATCH /tasks/:taskId/move- Move taskPATCH /tasks/:taskId/complete- Complete task
task:created- New task createdtask:updated- Task updatedtask:deleted- Task deletedtask:moved- Task moved
- Cause: Backend not running or wrong API URL
- Fix: Check backend is running on port 5000, verify
.env.local
- Cause: Token expired or invalid
- Fix: Logout and login again, or clear localStorage
- Cause: Wrong WebSocket URL or backend WS not running
- Fix: Verify
NEXT_PUBLIC_WS_URLin.env.local
- Cause: Authentication check failing
- Fix: Check browser console for errors, verify token in localStorage
- Cause: WebSocket disconnected
- Fix: Check browser console, verify WS connection status
- User registration and login
- JWT authentication with auto-refresh
- Protected routes
- Project CRUD
- Task CRUD
- Real-time task updates
- Drag & drop (UI ready)
- Task assignment
- Task priorities
- Task tags
- Due dates
- Loading states
- Error handling
- Project members
- Notifications
- Task comments
- 2FA authentication
- Password reset
- User profile editing
All data types match the backend contract:
ProjectStatus:IN_PROGRESS,COMPLETED,ON_HOLD,PLANNINGTaskPriority:HIGH,MEDIUM,LOWUserStatus:ONLINE,AWAY,OFFLINE
- IDs are UUIDs (e.g.,
550e8400-e29b-41d4-a716-446655440000) - Dates are ISO 8601 strings (e.g.,
2024-01-15T10:30:00.000Z) - Colors are hex codes (e.g.,
#3B82F6)
- Token Refresh: Happens automatically every 15 minutes
- WebSocket Reconnect: Automatic with exponential backoff
- Optimistic Updates: Changes appear instantly, confirmed by server
- Error Messages: User-friendly messages for all errors
- Loading States: All operations show loading indicators
BACKEND_INTEGRATION.md- Complete integration guideINTEGRATION_SUMMARY.md- What was implemented- Backend Contract - Full API specification
- Type definitions in
lib/types.ts
The frontend is fully integrated and ready to use. Start the backend, run the frontend, and you're good to go!
- Check browser console for errors
- Check backend logs
- Review
BACKEND_INTEGRATION.mdfor details - Verify environment variables
- Clear browser cache and localStorage
Happy Coding! 🚀