Skip to content

harish-3/Task-Flow-AI

Repository files navigation

Task Flow AI

Production-ready, patent-focused enterprise platform for intelligent task coordination and cross-platform orchestration.

License Node.js Python TypeScript

Overview

Task Flow AI is a novel AI Orchestration System (Patent Strength: 9/10) that combines deterministic machine learning, generative AI (Gemini 1.5 Flash), and adaptive learning to revolutionize workforce coordination and task management.

Key Innovations

  1. Experience-Weighted Skill Matching with Adaptive Learning - Quantified skill levels (1-10 scale) that automatically adjust based on task completion performance
  2. Self-Improving Task Subdivision with Human-in-the-Loop Feedback - AI generates subtasks, learns from Team Leader corrections
  3. Predictive Workforce Gap Analysis with Auto-Backfill - Detects missing skills proactively, generates training/hiring recommendations with cost estimates

Enterprise Features

  • Multi-Organization Tenancy - Support for multiple organizations and teams
  • Smart Onboarding - Invite code system with resume-based role matching (89%+ accuracy)
  • AI-Powered Task Subdivision - Upload PRDs, get intelligent subtask breakdown with skill-based assignments
  • Cross-Platform Activity Tracking - Real-time integration with GitHub, VS Code, Figma, Google Sheets, Slack, Discord, Google Calendar, Notion, Trello
  • Intelligent Risk Alerts - Proactive detection of stuck/delayed tasks
  • GDPR Compliance - AES-256-GCM encryption, audit logging, 90-day retention policy

System Architecture

Technology Stack

Frontend:

  • React 18 + TypeScript + Vite
  • Tailwind CSS + shadcn/ui components
  • Clerk authentication
  • Socket.io client (real-time updates)
  • React Query (data fetching)

Backend:

  • Node.js 20 LTS + Express + TypeScript
  • Prisma ORM + PostgreSQL 15
  • Redis 7 (caching & sessions)
  • Socket.io (WebSocket server)
  • Winston (logging)

ML Service:

  • Python 3.11 + FastAPI
  • scikit-learn (TF-IDF, Cosine Similarity, Linear Regression)
  • Google Gemini 1.5 Flash API
  • pdfplumber + mammoth (text extraction)

Infrastructure:

  • Docker + Docker Compose
  • Vercel (frontend deployment)
  • Render (backend + database)
  • GitHub Actions (CI/CD)

Project Structure

task-flow-ai/
├── frontend/              # React 18 SPA
│   ├── src/
│   │   ├── components/    # 30+ reusable components
│   │   ├── pages/         # Admin, Team Leader, Member dashboards
│   │   ├── hooks/         # Custom React hooks
│   │   ├── lib/           # Utilities, API client
│   │   └── types/         # TypeScript definitions
│   └── package.json
├── backend/               # Express API server
│   ├── src/
│   │   ├── routes/        # 22 API route modules
│   │   ├── services/      # Business logic (integrations, ML)
│   │   ├── middleware/    # Auth, RBAC, validation, error handling
│   │   ├── utils/         # Encryption, audit, skill adjustment
│   │   ├── jobs/          # Background tasks (GDPR, risk monitoring)
│   │   └── websocket/     # Socket.io handlers
│   ├── prisma/
│   │   └── schema.prisma  # 22 tables
│   ├── tests/             # Jest tests (130+ tests)
│   └── package.json
├── ml-service/            # Python FastAPI ML engine
│   ├── app/
│   │   ├── routers/       # ML API endpoints
│   │   ├── services/      # TF-IDF, similarity, assignment algorithms
│   │   └── main.py
│   ├── tests/             # Pytest tests (46 tests)
│   └── requirements.txt
├── vscode-extension/      # VS Code activity tracker
│   ├── src/
│   │   └── extension.ts   # HMAC-signed event publisher
│   └── package.json
├── docker-compose.yml     # Local development setup
└── render.yaml            # Production deployment config

Database Schema

Core Tables (22 total)

Multi-Tenancy:

  • organizations - Top-level organization management
  • teams - Multiple teams per organization
  • invitation_codes - 6-character alphanumeric invite codes with 7-day expiry
  • team_members - Junction table for team membership

User Management:

  • users - Extended with encrypted resume, skills JSONB, approval status
  • roles - Predefined roles with TF-IDF skill requirements

Task Management:

  • tasks - Main tasks with PRD support, subdivision status
  • subtasks - AI-generated granular subtasks with required skills, dependencies
  • assignments - Task-to-user mapping with similarity scores
  • task_dependencies - Dependency graph for visualization

Adaptive Learning (Patent-Protected):

  • skill_history - Complete audit trail of skill level changes
  • subdivision_feedback - AI retry logic with attempt tracking
  • skill_recommendations - Training & hiring suggestions with cost estimates

Activity & Analytics:

  • activity_logs - Cross-platform activity tracking
  • eta_predictions - ML-based ETA predictions with explainability
  • hr_requirements - Missing capability alerts
  • risk_alerts - Intelligent risk detection
  • performance_metrics - Team member analytics
  • skill_demand_trends - Skill gap analytics over time

Security & Compliance:

  • audit_logs - GDPR-compliant audit trail
  • vscode_event_secrets - HMAC-SHA256 secrets for VS Code extension
  • platform_integrations - Encrypted OAuth tokens

Getting Started

Prerequisites

  • Node.js 20 LTS or higher
  • Python 3.11 or higher
  • PostgreSQL 15 or higher
  • Redis 7 or higher
  • Docker & Docker Compose (recommended)
  • Clerk account (for authentication)
  • Google Gemini API key (for task subdivision)

Environment Variables

Backend (.env)

DATABASE_URL="postgresql://user:password@localhost:5432/taskflow"
REDIS_URL="redis://localhost:6379"
CLERK_SECRET_KEY="sk_test_..."
CLERK_PUBLISHABLE_KEY="pk_test_..."
ML_SERVICE_URL="http://localhost:8000"
GEMINI_API_KEY="AIza..."
ENCRYPTION_KEY="32-byte-hex-key"
PORT=3000
NODE_ENV=development

Frontend (.env)

VITE_CLERK_PUBLISHABLE_KEY="pk_test_..."
VITE_API_URL="http://localhost:3000"

ML Service (.env)

GEMINI_API_KEY="AIza..."
MODEL_ARTIFACTS_PATH="./artifacts"

Local Development Setup

Option 1: Docker Compose (Recommended)

# 1. Clone repository
git clone <repository-url>
cd task-flow-ai

# 2. Copy environment files
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
cp ml-service/.env.example ml-service/.env

# 3. Edit .env files with your API keys

# 4. Start all services
docker-compose up

# 5. Run database migrations (in another terminal)
cd backend
npm run prisma:migrate
npm run prisma:seed

# Access the application:
# Frontend: http://localhost:5173
# Backend API: http://localhost:3000
# ML Service: http://localhost:8000
# Prisma Studio: npm run prisma:studio

Option 2: Manual Setup

# 1. Install backend dependencies
cd backend
npm install

# 2. Install frontend dependencies
cd ../frontend
npm install

# 3. Install ML service dependencies
cd ../ml-service
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

# 4. Start PostgreSQL & Redis
# (Use Docker or local installation)

# 5. Run database migrations
cd ../backend
npm run prisma:migrate
npm run prisma:seed

# 6. Start services (in separate terminals)

# Terminal 1 - Backend
cd backend
npm run dev

# Terminal 2 - ML Service
cd ml-service
uvicorn app.main:app --reload --port 8000

# Terminal 3 - Frontend
cd frontend
npm run dev

Features & Capabilities

1. Smart Onboarding (4-Step Process)

  1. Invitation Generation - Team Leader generates 6-character code (e.g., ABC123)
  2. Resume Upload - New member uploads PDF/DOC resume
  3. AI Role Matching - TF-IDF + cosine similarity matches resume to roles (89%+ accuracy)
  4. Team Leader Approval - Review AI recommendation and approve/reject

2. AI-Powered Task Subdivision

  1. PRD Upload - Team Leader uploads Product Requirements Document
  2. Gemini Subdivision - AI generates subtasks with required skills and tools
  3. Experience-Weighted Assignment - Algorithm matches subtasks to team members based on skill proficiency
  4. Human Review - Team Leader can retry with feedback ("too granular", "wrong assignments")
  5. Continuous Improvement - System learns from feedback for better future subdivisions

3. Adaptive Skill Learning

  • Performance Tracking - Monitors actual vs. estimated completion times
  • Automatic Skill Adjustment:
    • Complete 35% faster → Skill level +0.5
    • Complete 25% slower → Skill level -0.3
  • Skill History - Complete audit trail of all adjustments
  • Future Assignment Weighting - System uses updated skills for better matching

4. Intelligent Workforce Gap Analysis

  • Missing Capability Detection - Flags subtasks with no qualified team members
  • Training Recommendations - "Enroll Bob in Advanced React (Udemy, $19.99, 2 weeks)"
  • Hiring Specifications - "Hire Senior DevOps Engineer ($110k-$130k, Kubernetes 8/10)"
  • Auto-Backfill - When new member joins, pending tasks automatically appear in their dashboard

5. Cross-Platform Integrations

GitHub: OAuth + webhooks for commits, PRs, issues
VS Code Extension: HMAC-signed file edit tracking
Figma: OAuth + webhooks for design updates
Google Sheets: Drive API push notifications
Slack: Bot with interactive buttons, slash commands
Discord: Bot + webhooks for risk alerts
Google Calendar: Auto-create events with predicted ETAs
Notion: Link tasks to documentation
Trello: Two-way sync with boards

