Skip to content

xyz-harshal/Airavat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  NeuroTwin: Brain Digital Twin Platform

๐Ÿ”ฎ Advanced EEG Analysis & Neural Simulation Platform ๐Ÿงฌ

Next.js FastAPI Python React Supabase

๐Ÿš€ What is NeuroTwin?

NeuroTwin is a cutting-edge platform that creates personalized Digital Brain Twins from EEG data, enabling medical professionals to:

  • ๐Ÿ“Š Analyze EEG patterns for neurological conditions
  • ๐Ÿ’Š Simulate medication responses before prescription
  • ๐Ÿ”ฎ Predict surgical outcomes with high accuracy
  • ๐Ÿง  Visualize brain activity patterns in 3D
  • ๐Ÿค– Leverage AI for automated clinical insights

Note: NeuroTwin is a next-generation neural modeling platform that transforms how clinicians interact with patient brain data.

โœจ Key Features

๐Ÿ” EEG Analysis ๐Ÿงช Treatment Simulation ๐Ÿง  Brain Visualization ๐Ÿค– AI Assistant
Epilepsy detection Medication response 3D neural mapping Clinical insights
Seizure risk Surgical outcomes Temporal activity tracking Report generation
Cognitive patterns Side effect prediction Regional abnormality view Diagnostic support

๐Ÿ› ๏ธ Technology Stack

Frontend

  • Next.js 15 - React framework with SSR & App Router
  • React 19 - Component-based UI library
  • Tailwind CSS - Utility-first styling
  • Shadcn UI - Accessible component library
  • Electron - Desktop application support (optional)

Backend

  • FastAPI - High-performance Python API framework
  • Supabase - Database & authentication
  • PyTorch - Neural network models
  • MNE - EEG/MEG data processing
  • Groq API - LLM integration for clinical insights

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.8+
  • Supabase account
  • Groq API key

1๏ธโƒฃ Clone the Repository

git clone https://github.com/yourusername/NeuroTwin.git
cd NeuroTwin

2๏ธโƒฃ Backend Setup

NeuroTwin has two backend services: a FastAPI server and a Flask server. Both need to be running for full functionality.

FastAPI Backend

# Create and activate virtual environment
cd server
python -m venv venv

# Linux/macOS
source venv/bin/activate

# Windows
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create .env file (see template below)
# Start the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000

Flask Backend

# With the same virtual environment active
cd server

# Start the Flask server
python app.py
# This will run on port 5000 by default

Backend .env Template:

SUPABASE_URL=your-supabase-url
SUPABASE_KEY=your-supabase-anon-key
SUPABASE_SERVICE_KEY=your-supabase-service-role-key
GROQ_API_KEY=your-groq-api-key
SECRET_KEY=your-jwt-secret-key
ALGORITHM=HS256

3๏ธโƒฃ Frontend Setup

# Navigate to client directory
cd client

# Install dependencies
npm install

# Start development server
npm run dev

Client .env.local Template:

NEXT_PUBLIC_API_URL=http://localhost:8000

4๏ธโƒฃ Access the Application

๐Ÿงช Key Modules

๐Ÿ” EEG Analysis

Upload and process EEG data to create personalized brain models and detect neurological conditions.

๐Ÿง  Brain Viewer

Interactive 3D visualization of brain activity patterns, allowing temporal exploration and abnormality detection.

๐Ÿ’Š Medication Simulation

Simulate the effects of medications on brain activity with personalized Digital Twin models.

๐Ÿ”ช Surgical Simulation

Predict outcomes of different surgical approaches for neurological conditions.

๐Ÿ“Š Patient Records

Manage patient data, EEG recordings, and analysis results in a secure dashboard.

๐Ÿ’ป Development Commands

Backend

# Run tests
pytest

# Generate OpenAPI schema
python -c "import main; print(main.app.openapi())" > openapi.json

# Create migration
python -m alembic revision --autogenerate -m "migration message"

# Apply migration
python -m alembic upgrade head

Frontend

# Run development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Run Electron app (desktop)
npm run electron-dev

# Build Electron app
npm run electron-build

๐ŸŒ Deployment

Backend Deployment

# Using Gunicorn
gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app

Frontend Deployment

# Build Next.js app
npm run build

# Deploy to Vercel
vercel

๐Ÿ“ฑ Desktop Application

NeuroTwin can also run as a desktop application using Electron:

# Run Electron dev mode
npm run electron-dev

# Package for distribution
npm run electron-build

๐Ÿ”’ Security Notes

  • All EEG data is processed locally before storage
  • End-to-end encryption for patient records
  • Role-based access control for clinical teams
  • Compliance with healthcare data regulations

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin amazing-feature)
  5. Open a Pull Request

๐Ÿ‘ฅ Team

  • Harshal - Developer - GitHub
  • Ghruank - Developer - GitHub
  • Prathamesh - Developer - GitHub
  • Yadnesh - Developer - GitHub

NeuroTwin: Transforming Neurological Care with Digital Brain Twins

Made with โค๏ธ by the NeuroTwin Team

About

SPIT Hackathon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •