A full-stack task management application built with .NET 8 and React + TypeScript.
- ✅ Display list of tasks
- ✅ Add new tasks with description
- ✅ Mark tasks as completed/uncompleted
- ✅ Delete tasks
- ✅ RESTful API with .NET 8
- ✅ In-memory data storage
- ✅ React + TypeScript frontend
- ✅ Axios for API integration
- ✅ React Hooks for state management
- ✅ Task filtering (All / Active / Completed)
- ✅ Modern, responsive design with gradient background
- ✅ LocalStorage support for offline mode
- ✅ Automatic fallback to offline mode if backend is unavailable
- ✅ Clean and intuitive user interface
- .NET 8 Core
- ASP.NET Core Web API
- In-memory data storage
- Swagger for API documentation
- CORS enabled for frontend integration
- React 18
- TypeScript
- Axios for HTTP requests
- CSS3 with custom styling
- LocalStorage for data persistence
TaskManager/
├── Backend/
│ └── TaskManagerAPI/
│ ├── Program.cs # Main API code with endpoints
│ └── TaskManagerAPI.csproj
└── frontend/
├── src/
│ ├── App.tsx # Main React component
│ ├── App.css # Styles
│ └── index.tsx
└── package.json
- .NET 8 SDK
- Node.js (v18 or higher)
-
Navigate to backend folder:
cd TaskManager/Backend/TaskManagerAPI -
Run the backend:
dotnet run
The API will start on
http://localhost:5089 -
Access Swagger documentation at:
http://localhost:5089/swagger
-
Open a new terminal and navigate to frontend folder:
cd TaskManager/frontend -
Install dependencies (first time only):
npm install
-
Update API URL if needed:
- Open
src/App.tsx - Update
API_URLconstant to match your backend port
- Open
-
Run the frontend:
npm start
The app will open at
http://localhost:3000
GET /api/tasks- Get all tasksGET /api/tasks/{id}- Get a specific taskPOST /api/tasks- Create a new task{ "description": "Task description" }PUT /api/tasks/{id}- Update a task{ "description": "Updated description", "isCompleted": true }DELETE /api/tasks/{id}- Delete a task
- Add a task: Type in the input field and click "Add Task"
- Mark as complete: Click the checkbox next to a task
- Delete a task: Click the "Delete" button
- Filter tasks: Use "All", "Active", or "Completed" buttons
- Offline mode: Tasks are automatically saved to browser's localStorage
- Beautiful purple gradient background
- Clean white card interface
- Hover effects on buttons and tasks
- Mobile-friendly layout
- Real-time updates
- Optimistic UI updates
- Error handling with user-friendly messages
- Automatic offline mode detection
- Online mode: Data stored in backend API (in-memory)
- Offline mode: Data stored in browser localStorage
- Automatic mode switching based on backend availability
- Backend uses in-memory storage, so data resets when server restarts
- Frontend automatically switches to localStorage if backend is unavailable
- All tasks are stored locally in the browser when in offline mode