All integrations use AES-256-GCM encryption for OAuth tokens and HMAC-SHA256 webhook verification.

6. Role-Based Dashboards

Admin/HR Dashboard:

  • Organization setup
  • Team management
  • User approvals
  • HR requirements & hiring recommendations
  • Analytics (skill gaps, performance trends)

Team Leader Dashboard:

  • Pending member approvals
  • Invitation management
  • PRD upload & AI subdivision review
  • Team activity overview
  • Skill development recommendations

Team Member Dashboard:

  • Assigned subtasks with filters
  • Skill progression display
  • Activity tracking
  • Training recommendations
  • Platform integration status

API Documentation

See API_DOCUMENTATION.md for comprehensive endpoint specifications.

Key Endpoints:

  • /api/organizations - Organization management
  • /api/teams - Team CRUD operations
  • /api/invitations - Invite code generation & validation
  • /api/onboarding - Resume upload, role matching, approvals
  • /api/tasks - Task management & PRD upload
  • /api/tasks/:id/subdivide - AI-powered task subdivision
  • /api/subtasks - Subtask CRUD with status updates
  • /api/skills/recommendations - Training & hiring suggestions
  • /api/analytics - Performance insights, skill gaps, workload balance
  • /api/integrations - Platform OAuth flows

Testing

Backend Tests (Jest)

cd backend

# Run all tests
npm test

# Run with coverage
npm test -- --coverage

# Run specific suite
npm test -- tests/unit/encryption.test.ts

Test Coverage: 130+ tests

  • Unit tests: Encryption, skill adjustment, algorithms
  • Integration tests: Onboarding flow, API endpoints
  • Security tests: HMAC, tampering detection, GDPR compliance

ML Service Tests (Pytest)

cd ml-service

# Install dev dependencies
pip install -r requirements-dev.txt

# Run all tests
pytest

# Run with coverage
pytest --cov=app --cov-report=html

Test Coverage: 46 tests

  • TF-IDF vectorization (15 tests)
  • Cosine similarity (17 tests)
  • Assignment algorithm (14 tests)

See TESTING.md for comprehensive testing documentation.

Deployment

Production Environment

Frontend (Vercel):

  • Automatic deployment on push to main
  • Environment variables via Vercel dashboard
  • CDN + edge caching

Backend (Render):

  • Node.js service + PostgreSQL + Redis
  • Auto-deploy from render.yaml
  • Health checks + zero-downtime deployments

ML Service (Render/Railway):

  • Python container
  • Auto-scaling
  • GPU support (optional)

See DEPLOYMENT.md for detailed deployment instructions.

CI/CD Pipeline

GitHub Actions workflow:

  1. Lint & type check on PR
  2. Run test suite (backend + ML)
  3. Build verification
  4. Auto-deploy to Vercel (frontend) on merge
  5. Auto-deploy to Render (backend + ML) on merge

Monitoring & Health Checks

  • Sentry - Error tracking & performance monitoring
  • UptimeRobot - Uptime monitoring
  • Custom health endpoints - /health, /health/db, /health/redis, /health/ml

See MONITORING.md and HEALTH_CHECKS.md.

Security

Encryption Standards

  • Resume Encryption: AES-256-GCM with random IV + authentication tag
  • OAuth Tokens: AES-256-GCM with per-integration keys
  • VS Code Events: HMAC-SHA256 signatures with user-specific secrets
  • Webhook Verification: HMAC-SHA256 with timing-safe comparison

Audit Logging

Complete audit trail for:

  • Resume uploads, access, deletions
  • Role changes & skill updates
  • Task assignments & completions
  • Integration authorizations

GDPR Compliance

  • Complete data deletion with cascade
  • 90-day retention policy (automated cron job)
  • Audit log retention post-deletion
  • User consent tracking

See backend/SECURITY.md for security implementation details.

Patent Claims

See PATENT_CLAIMS.md for detailed patent analysis, prior art comparison, and algorithm specifications.

Patent Strength: 9/10

Core Claims:

  1. Experience-Weighted Skill Matching with Adaptive Learning
  2. Predictive Workforce Gap Analysis with Auto-Backfill
  3. Self-Improving Task Subdivision with Human-in-the-Loop Feedback
  4. Automated Skill Development Recommendations with Cost Estimates

Architecture & Data Flow

See ARCHITECTURE.md for system diagrams, data flow charts, and integration architecture.

Demo Videos & Walkthrough

See DEMO_GUIDE.md for video scripts and step-by-step demonstration guides.

Documentation

Contributing

This is a proprietary project. Contributions are restricted to authorized team members.

License

Proprietary - All Rights Reserved

This software is protected by patent pending claims and proprietary technology. Unauthorized copying, distribution, or use is strictly prohibited.

Contact

For inquiries about licensing, partnerships, or patent collaboration, contact: [your-email@domain.com]


Built with ❤️ for intelligent workforce coordination

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published