Skip to content
devashish588Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

⚑ Taskerzz β€” Enterprise Task Management Platform

A full-stack, production-ready task management platform built with a 3-tier role hierarchy (Super Admin β†’ Admin β†’ Tasker). Features real-time analytics, role-scoped data isolation, and a modern glassmorphism UI.

Node.js React PostgreSQL Prisma Railway


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   SUPER ADMIN                       β”‚
β”‚          (1 per system β€” seeded in DB)               β”‚
β”‚     Sees ALL data Β· Creates/Manages Admins          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      ADMIN #1        β”‚        ADMIN #2              β”‚
β”‚   (max 5 taskers)    β”‚     (max 5 taskers)          β”‚
β”‚  Sees only their     β”‚   Sees only their            β”‚
β”‚  team's data         β”‚   team's data                β”‚
β”œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ T1β”‚ T2β”‚ T3β”‚ T4β”‚ T5   β”‚ T1β”‚ T2β”‚ T3β”‚ T4β”‚ T5           β”‚
β”‚   Taskers see only   β”‚   Taskers see only           β”‚
β”‚   their own tasks    β”‚   their own tasks            β”‚
β””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Key Features

Role-Based Access Control

  • Super Admin β€” Global dashboard, create/deactivate admins, view all analytics across every admin and tasker
  • Admin β€” Manage up to 5 taskers, create projects/tasks, review submissions, scoped analytics
  • Tasker β€” View assigned tasks, update status, submit for review, add comments

Task Workflow

ASSIGNED β†’ IN_PROGRESS β†’ IN_REVIEW β†’ COMPLETED βœ…
                              ↓
                          FLAGGED 🚩 β†’ (revision) β†’ IN_REVIEW
  • Quality scores and time scores on review
  • Status history audit trail
  • Overdue task tracking
  • Comment threads on tasks

Analytics & Dashboards

  • Completion trends (30-day line charts)
  • Status distribution (pie charts)
  • Per-project progress bars
  • Per-tasker performance comparison
  • Review metrics (approval rate, most flagged)
  • Productivity tracking

Security

  • JWT access + refresh token rotation
  • HTTP-only cookie authentication
  • bcrypt password hashing (12 rounds)
  • Role-based middleware guards (superAdminOnly, adminOrAbove, scopeGuard)
  • Email normalization on all auth flows
  • No self-registration β€” invite-only system

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18, Vite, TailwindCSS, Zustand, React Hook Form, Recharts
Backend Node.js, Express.js, Prisma ORM
Database PostgreSQL (Railway)
Auth JWT (access + refresh), bcryptjs, HTTP-only cookies
Deployment Railway (auto-deploy from GitHub)

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20.x
  • PostgreSQL database
  • npm

1. Clone & Install

git clone https://github.com/devashish588/Taskerzzz.git
cd Taskerzzz
npm run install:all

2. Environment Variables

Create backend/.env:

DATABASE_URL="postgresql://user:password@localhost:5432/taskerzz"
JWT_SECRET="your-secret-key-min-32-chars"
JWT_REFRESH_SECRET="another-secret-key-min-32-chars"
FRONTEND_URL="http://localhost:5173"
PORT=5000
NODE_ENV=development

3. Setup Database & Seed

cd backend
npx prisma generate
npx prisma db push
node prisma/seed.js

4. Run Development Server

# From root directory
npm run dev

This starts both backend (:5000) and frontend (:5173) concurrently.


πŸ”‘ Demo Credentials

Role Email Password
Super Admin superadmin@taskflow.com SuperAdmin@123
Admin 1 admin@taskerzz.com admin123
Admin 2 priya.admin@taskerzz.com admin123
Tasker alice@taskerzz.com tasker123

All 10 taskers use password tasker123. Emails: alice, bob, charlie, diana, ethan, fiona, george, hannah, ivan, julia @taskerzz.com


πŸ“ Project Structure

Taskerzz/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma          # Database schema with Role enum
β”‚   β”‚   └── seed.js                # Seeds 13 users, 5 projects, 32+ tasks
β”‚   └── src/
β”‚       β”œβ”€β”€ app.js                 # Express server + CORS + routes
β”‚       β”œβ”€β”€ controllers/
β”‚       β”‚   β”œβ”€β”€ authController.js       # Login, logout, refresh, invite
β”‚       β”‚   β”œβ”€β”€ superAdminController.js # CRUD admins, global analytics
β”‚       β”‚   β”œβ”€β”€ adminController.js      # Invite taskers, scoped analytics
β”‚       β”‚   β”œβ”€β”€ taskController.js       # Role-scoped CRUD
β”‚       β”‚   β”œβ”€β”€ projectController.js    # Role-scoped projects
β”‚       β”‚   β”œβ”€β”€ analyticsController.js  # Role-scoped analytics
β”‚       β”‚   β”œβ”€β”€ userController.js       # User management
β”‚       β”‚   └── commentController.js    # Task comments
β”‚       β”œβ”€β”€ middleware/
β”‚       β”‚   └── auth.js            # authenticate, superAdminOnly, adminOrAbove, scopeGuard
β”‚       β”œβ”€β”€ routes/
β”‚       β”‚   β”œβ”€β”€ superAdminRoutes.js     # /api/super-admin/*
β”‚       β”‚   β”œβ”€β”€ adminRoutes.js          # /api/admin/*
β”‚       β”‚   β”œβ”€β”€ authRoutes.js           # /api/auth/*
β”‚       β”‚   β”œβ”€β”€ taskRoutes.js           # /api/tasks/*
β”‚       β”‚   β”œβ”€β”€ projectRoutes.js        # /api/projects/*
β”‚       β”‚   β”œβ”€β”€ analyticsRoutes.js      # /api/analytics/*
β”‚       β”‚   └── userRoutes.js           # /api/users/*
β”‚       └── utils/
β”‚           β”œβ”€β”€ prisma.js          # Prisma client instance
β”‚           β”œβ”€β”€ jwt.js             # Token generation/verification
β”‚           └── email.js           # Email utilities
β”œβ”€β”€ frontend/
β”‚   └── src/
β”‚       β”œβ”€β”€ App.jsx                # 3-role routing
β”‚       β”œβ”€β”€ api/
β”‚       β”‚   β”œβ”€β”€ axios.js           # Axios instance with interceptors
β”‚       β”‚   └── modules.js         # API modules (superAdminApi, adminApi, etc.)
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ Layout.jsx         # App shell (sidebar + header + content)
β”‚       β”‚   β”œβ”€β”€ Sidebar.jsx        # Role-based navigation
β”‚       β”‚   β”œβ”€β”€ ProtectedRoute.jsx # Route guards
β”‚       β”‚   └── Header.jsx         # Top bar
β”‚       β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ superadmin/        # Super Admin pages
β”‚       β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx       # Global KPIs + admin comparison chart
β”‚       β”‚   β”‚   β”œβ”€β”€ AdminList.jsx       # All admins table
β”‚       β”‚   β”‚   β”œβ”€β”€ CreateAdmin.jsx     # Create admin form
β”‚       β”‚   β”‚   └── AdminDetail.jsx     # Admin detail + tasker table
β”‚       β”‚   β”œβ”€β”€ admin/             # Admin pages
β”‚       β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx       # Scoped analytics dashboard
β”‚       β”‚   β”‚   β”œβ”€β”€ Tasks.jsx           # Task management
β”‚       β”‚   β”‚   β”œβ”€β”€ Projects.jsx        # Project management
β”‚       β”‚   β”‚   β”œβ”€β”€ Team.jsx            # Tasker management + invite
β”‚       β”‚   β”‚   └── Analytics.jsx       # Detailed analytics
β”‚       β”‚   └── tasker/            # Tasker pages
β”‚       β”‚       β”œβ”€β”€ Dashboard.jsx       # Personal stats
β”‚       β”‚       └── MyTasks.jsx         # Assigned tasks
β”‚       └── store/
β”‚           β”œβ”€β”€ authStore.js       # Zustand auth state
β”‚           └── themeStore.js      # Dark/light theme
└── package.json                   # Root scripts (dev, build, start)

πŸ”Œ API Endpoints

Auth (/api/auth)

Method Endpoint Description
POST /login Login (all roles)
POST /logout Logout + clear tokens
POST /refresh Rotate refresh token
POST /forgot-password Send reset email
POST /reset-password Reset with token
POST /accept-invite Accept tasker invite
GET /me Get current user

Super Admin (/api/super-admin) β€” πŸ”’ Super Admin only

Method Endpoint Description
POST /admins Create admin account
GET /admins List all admins + stats
GET /admins/:id Admin detail + taskers
DELETE /admins/:id Deactivate admin
GET /analytics Global analytics

Admin (/api/admin) β€” πŸ”’ Admin or above

Method Endpoint Description
POST /invite-tasker Invite tasker (max 5)
GET /taskers List managed taskers
GET /taskers/:id Tasker detail + stats
DELETE /taskers/:id Deactivate tasker
GET /analytics Scoped analytics
GET /analytics/tasker/:id Tasker timeline

Tasks, Projects, Analytics, Users

All endpoints are role-scoped automatically:

  • Super Admin β†’ sees everything
  • Admin β†’ sees only their managed taskers' data
  • Tasker β†’ sees only their own data

🚒 Railway Deployment

Environment Variables (set in Railway)

Variable Value
DATABASE_URL postgresql://...?sslmode=require
JWT_SECRET Random 32+ char string
JWT_REFRESH_SECRET Random 32+ char string
FRONTEND_URL Your Railway app URL
NODE_ENV production
PORT 5000

Build & Start Commands

  • Build: cd backend && npm install --include=dev && npx prisma generate && cd ../frontend && npm install --include=dev && npm run build
  • Start: cd backend && npx prisma generate && npx prisma db push && (node prisma/seed.js || true) && node src/app.js

πŸ“Š Seed Data Overview

The seed script creates a complete demo environment:

  • 13 users: 1 Super Admin, 2 Admins, 10 Taskers
  • 5 projects: Split across both admin teams
  • 32+ tasks: All 6 statuses represented with realistic dates
  • Status history: Full audit trail for every task
  • Comments: Threaded discussions on tasks
  • Scores: Quality and time scores on completed tasks

πŸ“ License

MIT


Built with by Devashish

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages