Skip to content

TransparAI is an open-source AI-powered dashboard that analyzes public procurement data to expose bias, inefficiency, and anomalies. Built for the SFLC.in Hackathon under the theme "Defending Digital Rights through Open Source Innovation."

License

Notifications You must be signed in to change notification settings

LiteralKrishu/TransparAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TransparAI - Procurement Transparency Dashboard

SFLC.in Open Source Python Streamlit

🎯 Project Overview

TransparAI is an open-source AI-powered dashboard that analyzes public procurement data to expose bias, inefficiency, and anomalies. Built for the SFLC.in Hackathon under the theme "Defending Digital Rights through Open Source Innovation."

The dashboard provides real-time transparency into government contracting processes using machine learning to detect suspicious patterns and promote accountability.

πŸš€ Features

πŸ” Core Dashboard Features

  • πŸ“Š At-a-Glance Summary

    • Total contracts, value, and vendor metrics
    • Real-time procurement overview
    • Key performance indicators
  • 🚨 AI Anomaly Detection

    • Isolation Forest machine learning algorithm
    • Detection of suspicious contract values
    • Interactive scatter plots for visualization
  • 🏒 Vendor Concentration Analysis

    • Market distribution analysis
    • Top vendor share percentages
    • Contract value distribution charts
  • ⏱️ Procurement Efficiency Tracking

    • Time-to-award analysis
    • Processing delay identification
    • Monthly trend analysis

🎨 Design Features

  • SFLC.in Brand Compliance: Official colors (#1486c9) and Noto Sans typography
  • Responsive Design: Works on desktop and mobile devices
  • Accessibility: WCAG AA compliant with proper contrast ratios
  • Real-time Data: Integration with Government e-Marketplace (GeM) APIs

πŸ› οΈ Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Quick Start

  1. Clone or download the project
# If using git
git clone <repository-url>
cd TransparAI-Dashboard

# Or simply extract the project folder
  1. Install dependencies
pip install -r requirements.txt
  1. Run the application
streamlit run app.py

Open your browser and navigate to http://localhost:8501

Automated Setup (Windows/PowerShell)

Run the setup script

.\run_dashboard.ps1

Or use the batch file

.\run_dashboard.bat

These scripts will automatically:

  • Check for Python installation
  • Create a virtual environment
  • Install all dependencies
  • Launch the dashboard

πŸ“Š Data Sources

Primary Sources

  • Government e-Marketplace (GeM) API - Real-time contract data
  • Open Government Data Platform India - Supplementary datasets

Sample Data

  • Generated realistic Indian procurement data for demonstration
  • Includes contracts from major vendors and ministries
  • Anomalies artificially introduced for testing detection algorithms

πŸ—οΈ Project Structure

TransparAI-Dashboard/
β”œβ”€β”€ app.py                 # Main Streamlit application
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ run_dashboard.ps1     # PowerShell launch script
β”œβ”€β”€ run_dashboard.bat     # Windows batch launch script
β”œβ”€β”€ .gitignore           # Git ignore rules
β”œβ”€β”€ config/
β”‚   └── settings.json    # Application configuration
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ sample_procurement_data.csv    # Generated sample data
β”‚   └── sample_procurement_data.json   # JSON format sample data
β”œβ”€β”€ src/
β”‚   └── data_generator.py # Sample data generation utility
β”œβ”€β”€ utils/
β”‚   └── helpers.py       # Data processing and API utilities
β”œβ”€β”€ tests/
β”‚   └── test_dashboard.py # Test cases
β”œβ”€β”€ models/              # Machine learning models
└── assets/             # Static assets (images, etc.)

πŸ”§ Configuration

Data Source Selection

The dashboard supports multiple data sources accessible via the sidebar:

  • Real-time API: Fetches live data from government portals
  • Sample Data: Uses generated dataset for demonstration

Customization

Edit config/settings.json to modify:

  • API endpoints
  • Anomaly detection parameters
  • Styling and colors
  • Analysis thresholds
{
    "api_endpoints": {
        "gem": "https://api.gem.gov.in/public/api/v1/contracts",
        "ogd": "https://api.data.gov.in/resource/"
    },
    "anomaly_detection": {
        "contamination": 0.1,
        "random_state": 42
    },
    "styling": {
        "primary_color": "#1486c9",
        "font_family": "Noto Sans"
    }
}

πŸ€– Machine Learning Features

Anomaly Detection

  • Algorithm: Isolation Forest from scikit-learn
  • Features: Contract value and processing time
  • Output: Binary classification of anomalous contracts
  • Visualization: Interactive scatter plots with hover details

Statistical Analysis

  • Vendor concentration metrics
  • Processing time distributions
  • Temporal trend analysis
  • Category-wise breakdowns

🎨 Design System

Typography

  • Primary Font: Noto Sans (Google Fonts)
  • Headings: 700 weight
  • Subheadings: 500 weight
  • Body Text: 400 weight

Color Palette

  • Primary: #1486c9 (SFLC.in Blue)
  • Secondary: #ff6b6b (Anomaly highlights)
  • Background: #f8f9fa (Light gray)
  • Text: #333333 (Dark gray)

Layout Principles

  • Clean, minimal design
  • Ample white space
  • Consistent spacing
  • Mobile-responsive grid

πŸ§ͺ Testing

Run the test suite to verify functionality:

python -m pytest tests/test_dashboard.py -v

Tests include:

  • Data processing validation
  • Anomaly detection accuracy
  • Metric calculation correctness

πŸ”„ Data Generation

Generate new sample data:

python src/data_generator.py

This creates:

  • data/sample_procurement_data.csv
  • data/sample_procurement_data.json

πŸš€ Deployment

Local Development

streamlit run app.py

Production Deployment

The application can be deployed on:

  • Streamlit Cloud
  • Heroku
  • AWS/Azure/GCP
  • Any Python-compatible hosting service

🀝 Contributing

This project is built for the SFLC.in Hackathon. We welcome contributions under the open-source initiative.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

πŸ“„ License

Open Source - SFLC.in Hackathon Project

πŸ™ Acknowledgments

  • SFLC.in for the hackathon platform and guidance
  • Government of India for open data initiatives
  • Open source community for tools and libraries
  • Contributors who help improve transparency in public procurement

πŸ“ž Support

For technical issues or questions:

  • Check the troubleshooting tips in the application
  • Verify your Python environment meets requirements
  • Ensure internet connectivity for real-time data features

Built with ❀️ for Digital Rights Transparency

TransparAI - Defending Digital Rights through Open Source Innovation

About

TransparAI is an open-source AI-powered dashboard that analyzes public procurement data to expose bias, inefficiency, and anomalies. Built for the SFLC.in Hackathon under the theme "Defending Digital Rights through Open Source Innovation."

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages