Skip to content

NonPopularPoint/KAIROS---Task-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KAIROS β€” Task Management

A task management web application built as part of the Hairdrama Tech Internship assessment. Users authenticate via Google OAuth, create and assign tasks, track work through a review workflow, and receive email notifications for task lifecycle events.

Live URL: https://kairos-task-management-platfrom-pf9.vercel.app API: https://kuldipsinhjadeja478.pythonanywhere.com/api


Tech Stack

Layer Technology
Frontend Next.js 16 + TypeScript
Backend Flask (Python)
Database Supabase PostgreSQL
Auth Google OAuth 2.0
Email Gmail SMTP
Styling Tailwind CSS
Animations Framer Motion
Charts Recharts
Drag & Drop @dnd-kit
Icons Lucide React

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Vercel (Next.js)       β”‚
β”‚  - SSR pages            β”‚
β”‚  - Client components     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚ HTTP / JSON
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Render (Flask)          β”‚
β”‚  - REST API endpoints    β”‚
β”‚  - JWT auth middleware   β”‚
β”‚  - Email service         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚ SQL queries
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Supabase (PostgreSQL)   β”‚
β”‚  - users, tasks          β”‚
β”‚  - labels, comments      β”‚
β”‚  - task_history          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Design Decisions

  • Single bounded context β€” all domain logic (auth, tasks, notifications) lives in one Flask application
  • JWT with database lookup β€” tokens contain only user ID; fresh user data fetched on each request for data consistency
  • Client-side filtering β€” tasks fetched with visibility filter, then filtered/sorted/paginated in Python (appropriate for this scale)
  • Async email β€” SMTP sends run in a daemon thread to avoid blocking API responses
  • No hard delete β€” tasks are business records; cancellation is the only closure path

Features

Authentication

  • Google OAuth sign-in
  • JWT-based session management
  • Protected routes (redirect to login)

Tasks

  • Create tasks with title, description, priority, labels, visibility
  • Assign, reassign (with reason), unassign
  • Claim public unassigned tasks
  • Change visibility (private / public)

Workflow

  • 5 statuses: Pending β†’ In Progress β†’ Ready For Review β†’ Completed
  • Cancelled / Reopen
  • Completion notes, review feedback, cancellation reasons stored as comments
  • Completed tasks are terminal β€” cannot be modified

Dashboard

  • 9 metric cards with animated count-up
  • Weekly task completion bar chart
  • Recent activity timeline

Task List

  • Filters: status, priority, labels, visibility, assignee relationship
  • Search (title + description, debounced)
  • Sort: newest, oldest, priority
  • Pagination with page numbers
  • List / Board view toggle

Kanban Board

  • 4 columns with drag-and-drop
  • Valid transition enforcement
  • Completion note / review feedback modals on drop

Task Detail

  • Inline title editing
  • Inline description editing with character counter
  • Label editing
  • Comments (CRUD) with creator moderation
  • Task history timeline
  • Workflow action buttons (role + status dependent)

Email Notifications

  • Task assigned / reassigned / unassigned
  • Task claimed
  • Ready For Review / Changes Requested
  • Task approved / cancelled / reopened
  • Self-suppression rules (no email when creator == assignee)

Labels

  • 7 seeded labels: Frontend, Backend, Bug, Feature, Research, Documentation, Urgent

Setup

Prerequisites

  • Python 3.12+
  • Node.js 20+
  • Supabase account
  • Google Cloud Console project

1. Clone

git clone https://github.com/your-repo/kairos-task-management.git
cd kairos-task-management

2. Backend Setup

cd backend
python -m venv venv
venv\Scripts\activate    # Windows
# source venv/bin/activate  # macOS/Linux
pip install -r requirements.txt

Create backend/.env:

FLASK_ENV=development
FLASK_DEBUG=1
SECRET_KEY=your-secret-key

SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-key

GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

JWT_SECRET=your-jwt-secret
JWT_EXPIRATION_HOURS=24

SMTP_EMAIL=your-gmail
SMTP_PASSWORD=your-gmail-app-password
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587

FRONTEND_ORIGIN=http://localhost:3000

3. Database Setup

  • Go to Supabase Dashboard β†’ SQL Editor
  • Run backend/migrations/001_initial_schema.sql
  • This creates all 6 tables and seeds 7 labels

4. Frontend Setup

cd frontend
npm install

Create frontend/.env.local:

NEXT_PUBLIC_API_URL=http://localhost:5000/api
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your-google-client-id

5. Run

# Terminal 1 β€” Backend
cd backend
venv\Scripts\activate
python app.py

# Terminal 2 β€” Frontend
cd frontend
npm run dev

Open http://localhost:3000


Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app.py                 # Flask application factory
β”‚   β”œβ”€β”€ config.py              # Environment configuration
β”‚   β”œβ”€β”€ requirements.txt       # Python dependencies
β”‚   β”œβ”€β”€ migrations/
β”‚   β”‚   └── 001_initial_schema.sql  # Database schema + seed data
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.py            # Google OAuth, JWT endpoints
β”‚   β”‚   β”œβ”€β”€ users.py           # User list / detail
β”‚   β”‚   β”œβ”€β”€ tasks.py           # Task CRUD, status, assignment
β”‚   β”‚   β”œβ”€β”€ labels.py          # Labels list
β”‚   β”‚   β”œβ”€β”€ comments.py        # Comment CRUD
β”‚   β”‚   └── dashboard.py       # Metrics, weekly chart, activity
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ auth_service.py    # Google token verification, user upsert
β”‚   β”‚   β”œβ”€β”€ task_service.py    # Task CRUD, visibility, history
β”‚   β”‚   β”œβ”€β”€ status_service.py  # Status transition validation
β”‚   β”‚   β”œβ”€β”€ assignment_service.py  # Assign, reassign, claim
β”‚   β”‚   β”œβ”€β”€ comment_service.py # Comment CRUD with permissions
β”‚   β”‚   β”œβ”€β”€ labels_service.py  # Label validation
β”‚   β”‚   β”œβ”€β”€ dashboard_service.py   # Metrics, chart data
β”‚   β”‚   β”œβ”€β”€ email_service.py   # SMTP sending, HTML templates
β”‚   β”‚   └── notifications.py   # Notification triggers + suppression
β”‚   └── utils/
β”‚       β”œβ”€β”€ jwt_utils.py       # JWT generation / verification
β”‚       β”œβ”€β”€ decorators.py      # @require_auth decorator
β”‚       └── supabase_client.py # Supabase singleton
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx           # Redirect to login / dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ layout.tsx         # Root layout with providers
β”‚   β”‚   β”‚   β”œβ”€β”€ login/page.tsx     # Google OAuth login page
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/page.tsx # Dashboard with metrics + chart
β”‚   β”‚   β”‚   β”œβ”€β”€ tasks/page.tsx     # Task list with filters
β”‚   β”‚   β”‚   β”œβ”€β”€ tasks/[id]/page.tsx    # Task detail
β”‚   β”‚   β”‚   β”œβ”€β”€ tasks/[id]/edit/page.tsx  # Edit task
β”‚   β”‚   β”‚   β”œβ”€β”€ tasks/new/page.tsx   # Create task
β”‚   β”‚   β”‚   β”œβ”€β”€ board/page.tsx      # Kanban board
β”‚   β”‚   β”‚   └── profile/page.tsx    # User profile
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/               # 24 shared components (Button, Modal, etc.)
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.tsx        # App layout shell
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx       # Navigation sidebar
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx        # Top bar with avatar
β”‚   β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.tsx # Auth guard
β”‚   β”‚   β”‚   β”œβ”€β”€ TaskFilters.tsx   # Filter bar
β”‚   β”‚   β”‚   β”œβ”€β”€ TaskCard.tsx      # List view card
β”‚   β”‚   β”‚   └── RecentActivity.tsx # Activity timeline
β”‚   β”‚   β”œβ”€β”€ hooks/               # 10 data hooks
β”‚   β”‚   β”œβ”€β”€ contexts/
β”‚   β”‚   β”‚   └── AuthContext.tsx   # Auth state management
β”‚   β”‚   └── lib/
β”‚   β”‚       └── api.ts           # Fetch wrapper with JWT
β”‚   └── package.json
β”‚
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
└── README.md

API Endpoints

Auth

Method Endpoint Description
POST /api/auth/google Google OAuth login
GET /api/auth/me Current user
POST /api/auth/logout Logout

Tasks

Method Endpoint Description
GET /api/tasks List tasks (filtered, sorted, paginated)
POST /api/tasks Create task
GET /api/tasks/:id Get task
PUT /api/tasks/:id Update task
PATCH /api/tasks/:id/status Change status
PATCH /api/tasks/:id/assign Assign
PATCH /api/tasks/:id/reassign Reassign
PATCH /api/tasks/:id/unassign Unassign
PATCH /api/tasks/:id/claim Claim
PATCH /api/tasks/:id/visibility Change visibility

Comments, Labels, Dashboard, History

Method Endpoint Description
GET/POST /api/tasks/:id/comments List / create comments
PUT/DELETE /api/comments/:id Edit / delete comment
GET /api/labels List all labels
GET /api/dashboard/metrics Metric counts
GET /api/dashboard/recent-activity Activity feed
GET /api/dashboard/weekly-chart Weekly chart data
GET /api/tasks/:id/history Task history

Database Schema

6 tables: users, tasks, labels, task_labels, comments, task_history

Full schema in backend/migrations/001_initial_schema.sql


Deployment

Backend β€” Render

  1. Create Web Service from GitHub repo
  2. Root: backend
  3. Build: pip install -r requirements.txt
  4. Start: gunicorn app:app
  5. Add env vars from .env
  6. Use Starter plan ($7/mo) to prevent cold start

Frontend β€” Vercel

  1. Create Project from GitHub repo
  2. Root: frontend
  3. Env: NEXT_PUBLIC_API_URL, NEXT_PUBLIC_GOOGLE_CLIENT_ID
  4. Deploy

Google OAuth

  • Add frontend URL to Authorized JavaScript origins in Google Cloud Console

Walkthrough Video

A loom video explaining the code and features will be recorded after deployment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages