Skip to content

AugustiyaSharma/Team-Task-Manager

Repository files navigation

πŸ“‹ Team Task Manager - Full-Stack Web Application

A modern, professional task management system built with React, Node.js/Express, and PostgreSQL. Users can create projects, manage teams, assign tasks, and track progress with an intuitive dashboard.

✨ Key Features

  • Authentication & Authorization: Secure signup/login with session-based authentication
  • Project Management: Create, edit, and delete projects with full team collaboration
  • Task Management: Create tasks with title, description, due dates, and assignees
  • Task Status Tracking: Tasks can be marked as To Do, In Progress, or Done
  • Team Collaboration: Add team members to projects and manage roles
  • Dashboard: Real-time overview of tasks, statistics, and progress tracking
  • Role-Based Access: Admin (project owner) and Member (team participant) roles
  • Modern UI: Beautiful, responsive design built with Tailwind CSS and React

πŸ› οΈ Tech Stack

Backend

  • Runtime: Node.js with ES Modules
  • Framework: Express.js
  • Database: PostgreSQL
  • Authentication: Express Sessions + bcryptjs
  • Validation: Joi
  • Security: Helmet, CORS
  • Environment: dotenv

Frontend

  • Library: React 18 with TypeScript
  • Routing: React Router v6
  • Styling: Tailwind CSS
  • HTTP Client: Axios
  • Notifications: React Hot Toast
  • Build: Create React App

πŸ“‹ Database Schema

Tables

-- users: User accounts with roles
- id (PRIMARY KEY)
- email (UNIQUE)
- password_hash
- first_name, last_name
- role (admin/member)
- created_at, updated_at

-- projects: Projects managed by teams
- id (PRIMARY KEY)
- name, description
- owner_id (FOREIGN KEY β†’ users.id)
- created_at, updated_at

-- tasks: Tasks within projects
- id (PRIMARY KEY)
- project_id (FOREIGN KEY β†’ projects.id)
- title, description
- status (todo/in_progress/done)
- assignee_id (FOREIGN KEY β†’ users.id, nullable)
- due_date
- created_at, updated_at

-- team_members: Join table for project teams
- id (PRIMARY KEY)
- project_id (FOREIGN KEY β†’ projects.id)
- user_id (FOREIGN KEY β†’ users.id)
- role (admin/member)
- joined_at

πŸš€ Getting Started

Prerequisites

  • Node.js (v16+)
  • PostgreSQL (v12+)
  • npm or yarn

Local Development Setup

1. Database Setup

# Create PostgreSQL database
createdb task_manager

# Run schema file
psql task_manager < backend/db/schema.sql

2. Backend Setup

cd backend

# Install dependencies
npm install

# Create .env file
cp .env.example .env

# Edit .env with your database credentials
# DATABASE_URL=postgresql://user:password@localhost:5432/task_manager

# Start development server
npm run dev
# Server runs on http://localhost:5000

3. Frontend Setup

cd frontend

# Install dependencies
npm install

# Start development server
npm start
# App opens at http://localhost:3000

πŸ”Œ API Endpoints

Authentication

  • POST /api/auth/register - Create new account
  • POST /api/auth/login - Login with credentials
  • POST /api/auth/logout - Logout and destroy session
  • GET /api/auth/me - Get current user (requires auth)

Projects

  • GET /api/projects - List all user's projects (requires auth)
  • POST /api/projects - Create new project (requires auth)
  • GET /api/projects/:id - Get project details with team members (requires auth)
  • PUT /api/projects/:id - Update project (owner only)
  • DELETE /api/projects/:id - Delete project (owner only)

Tasks

  • POST /api/projects/:projectId/tasks - Create task (requires auth)
  • GET /api/projects/:projectId/tasks - List tasks in project (requires auth)
  • PUT /api/projects/task/:id - Update task status/details (requires auth)
  • DELETE /api/projects/task/:id - Delete task (requires auth)

Team Management

  • POST /api/projects/:projectId/members - Add team member (owner only)
  • GET /api/projects/:projectId/members - List team members (requires auth)
  • PUT /api/projects/:projectId/members/:userId - Update member role (owner only)
  • DELETE /api/projects/:projectId/members/:userId - Remove team member (owner only)

Dashboard

  • GET /api/dashboard - Get dashboard stats and recent tasks (requires auth)

πŸ“Š API Request/Response Examples

Register

POST /api/auth/register
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "securepassword123",
  "first_name": "John",
  "last_name": "Doe"
}

Response (201):
{
  "message": "User registered successfully",
  "user": {
    "id": 1,
    "email": "user@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "role": "member"
  }
}

Create Project

POST /api/projects
Content-Type: application/json
Cookie: connect.sid=...

{
  "name": "Website Redesign",
  "description": "Redesign company website"
}

Response (201):
{
  "message": "Project created",
  "project": {
    "id": 1,
    "name": "Website Redesign",
    "description": "Redesign company website",
    "owner_id": 1,
    "created_at": "2026-05-06T10:00:00Z",
    "updated_at": "2026-05-06T10:00:00Z"
  }
}

Create Task

POST /api/projects/1/tasks
Content-Type: application/json
Cookie: connect.sid=...

{
  "title": "Design homepage mockup",
  "description": "Create initial mockups for homepage",
  "due_date": "2026-05-20",
  "assignee_id": 2
}

Response (201):
{
  "message": "Task created",
  "task": {
    "id": 1,
    "project_id": 1,
    "title": "Design homepage mockup",
    "status": "todo",
    "assignee_id": 2,
    "due_date": "2026-05-20",
    "created_at": "2026-05-06T10:05:00Z"
  }
}

πŸ§ͺ Testing the Application

Manual API Testing (using curl)

# Register
curl -X POST http://localhost:5000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","password":"password123"}'

# Login
curl -X POST http://localhost:5000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","password":"password123"}' \
  -c cookies.txt

# Get current user
curl -X GET http://localhost:5000/api/auth/me \
  -b cookies.txt

# Get projects
curl -X GET http://localhost:5000/api/projects \
  -b cookies.txt

Application Flow

  1. Register β†’ Create new account with email/password
  2. Login β†’ Session cookie automatically set
  3. Create Project β†’ Start a new team project
  4. Add Team Members β†’ Invite users by email
  5. Create Tasks β†’ Add tasks to project
  6. Assign Tasks β†’ Assign to team members
  7. Update Status β†’ Track progress (To Do β†’ In Progress β†’ Done)
  8. View Dashboard β†’ Monitor all tasks and statistics

🌍 Deployment to Railway

Prerequisites

  • GitHub account with repo pushed
  • Railway.app account (free tier available)

Step 1: Deploy Backend

# 1. Push code to GitHub
git add .
git commit -m "Initial commit"
git push origin main

# 2. Create Railway project at railway.app
# 3. Connect GitHub repository
# 4. Add PostgreSQL plugin
# 5. Set environment variables:
#    - DATABASE_URL (auto-populated by PostgreSQL plugin)
#    - SESSION_SECRET (generate secure key)
#    - NODE_ENV=production
#    - FRONTEND_URL=https://yourapp.up.railway.app

# 6. Deploy automatically

Step 2: Deploy Frontend

# 1. Create .env.production with backend URL
REACT_APP_API_URL=https://api.taskmanager.up.railway.app/api

# 2. Build React app
npm run build

# 3. Deploy to Railway
# Add New Service β†’ Static Site
# Deploy the /build folder

Step 3: Verify Deployment

  1. Visit frontend URL: https://taskmanager.up.railway.app
  2. Register a new account
  3. Create a project
  4. Add tasks
  5. Test all features end-to-end

πŸ“ Environment Variables

Backend (.env)

