A comprehensive, multi-component employee performance analytics platform featuring a Telegram bot with AI capabilities, an interactive web dashboard, and advanced data processing tools. Built for modern HR analytics and real-time employee performance management.
| Component | URL | Description |
|---|---|---|
| ๐ Interactive Dashboard | https://icta-dataanalyst-1.onrender.com/ | Executive analytics dashboard |
| ๐ค Telegram Bot + API | https://icta-dataanalyst.onrender.com | AI-powered bot & REST API |
| ๐ฌ Telegram Bot | @icta_analyst_bot | Interactive AI assistant |
This system transforms raw employee attendance data into actionable business insights through three integrated components:
- ๐ Analytics Dashboard - Executive-level visual analytics
- ๐ค AI-Powered Telegram Bot - Interactive employee data analysis
- ๐ REST API - Programmatic data access
- ๐๏ธ Database System - PostgreSQL with comprehensive data storage
graph TD
A[Excel Data Sources] --> B[PostgreSQL Database]
B --> C[REST API Endpoints]
B --> D[Dash Analytics Dashboard]
B --> E[Telegram Bot + Gemini AI]
C --> F[External Integrations]
D --> G[Executive Reporting]
E --> H[Employee Interactions]
subgraph "Data Processing"
B --> I[Attendance Analysis]
B --> J[Performance Metrics]
B --> K[Financial Calculations]
end
Excel Files (6 sources)
โ
PostgreSQL Database (icta schema)
โ
Real-time Analytics Engine
โ
Multi-channel Delivery (Dashboard, Bot, API)
| Table | Records | Description |
|---|---|---|
attendance |
246 rows | Daily attendance with entry/exit times |
holiday |
3 rows | Employee leave periods |
permission |
6 rows | Permission/break records |
data |
192 rows | Processed work hours and calculations |
monthly_fines_bonuses |
12 rows | Monthly performance summaries |
task_1, task_2 |
248, 20 rows | Task-specific datasets |
- Python 3.9+
- PostgreSQL database
- Telegram Bot Token
- Google Gemini API Key
git clone https://github.com/Ismat-Samadov/ICTA_DataAnalyst
cd ICTA_DataAnalyst
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate# Copy environment template
cp .env.example .env
# Edit .env with your credentials
nano .env# For Dashboard
cd dashboard
pip install -r requirements.txt
# For Telegram Bot + API
cd ../telegram
pip install -r requirements.txtcd dashboard
python dashboard.py
# Access: http://localhost:8050cd telegram
python app.py
# API: http://localhost:8000
# Bot: Active on TelegramURL: https://icta-dataanalyst-1.onrender.com/
- ๐ Executive Overview: KPIs, performance summaries, top performers
- ๐ฅ Employee Analysis: Individual metrics, productivity scoring, performance matrix
- ๐ข Department Performance: Efficiency analysis, radar charts, comparisons
- ๐ฐ Financial Impact: Bonus/fine analysis, ROI calculations, net impact
- ๐ Trends & Insights: Time series, AI recommendations, pattern recognition
- Frontend: Dash + Plotly (Interactive visualizations)
- Backend: Python + Pandas (Data processing)
- Database: PostgreSQL + SQLAlchemy (Real-time queries)
- Deployment: Gunicorn + Render
Bot: @icta_analyst_bot | API: https://icta-dataanalyst.onrender.com
- ๐ง AI Analysis: Natural language queries powered by Google Gemini
- ๐ Visual Analytics: Auto-generated charts and performance reports
- ๐ฌ Interactive Commands:
/start,/analytics,/ai,/attendance - ๐ Smart Insights: Context-aware responses and recommendations
GET /- API status and informationGET /attendance- Employee attendance recordsGET /holiday- Holiday and leave dataGET /permission- Permission and break recordsGET /data- Processed performance metricsGET /monthly_fines_bonuses- Monthly calculationsGET /task_1,/task_2- Task-specific datasets
- Bot Framework: python-telegram-bot (Webhook-based)
- AI Engine: Google Gemini 1.5 Flash
- API Framework: FastAPI (Async endpoints)
- Database: PostgreSQL (Real-time connectivity)
- Deployment: Uvicorn + Render
- Employee Productivity Score:
Overtime - Delays - Department Efficiency:
Overtime / (Delays + 1) - Financial Impact:
Total Bonuses - Total Fines - Attendance Patterns: Daily/monthly trend analysis
- Delay > 3 hours: 2% fine
- Delay > 10 hours: 3% fine
- Delay > 20 hours: 5% fine
- Overtime > 3 hours: 2% bonus
- Overtime > 10 hours: 3% bonus
- Overtime > 20 hours: 5% bonus
- Automated performance recommendations
- Trend pattern recognition
- Department comparison analysis
- Employee recognition suggestions
- Attendance issue identification
- Language: Python 3.9+
- Web Frameworks: FastAPI, Dash
- Database: PostgreSQL + SQLAlchemy
- AI/ML: Google Gemini API
- Data Processing: Pandas, NumPy
- Visualization: Plotly, Dash
- Styling: Custom CSS, Responsive design
- Interactive Elements: Dash callbacks, Real-time updates
- Deployment: Render (Multiple services)
- Database Hosting: Neon PostgreSQL
- Environment Management: python-dotenv
- Process Management: Gunicorn, Uvicorn
- Telegram API: Bot messaging and webhooks
- Google Gemini: Natural language processing
- PostgreSQL: Real-time data queries
- REST APIs: Cross-platform data access
ICTA_DataAnalyst/
โโโ ๐ dashboard/ # Analytics Dashboard
โ โโโ dashboard.py # Main dashboard application
โ โโโ requirements.txt # Dashboard dependencies
โ โโโ README.md # Dashboard documentation
โโโ ๐ค telegram/ # Bot + API
โ โโโ app.py # Combined FastAPI + Telegram bot
โ โโโ requirements.txt # Bot/API dependencies
โ โโโ README.md # Bot documentation
โโโ ๐ data/ # Original Excel files
โ โโโ attendance.xlsx # Employee attendance data
โ โโโ holiday.xlsx # Holiday/leave records
โ โโโ permission.xlsx # Permission data
โ โโโ monthly_fines_bonuses.xlsx
โ โโโ data.xlsx # Processed data
โ โโโ task.xlsx # Task specifications
โโโ ๐ฌ analyse/ # Data analysis notebooks
โ โโโ analyse.ipynb # Jupyter analysis
โโโ ๐ .env.example # Environment template
โโโ ๐ .env # Environment variables (private)
โโโ ๐ Tasks.md # Project requirements
โโโ ๐ README.md # This file
# Database Configuration
PGHOST=your_postgres_host
PGDATABASE=your_database_name
PGUSER=your_database_user
PGPASSWORD=your_database_password
# Telegram Bot
BOT_TOKEN=your_telegram_bot_token
# AI APIs
GEMINI_API_KEY=your_google_gemini_api_key
# Optional
RENDER_EXTERNAL_URL=https://your-app.onrender.com
USE_WEBHOOK=falseThe system uses PostgreSQL with the icta schema containing processed employee data:
-- Example data structure
SELECT * FROM icta.attendance LIMIT 5;
SELECT * FROM icta.monthly_fines_bonuses;
SELECT * FROM icta.data WHERE "Employee" = 'Aynur';# Build Command
pip install -r requirements.txt
# Start Command
gunicorn dashboard:server
# Environment Variables
PGHOST, PGDATABASE, PGUSER, PGPASSWORD# Build Command
pip install -r requirements.txt
# Start Command
python app.py
# Environment Variables
PGHOST, PGDATABASE, PGUSER, PGPASSWORD, BOT_TOKEN, GEMINI_API_KEY- Executive Overview: Monitor company-wide performance KPIs
- Employee Deep-dive: Analyze individual performance metrics
- Department Comparison: Compare efficiency across teams
- Financial Analysis: Track bonus/fine distributions
- Trend Analysis: Identify performance patterns
User: "Which employee has the most overtime this month?"
Bot: "Based on the latest data, Aynur from IT has the highest overtime with 25.17 hours this month, earning a 5% bonus for exceptional performance."
User: "Compare IT and Marketing departments"
Bot: "Department Analysis: IT shows higher average overtime (20.7h) but Marketing has better attendance consistency. IT generates more bonuses but also incurs more overtime costs."
User: "/analytics"
Bot: [Sends comprehensive performance charts]
# Get attendance data
curl https://icta-dataanalyst.onrender.com/attendance
# Get monthly summaries
curl https://icta-dataanalyst.onrender.com/monthly_fines_bonuses
# Check API status
curl https://icta-dataanalyst.onrender.com/- Excel files uploaded to PostgreSQL
ictaschema - 6 data sources covering attendance, holidays, permissions, and calculations
- Automated data processing and relationship mapping
- Live database queries for current metrics
- On-demand calculations for KPIs and insights
- Performance optimization through SQLAlchemy
- Dashboard: Visual analytics for executives and managers
- Telegram Bot: Interactive AI-powered employee queries
- REST API: Programmatic access for integrations
- Natural Language Processing: Ask questions in plain English
- Context-Aware Responses: Understands business terminology
- Automated Insights: Identifies trends and patterns
- Recommendation Engine: Suggests actions based on data
- Interactive Charts: Plotly-powered dashboards
- Real-time KPIs: Live performance indicators
- Comparative Analysis: Department and employee comparisons
- Financial Metrics: ROI and cost-benefit analysis
- Multi-platform Access: Web dashboard, Telegram bot, REST API
- Real-time Data: Always current with database sync
- Webhook-based Bot: Production-ready Telegram integration
- RESTful API: Standard endpoints for external systems
- Environment variable configuration
- SQL injection prevention via SQLAlchemy
- Webhook authentication for Telegram
- Connection pooling for database optimization
- Efficient database queries with proper indexing
- Connection pooling for high-concurrency access
- Lazy loading for dashboard components
- Optimized SQL queries for real-time analytics
- Employee Performance: 246 attendance records analyzed
- Department Efficiency: IT vs Marketing comparisons
- Financial Impact: Bonus/fine calculations and ROI
- Productivity Trends: Monthly and daily pattern analysis
- Database: PostgreSQL with 6 optimized tables
- API Performance: FastAPI with async endpoints
- Bot Responsiveness: Webhook-based real-time messaging
- Dashboard Load Time: Optimized Plotly visualizations
# Clone repository
git clone <repository-url>
cd ICTA_DataAnalyst
# Set up environment
cp .env.example .env
# Edit .env with your credentials
# Install dependencies for each component
cd dashboard && pip install -r requirements.txt
cd ../telegram && pip install -r requirements.txt- Dashboard: Add new visualization functions in
dashboard/dashboard.py - Bot: Extend AI capabilities in
telegram/app.py - API: Add new endpoints in the FastAPI application
- Database: Extend schema with new analytical tables
- Real-time data refresh for dashboard
- Advanced ML predictions for performance forecasting
- Mobile app integration with push notifications
- Custom alert systems for performance thresholds
- Integration with popular HR management systems
- Slack bot for team notifications
- Email reporting automation
- Microsoft Teams integration
- Calendar sync for attendance tracking
- Payroll system integration
- Dashboard: dashboard/README.md
- Telegram Bot: telegram/README.md
- API Reference: Available at
/docsendpoint - Database Schema: Documented in data analysis notebooks
- Check environment variable configuration
- Verify database connectivity
- Ensure API keys are valid
- Review deployment logs
- Dashboard: https://icta-dataanalyst-1.onrender.com/
- API: https://icta-dataanalyst.onrender.com
- Bot: @icta_analyst_bot
๐ Project Status: Fully deployed and operational with comprehensive employee analytics, AI-powered insights, and multi-platform accessibility!
๐ฏ Built for: ICTA Data Analyst Assessment - Comprehensive employee performance management system