TaskFlow is a task management app for organizing everyday work in one place. The project has a React and Vite frontend, an Express REST API, and MongoDB storage managed with Mongoose.
- View tasks from a dashboard, My Day, and Completed views.
- Create, edit, and delete tasks.
- Set a task's description, status, priority, category, due date, and due time.
- Persist tasks in MongoDB across app restarts.
- Validate task fields in the API and database model.
- Frontend: React, Vite, Tailwind CSS
- Backend: Node.js, Express
- Database: MongoDB with Mongoose
- Node.js 20.19 or newer
- npm
- A MongoDB instance, local or hosted
Check your installed Node.js and npm versions:
node --version
npm --versionCreate server/.env and set MONGODB_URI to your MongoDB connection string.
For a local MongoDB server, the value can look like this:
MONGODB_URI=mongodb://127.0.0.1:27017/taskflowMake sure the MongoDB server is running before starting the API. For a hosted
MongoDB database, use its connection string instead and keep the credentials
private. The .env file is ignored by Git; do not commit it.
Install and start the API in a PowerShell terminal:
Set-Location .\server
npm install
$env:PORT = "8080"
npm startThe API connects to the database before listening. The Vite development proxy
is configured to forward /api requests to port 8080, so keep this port
unless you also update client/vite.config.js.
In a second PowerShell terminal, configure and start the frontend:
Set-Location .\client
npm installCreate client/.env with:
VITE_API_URL=/apiThen start Vite:
npm run devOpen the local URL printed by Vite, usually http://localhost:5173. The
frontend sends requests through the Vite proxy to the API.
The API base path is /api/tasks:
| Method | Path | Description |
|---|---|---|
GET |
/api/tasks |
List tasks |
GET |
/api/tasks/:id |
Get one task |
POST |
/api/tasks |
Create a task |
PATCH |
/api/tasks/:id |
Update a task |
DELETE |
/api/tasks/:id |
Delete a task |
GET / returns a simple API health message. Successful task responses use a
JSON object containing success and data.
titleis required and limited to 120 characters.descriptionis optional and limited to 1,000 characters.statusispending,active, orcompleted(default:pending).priorityislow,medium, orhigh(default:medium).categoryisGeneral,Work,Personal,Study,Health,Shopping, orOther(default:General).dueDateis optional;dueTimeuses 24-hourHH:mmformat.
Run the backend model tests:
Set-Location .\server
npm testCheck and build the frontend:
Set-Location .\client
npm run lint
npm run buildclient/
src/
components/ # Reusable UI components
pages/ # Task and dashboard views
services/ # Frontend API client
server/
config/ # MongoDB connection
controllers/ # Task request handlers
models/ # Mongoose schemas
routes/ # Express API routes
tests/ # Backend tests
This project currently provides task management without user accounts or authentication. Do not expose the API or database publicly without adding appropriate authentication, authorization, and deployment security.