A modern, responsive task management application built with React, TypeScript, and Redux Toolkit. This frontend-only application simulates a complete backend using Mock Service Worker (MSW) for API endpoints and includes user authentication, task CRUD operations, and a clean, mobile-friendly interface with dark mode support.
- User Authentication: Login page with mocked JWT authentication
- Task Management: Complete CRUD operations for tasks
- Dashboard: Clean interface displaying all tasks with filtering and search
- Task Status: Track tasks as Todo, In Progress, or Completed
- Real-time Updates: Immediate UI updates with optimistic loading states
- Responsive Design: Mobile-first approach with Tailwind CSS
- Dark Mode: Toggle between light and dark themes
- Search & Filter: Find tasks quickly with search and status filters
- Loading States: Professional loading indicators and animations
- Error Handling: Comprehensive error states and user feedback
- Empty States: Helpful messages when no tasks are available
- TypeScript: Full type safety throughout the application
- Redux Toolkit: Efficient state management with RTK Query patterns
- Mock Service Worker: Realistic API simulation with localStorage persistence
- Protected Routes: Authentication guards for dashboard access
- Form Validation: Client-side validation for all forms
- Framework: React 18 with TypeScript
- Build Tool: Vite for fast development and optimized builds
- State Management: Redux Toolkit with React Redux
- Routing: React Router DOM v6
- Styling: Tailwind CSS v3 with custom design system
- HTTP Client: Axios for API requests
- API Mocking: Mock Service Worker (MSW) v2
- Icons: Lucide React
- Development: ESLint, TypeScript compiler
src/
โโโ components/ # Reusable UI components
โ โโโ Header.tsx # App header with navigation
โ โโโ ProtectedRoute.tsx # Route protection wrapper
โ โโโ TaskCard.tsx # Individual task display
โ โโโ TaskForm.tsx # Create/edit task modal
โ โโโ TaskList.tsx # Task list with filters
โโโ pages/ # Page-level components
โ โโโ DashboardPage.tsx # Main dashboard
โ โโโ LoginPage.tsx # Authentication page
โโโ store/ # Redux store configuration
โ โโโ authSlice.ts # Authentication state
โ โโโ tasksSlice.ts # Tasks state management
โ โโโ index.ts # Store configuration
โโโ types/ # TypeScript type definitions
โ โโโ auth.ts # Authentication types
โ โโโ task.ts # Task-related types
โโโ mocks/ # MSW mock API
โ โโโ handlers.ts # API endpoint handlers
โ โโโ browser.ts # MSW browser setup
โโโ hooks/ # Custom React hooks
โ โโโ redux.ts # Typed Redux hooks
โโโ utils/ # Utility functions
- Node.js 18+ and npm
- Modern web browser with ES2022 support
-
Clone the repository
git clone <repository-url> cd task-management-app
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173
Use these credentials to log in:
- Username:
test
- Password:
test123
npm run dev
- Start development server with hot reloadingnpm run build
- Build for productionnpm run preview
- Preview production build locallynpm run lint
- Run ESLint for code quality
The application simulates the following REST API endpoints:
Method | Endpoint | Description |
---|---|---|
POST | /api/login |
User authentication |
POST | /api/logout |
User logout |
GET | /api/tasks |
Fetch all tasks |
POST | /api/tasks |
Create new task |
PUT | /api/tasks/:id |
Update existing task |
DELETE | /api/tasks/:id |
Delete task |
Login Request:
{
"username": "test",
"password": "test123"
}
Task Object:
{
"id": "1",
"title": "Complete project",
"description": "Finish the task management application",
"status": "in-progress",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z",
"userId": "1"
}
The application uses Mock Service Worker (MSW) to intercept network requests and provide realistic API responses:
- Service Worker Setup: MSW installs a service worker that intercepts HTTP requests
- Request Handlers: Custom handlers in
src/mocks/handlers.ts
define API behavior - Data Persistence: MockTasks are stored in localStorage for persistence across reloads
- Realistic Delays: Simulated network latency for authentic user experience
- Error Simulation: Proper HTTP status codes and error responses
- No Backend Required: Complete frontend development without API dependencies
- Realistic Testing: Network requests behave like real API calls
- Development Speed: Instant setup without server configuration
- Production Ready: Easy to replace with real API endpoints
The application uses a custom design system built on Tailwind CSS:
- Primary: Blue color palette for main actions
- Grays: Neutral colors for text and backgrounds
- Semantic: Red for errors, green for success, blue for info
- Buttons: Primary, secondary, and danger variants
- Forms: Consistent input styling with focus states
- Cards: Elevated containers with subtle shadows
- Typography: Hierarchical text sizing and weights
- Automatic system preference detection
- Manual toggle with persistent user preference
- Comprehensive dark color scheme
- Smooth transitions between themes
The application is built with a mobile-first approach:
- Mobile (320px+): Optimized touch interface
- Tablet (768px+): Enhanced layout with more content
- Desktop (1024px+): Full-featured interface with sidebars
- Flexible grid layouts that adapt to screen size
- Touch-friendly button sizes and spacing
- Collapsible navigation on mobile devices
- Readable typography at all screen sizes
The application includes comprehensive error handling and loading states:
- Network Errors: Graceful fallbacks for failed requests
- Validation: Client-side form validation
- Loading States: Visual feedback during async operations
- Empty States: Helpful messages when no data is available
Potential improvements and additional features:
- Task Categories: Organize tasks by project or category
- Due Dates: Add deadline tracking with notifications
- Task Assignments: Multi-user task assignment
- File Attachments: Upload and attach files to tasks
- Activity Timeline: Track task history and changes
- Bulk Actions: Select and modify multiple tasks
- Keyboard Shortcuts: Power user productivity features
- Offline Support: Service worker for offline functionality
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- React Team for the excellent React framework
- Redux Team for Redux Toolkit
- Tailwind Labs for Tailwind CSS
- MSW Team for Mock Service Worker
- Lucide for the beautiful icon set
Built with โค๏ธ using modern web technologies