PORT=5000
NODE_ENV=development|production
DATABASE_URL=postgresql://user:password@host:port/dbname
SESSION_SECRET=your-random-secret-key-here
FRONTEND_URL=http://localhost:3000 (dev) or https://app.up.railway.app (prod)

Frontend (.env)

REACT_APP_API_URL=http://localhost:5000/api (dev) or https://api.app.up.railway.app/api (prod)

πŸ”’ Security Considerations

  • βœ… Passwords hashed with bcryptjs (salt rounds: 10)
  • βœ… Session-based auth with secure, HTTP-only cookies
  • βœ… SQL injection protection via parameterized queries (pg library)
  • βœ… CORS configured for specific frontend domain
  • βœ… Helmet middleware for security headers
  • βœ… Role-based access control (RBAC) for sensitive operations
  • βœ… Input validation with Joi schemas

🚧 Future Enhancements

  • Real-time updates with WebSockets (Socket.io)
  • Task priorities and labels
  • Comments and activity logs on tasks
  • Email notifications for task assignments
  • Task filtering and advanced search
  • Recurring tasks and templates
  • Time tracking for tasks
  • Mobile app (React Native)
  • Dark mode toggle
  • File attachments for tasks
  • Calendar view for due dates
  • Reporting and analytics dashboard

πŸ“‚ Project Structure

Assignment/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── database.js          # PostgreSQL connection pool
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”œβ”€β”€ auth.js              # Auth & error handling
β”‚   β”‚   └── validation.js        # Input validation with Joi
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.js              # Auth endpoints
β”‚   β”‚   β”œβ”€β”€ projects.js          # Project CRUD
β”‚   β”‚   β”œβ”€β”€ tasks.js             # Task CRUD
β”‚   β”‚   β”œβ”€β”€ team.js              # Team management
β”‚   β”‚   └── dashboard.js         # Dashboard stats
β”‚   β”œβ”€β”€ db/
β”‚   β”‚   └── schema.sql           # Database schema
β”‚   β”œβ”€β”€ app.js                   # Express app setup
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ .env                     # Environment variables
β”‚   └── .env.example
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ client.ts        # Axios instance
β”‚   β”‚   β”‚   └── index.ts         # API service functions
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RegisterPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProjectsPage.tsx
β”‚   β”‚   β”‚   └── ProjectDetailPage.tsx
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   └── Navbar.tsx
β”‚   β”‚   β”œβ”€β”€ App.tsx              # Main app with routing
β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   β”œβ”€β”€ index.css            # Tailwind styles
β”‚   β”‚   └── App.css
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ .env                     # Dev environment
β”‚   β”œβ”€β”€ .env.production          # Prod environment
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   β”œβ”€β”€ postcss.config.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ .gitignore
└── README.md                    # This file

πŸ’‘ Usage Example

Creating and Managing a Project

  1. Register: Sign up with email/password
  2. Create Project: Click "New Project" β†’ Enter name and description
  3. Add Team Member: Go to project β†’ Team tab β†’ Add member by email
  4. Create Task: Click "New Task" β†’ Fill details β†’ Assign to team member
  5. Update Status: Click status dropdown on task β†’ Select new status
  6. View Dashboard: Dashboard shows all tasks, counts, and overdue items

🀝 Contributing

This is an assignment project. For modifications, ensure:

  • Code follows the existing structure
  • All endpoints have proper error handling
  • Frontend components are reusable and well-styled
  • Database queries use parameterized statements
  • Environment variables are properly configured

πŸ“ž Support

For issues or questions:

  1. Check the API documentation above
  2. Review error messages in console
  3. Ensure PostgreSQL is running
  4. Verify environment variables are set
  5. Check backend server is running on port 5000
  6. Check frontend is accessing correct API URL

πŸ“„ License

This project is created for educational purposes.


Last Updated: May 6, 2026
Version: 1.0.0
Status: Ready for Production Deployment

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors