A full-stack Team Task Manager application with a Flask REST API backend and React frontend featuring a Kanban-style board for managing tasks.
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- Lucide React for icons
- React Router for navigation and protected routes
- Python Flask REST API
- Flask-SQLAlchemy for database ORM
- Flask-CORS for cross-origin requests
- PyJWT for JWT authentication
- PostgreSQL database
team-task-manager/
├── frontend/ # React frontend (Vite)
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API service layer
│ │ ├── types/ # TypeScript types
│ │ └── App.tsx # Main app component
│ ├── package.json
│ └── vite.config.ts
├── backend/ # Flask backend
│ ├── app/
│ │ ├── __init__.py # Application factory
│ │ ├── models.py # SQLAlchemy models
│ │ └── routes.py # API endpoints
│ ├── requirements.txt
│ ├── schema.sql # Database schema
│ └── run.py # Application entry point
└── README.md
- Kanban-style dashboard with 3 columns (To Do, In Progress, Done)
- Drag and drop tasks between columns
- Create, read, update, and delete tasks
- Task priorities (low, medium, high)
- Responsive design for mobile and desktop
- RESTful API architecture with JWT authentication
- Login/logout functionality with persisted sessions
- Protected routes that require authentication
- Pre-seeded demo users for testing
- Python 3.8 or higher
- Node.js 16 or higher
- npm or yarn
- PostgreSQL 12 or higher
First, ensure PostgreSQL is installed and running on your system.
Create a new PostgreSQL database:
psql -U postgres
CREATE DATABASE taskmanager;
\qInitialize the database schema:
psql -U postgres -d taskmanager -f backend/schema.sqlThis will create the tasks table and insert sample data.
Navigate to the backend directory:
cd backendCreate a Python virtual environment:
python3 -m venv venvActivate the virtual environment:
On macOS/Linux:
source venv/bin/activateOn Windows:
venv\Scripts\activateInstall Python dependencies:
pip install -r requirements.txtCreate a .env file in the backend directory:
cp .env.example .envEdit the .env file and update the database connection string:
DATABASE_URL=postgresql://your_username:your_password@localhost/taskmanager
PORT=5000
FLASK_ENV=development
Run the Flask application:
python run.pyThe backend API will be available at http://localhost:5000
Open a new terminal window and navigate to the project root directory.
Install frontend dependencies:
npm installCreate a .env file in the root directory:
cp .env.example .envThe default configuration should work:
VITE_API_URL=http://localhost:5000/api
Run the development server:
npm run devThe frontend will be available at http://localhost:5173
- POST
/api/auth/login- Login with username and password- Request:
{ "username": "admin", "password": "admin123" } - Response:
{ "token": "jwt_token", "user": { "id": 1, "username": "admin" } }
- Request:
All task endpoints require an Authorization: Bearer <token> header.
- GET
/api/tasks- Get all tasks - POST
/api/tasks- Create a new task - PUT
/api/tasks/:id- Update a task - DELETE
/api/tasks/:id- Delete a task
{
"id": 1,
"title": "Task title",
"description": "Task description",
"priority": "low | medium | high",
"status": "todo | in_progress | done",
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}Build the frontend for production:
npm run buildThis creates optimized static files in the dist/ directory that can be:
- Served by Flask using
flask.send_from_directory() - Deployed to any static hosting service (Netlify, Vercel, etc.)
- Served by any web server (Nginx, Apache, etc.)
Preview the production build:
npm run previewFor production deployment:
- Set
FLASK_ENV=productionin your environment - Use a production WSGI server like Gunicorn:
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 'app:create_app()'- Navigate to the landing page at
http://localhost:5173 - Click "Get Started" to go to the login page
- Use demo credentials:
- Admin account: username:
admin, password:admin123 - User account: username:
user, password:user123
- Admin account: username:
- Upon successful login, you'll be redirected to the dashboard
- The auth token is stored in
localStorageand persists across page refreshes - Click "Logout" to clear the session
- Tokens are valid for the session and stored in localStorage
- Tokens are automatically included in all API requests via the Authorization header
- Invalid or expired tokens will redirect you to the login page
- Start PostgreSQL database
- Run backend:
cd backend && source venv/bin/activate && python run.py - Run frontend:
npm run dev - Access the application at
http://localhost:5173 - Use demo credentials to login and manage tasks
To reset the database and reload sample data:
psql -U postgres -d taskmanager -f backend/schema.sqlpg_dump -U postgres taskmanager > backup.sqlpsql -U postgres taskmanager < backup.sqlIssue: ModuleNotFoundError: No module named 'flask'
- Solution: Make sure you've activated the virtual environment and installed requirements
Issue: sqlalchemy.exc.OperationalError: could not connect to server
- Solution: Ensure PostgreSQL is running and connection details in
.envare correct
Issue: CORS errors in browser
- Solution: Verify Flask-CORS is installed and the backend is running
Issue: Failed to fetch tasks
- Solution: Check that the backend is running on port 5000 and VITE_API_URL is correct
Issue: Redirect to login when accessing dashboard
- Solution: Make sure you've logged in with valid credentials. Check that the token is stored in localStorage.
Issue: Unauthorized error on API calls
- Solution: The token may have expired. Try logging out and logging back in.
Issue: Build errors
- Solution: Delete
node_modulesandpackage-lock.json, then runnpm installagain
Issue: Invalid username or password
- Solution: Use the correct demo credentials. The default accounts are
admin/admin123anduser/user123
Issue: Forgot password?
- Solution: This demo application doesn't have a password reset feature. Contact an administrator to reset your password or edit the database directly.
MIT License - feel free to use this project for learning and development purposes.
This is a learning project demonstrating full-stack development with Flask and React. Feel free to fork and modify for your own use.