Skip to content

pravalika2307/HRlytics-AI

Repository files navigation

HRlytics AI

HRlytics AI Logo

HRlytics AI

A premium, production-grade enterprise SaaS dashboard and conversational AI HR Copilot for calendar cost attributions and workforce optimization analytics.

FastAPI React SQLite Vite Google Gemini


Project Overview

HRlytics AI is a workforce cost management platform designed to help executive leaders analyze meeting overhead, project attributions, and workforce budget leaks. By integrating an automated SQLite attribution pipeline, interactive visualization tabs, and a ChatGPT-style conversational copilot, HRlytics AI converts calendar bloat into actionable cost-saving strategy models.

Problem Statement

Corporate alignment schedules often lead to severe productivity overhead. Without granular cost models, organizations struggle to identify low-impact recurring syncs, mismatching actual meeting cost attributions with department project budgets. HRlytics AI bridges this gap by calculating precise workforce hourly spending models based on headcount and durations.

Features

1. Executive Zinc SaaS Dashboard

  • Workforce Key Metrics: Track total monthly spends, average meeting overhead, and low-confidence calendar items.
  • Savings Simulator: Run double-input models (syncing range sliders and number fields) to simulate meeting time caps.

2. Conversational AI HR Copilot

  • ChatGPT-style Interface: Conversational window with custom-built lightweight markdown rendering.
  • Smart Quick-Prompts: Clickable preset tags answering queries on cost mitigation and project allocations instantly.
  • Heuristics Fallback: A local calculation engine resolving data metrics queries if Gemini credentials are not active.

3. Advanced Business Intelligence

  • Multi-Tab Workspace: Cost Overview, Calendar Audits, and Resource Allocation tabs.
  • Interactive Filtering: Dynamically filter charts by department projects and attribution confidences.
  • High-Definition Export: Download charts locally as high-resolution PNG images.

Architecture Diagram

graph TD
    subgraph Frontend [React SaaS Frontend]
        UI[User Interface] --> Router[React Router]
        Router --> Dashboard[Dashboard & Savings Simulator]
        Router --> Meetings[Meetings Manager]
        Router --> Analytics[Analytics Suite & PNG Export]
        Router --> Advisor[AI HR Copilot Conversational Chat]
        
        Dashboard --> Axios[Axios API Client]
        Meetings --> Axios
        Analytics --> Axios
        Advisor --> Axios
    end

    subgraph Backend [FastAPI REST Server]
        Axios --> Routes[API Routes]
        Routes --> Auth[Dashboard / Meetings / Advisor / Analytics]
        Auth --> Services[Cost Service & Attribution Engine]
        
        Services --> DB[(SQLite Database)]
        DB --> Seeder[Auto-Seeder on Startup]
    end

    subgraph AI [LLM Core]
        Services --> Gemini[Google Gemini SDK]
    end
Loading

Folder Structure

HRlytics-AI/
├── backend/
│   ├── app/
│   │   ├── api/
│   │   │   ├── advisor.py      # AI HR Copilot chat routes & data heuristics
│   │   │   ├── analytics.py    # Cost analyses, salary distribution, duration bins
│   │   │   ├── calendar.py     # Calendar metadata
│   │   │   ├── dashboard.py    # Dashboard metrics calculations
│   │   │   ├── insights.py     # Workforce advisory insights
│   │   │   └── meetings.py     # CRUD operations for meetings
│   │   ├── ai/
│   │   │   └── attribution_engine.py  # Project attribution logic
│   │   ├── database/
│   │   │   ├── database.py     # SQLAlchemy configuration & database engine
│   │   │   ├── session.py      # SQLAlchemy Session dependency creation
│   │   │   └── seeder.py       # Auto-seeder for mock database content
│   │   ├── models/
│   │   │   └── models.py       # SQLite database models
│   │   └── services/
│   │   │   └── cost_service.py # Hourly workforce cost helper functions
│   └── main.py                 # Backend application entrypoint & startup triggers
└── frontend/
    ├── src/
    │   ├── components/
    │   │   ├── Sidebar.jsx     # Collapsible SaaS navigation drawer
    │   │   └── MetricCard.jsx  # Responsive indicators with trend badges
    │   ├── pages/
    │   │   ├── Dashboard.jsx   # Savings simulator and metrics summaries
    │   │   ├── Meetings.jsx    # Meeting cost log management
    │   │   ├── Analytics.jsx   # Tabbed business intelligence charts & exports
    │   │   └── Advisor.jsx     # Conversational ChatGPT-style HR Copilot
    │   ├── services/
    │   │   └── api.js          # Centralized Axios client settings
    │   ├── App.jsx             # React layout wrapper
    │   ├── index.css           # Global custom zinc-dark variables
    │   └── main.jsx            # React root script
    └── index.html              # HTML shell loading Inter font

Tech Stack

  • Frontend: React 19, Vite, Recharts, Framer Motion, Axios, Lucide React, html2canvas.
  • Backend: FastAPI, SQLAlchemy ORM, Uvicorn.
  • Database: SQLite.
  • AI Core: Google Gemini API SDK (gemini-1.5-flash).

Database Design

SQLite tables defined in models.py:

1. employees

  • id (INTEGER, Primary Key)
  • name (VARCHAR)
  • email (VARCHAR, Unique)
  • role (VARCHAR)
  • hourly_cost (FLOAT)

2. projects

  • id (INTEGER, Primary Key)
  • name (VARCHAR, Unique)
  • budget (FLOAT)
  • priority (VARCHAR)

3. meetings

  • id (INTEGER, Primary Key)
  • title (VARCHAR)
  • description (VARCHAR)
  • duration (FLOAT)
  • attendees_count (INTEGER)
  • cost (FLOAT)
  • confidence (FLOAT)
  • project_name (VARCHAR)

4. cost_allocations

  • id (INTEGER, Primary Key)
  • project_name (VARCHAR)
  • allocated_cost (FLOAT)
  • month (VARCHAR)

API Endpoints

Method Endpoint Description
GET /health Server status monitoring
GET /meetings/ Fetch all logged meetings
POST /meetings/cost Attribute project and insert new meeting
DELETE /meetings/{id} Remove a meeting record
GET /analytics/insights Retrieve department costs, salary distribution, monthly spends
POST /advisor/chat Submit conversational questions to AI Copilot

Screenshots Placeholders

1. Executive Dashboard & Savings Simulator

Dashboard Screenshot Placeholder

2. Advanced Multi-Tab Analytics Workspace

Analytics Screenshot Placeholder


Running Locally

Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Create and activate virtual environment:
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Set up credentials in .env:
    DATABASE_URL=sqlite:///./hrlytics.db
    GEMINI_API_KEY=your_gemini_key_here
  5. Launch FastAPI server:
    uvicorn main:app --reload

Frontend Setup

  1. Navigate to the frontend directory:
    cd ../frontend
  2. Install npm modules:
    npm install
  3. Run the Vite developer server:
    npm run dev

Future Roadmap

  • Google Calendar OAuth: Real-time meeting sync.
  • Team-Level Allocations: Categorize costs by specialized sub-teams.
  • Auto-generated Slack Alerts: Weekly cost optimization reports sent directly to channels.

License

Distributed under the MIT License. See LICENSE for more details.


Author

  • Pravalika Palle - Lead Developer & Architect.

About

AI-powered HR Cost Intelligence Platform that analyzes meeting data, attributes work to projects, calculates workforce costs, and generates actionable organizational insights through interactive analytics dashboards.

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors