Skip to content

anveshap103-tomato/FestSafe-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

FestSafe AI β€” Predictive Hospital Readiness Agent

A production-ready SaaS system that predicts hospital surge capacity, recommends resource allocation, provides public health advisories, and enables multi-agent healthcare intelligence for event-driven healthcare management.

🎯 Overview

FestSafe AI ingests real-time and historical data to:

  • Predict hospital surge capacity for events (festivals, concerts, marathons)
  • Recommend optimal resource allocation (staffing, supplies, beds)
  • Provide public health advisories
  • Enable multi-agent decision-making for healthcare operations

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend  │────▢│   Backend    │────▢│  ML Service β”‚
β”‚   (React)   │◀────│   (FastAPI)  │◀────│  (PyTorch)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  PostgreSQL  β”‚
                    β”‚ (TimescaleDB)β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚               β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
            β”‚   Redis    β”‚  β”‚   Kafka/    β”‚
            β”‚  (Cache)   β”‚  β”‚  RabbitMQ   β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Python 3.10+
  • Node.js 18+
  • PostgreSQL 14+ (or use Docker)
  • Redis (or use Docker)

Local Development Setup

  1. Clone the repository

    git clone <repo-url>
    cd "FestSafe AI"
  2. Start infrastructure services

    docker-compose -f infra/docker-compose.dev.yml up -d
  3. Generate synthetic data

    cd ml/training
    python data_simulator.py --hospitals 50 --events 10 --days 90
  4. Train initial model

    python train.py --config configs/baseline.yaml
  5. Start backend

    cd backend
    pip install -r requirements.txt
    uvicorn app.main:app --reload --port 8000
  6. Start frontend

    cd frontend
    npm install
    npm start
  7. Access the application

Using Docker Compose (Recommended)

docker-compose -f infra/docker-compose.dev.yml up --build

πŸ“ Project Structure

FestSafe AI/
β”œβ”€β”€ frontend/          # React + TypeScript frontend
β”œβ”€β”€ backend/           # FastAPI backend
β”œβ”€β”€ ml/                # ML training and inference
β”‚   β”œβ”€β”€ training/      # Model training scripts
β”‚   └── inference/     # Model serving
β”œβ”€β”€ infra/             # Infrastructure as code
β”‚   β”œβ”€β”€ terraform/     # AWS infrastructure
β”‚   └── k8s/           # Kubernetes manifests
β”œβ”€β”€ ci/                # CI/CD workflows
β”œβ”€β”€ docs/              # Documentation
└── tests/             # Integration and E2E tests

πŸ”‘ Key Features

  • Real-time Forecasting: Predict patient surge with <500ms latency
  • Multi-Agent System: Orchestrated agents for forecasting, triage, and communication
  • Event Management: Register and track festivals, concerts, and other events
  • Resource Recommendations: AI-powered staffing and supply suggestions
  • Public Health Advisories: Automated communication for affected areas
  • HIPAA-Conscious Design: Privacy-preserving defaults and encryption

πŸ§ͺ Testing

# Backend tests
cd backend
pytest tests/ -v --cov=app

# Frontend tests
cd frontend
npm test

# Integration tests
pytest tests/integration/ -v

πŸ“Š Monitoring

πŸ”’ Security

  • JWT-based authentication
  • RBAC (Role-Based Access Control)
  • TLS encryption in transit
  • Database encryption at rest
  • PII anonymization on ingestion
  • Audit logging

πŸ“š Documentation

πŸ› οΈ Tech Stack

  • Frontend: React, TypeScript, Tailwind CSS, React Query, Recharts, Mapbox GL
  • Backend: FastAPI, PostgreSQL (TimescaleDB), Redis, RabbitMQ
  • ML: PyTorch, scikit-learn, MLflow
  • Infrastructure: Docker, Kubernetes, Terraform, AWS
  • CI/CD: GitHub Actions
  • Monitoring: Prometheus, Grafana, Loki, Sentry

πŸ“ License

See LICENSE file.

🀝 Contributing

See CONTRIBUTING.md for guidelines.

⚠️ Medical Disclaimer

This system provides suggestions and references only. All medical decisions require clinician review and approval. The system does not provide prescriptive medical advice.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors