Skip to content

LTPratham/neurostride

Repository files navigation

NeuroStride

🧠 NeuroStride

AI-Powered Neurorehabilitation Platform

Empowering stroke & neurological disorder recovery through real-time EMG/EEG biofeedback, LLM-driven clinical intelligence, and an integrated pharmacy management system.


πŸ“‹ Table of Contents


🌟 Overview

NeuroStride is an end-to-end neurorehabilitation platform built for stroke survivors, patients with cerebral palsy, traumatic brain injuries, and other neurological conditions. It bridges clinical care with cutting-edge AI and biosignal hardware to deliver personalized, data-driven recovery journeys.

The platform connects three roles β€” Doctor, Patient, and Pharmacist β€” in a unified ecosystem, backed by a real-time EMG/EEG biosignal pipeline from the Neuphony EXG Synapse board and LLM-powered intelligence via Groq.

πŸ† Built for LPU Ideathon 2026 β€” demonstrating how AI can transform neurological rehabilitation in India.


✨ Key Features

🩺 Doctor Portal

  • View and manage all assigned patients
  • Create personalized exercise plans with repetitions, sets, and goals
  • Write digital prescriptions that auto-sync to the pharmacy system
  • Review and approve AI-generated progress reports with one click
  • Download clinical reports as formatted Word documents

πŸ§‘β€πŸ¦½ Patient Portal

  • Live Sensor Feed β€” Real-time EMG waveform visualization with intent detection
  • Guided Exercise Sessions β€” Start/end sessions with automatic metric logging
  • AI Chatbot β€” Multilingual rehab assistant (English, Hindi) powered by Groq LLM
  • Progress Dashboard β€” Recharts-based analytics of rehab trends and milestones
  • Prescription History β€” Track medications and pharmacy order status

πŸ’Š Pharmacist Portal (PharmaMind)

  • Auto-receives orders from doctor prescriptions
  • Inventory management with low-stock alerts
  • Process and dispense orders with status tracking
  • Generate itemized tax invoices (PDF/DOCX) with GST calculation

πŸ”Œ Hardware Integration

  • Neuphony EXG Synapse (ESP32) β€” Reads raw EMG/EEG/ECG signals via USB serial
  • Python-side IIR Filters β€” Mirror of Synapse.h filter coefficients for offline processing
  • FFT Band Analyser β€” Delta / Theta / Alpha / Beta / Gamma power in real-time
  • Servo Arm Control β€” Intent-triggered robotic hand (for assistive therapy)
  • WebSocket Bridge β€” Streams sensor data to the frontend at 20 fps
  • Simulation Mode β€” Realistic synthetic EMG signal for demos without hardware

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         NeuroStride                             β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Next.js 14  │────▢│   FastAPI Core  │────│  SQLite /    β”‚  β”‚
β”‚  β”‚  Frontend    │◀────│   (Port 8000)   β”‚    β”‚  PostgreSQL  β”‚  β”‚
β”‚  β”‚  (Port 3000) β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚                                β”‚
β”‚                          β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”                        β”‚
β”‚                     β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”                   β”‚
β”‚                     β”‚  Groq  β”‚   β”‚Langfuse β”‚                   β”‚
β”‚                     β”‚  LLM   β”‚   β”‚Observ.  β”‚                   β”‚
β”‚                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Hardware Layer (Optional)                              β”‚   β”‚
β”‚  β”‚  Neuphony EXG ──serial──▢ neuphony_bridge.py            β”‚   β”‚
β”‚  β”‚     (ESP32)               WebSocket :8765 ──▢ Frontend  β”‚   β”‚
β”‚  β”‚                           Servo Controller ──▢ Arm       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Layer Technology
Backend Python 3.11, FastAPI, SQLAlchemy, SQLite/PostgreSQL
Auth JWT (python-jose), Passlib/bcrypt
AI Groq (Llama 3.3 / Mixtral), Langfuse observability
Frontend Next.js 14, React 18, Recharts, Axios
Hardware Neuphony EXG Synapse (ESP32), PySerial, WebSockets
Docs python-docx (DOCX report & invoice generation)
Deploy Render (backend), Vercel (frontend)

πŸš€ Getting Started

Prerequisites

Tool Version Download
Python 3.11+ python.org
Node.js 20+ nodejs.org
Git any git-scm.com

Backend Setup

# 1. Clone the repo
git clone https://github.com/LTPratham/neurostride.git
cd neurostride

# 2. Create a virtual environment
cd backend
python -m venv venv
.\venv\Scripts\activate          # Windows
# source venv/bin/activate       # Linux / macOS

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure environment variables
copy .env.example .env           # Windows
# cp .env.example .env           # Linux / macOS
# β†’ Edit .env and fill in your GROQ_API_KEY, SECRET_KEY, etc.

# 5. Seed demo data (first run only)
python seed_data.py

# 6. Start the API server
uvicorn main:app --reload --port 8000

API is running at: http://localhost:8000
Swagger docs: http://localhost:8000/docs


Frontend Setup

# In a new terminal
cd neurostride/frontend
npm install
npm run dev

Frontend at: http://localhost:3000


Hardware Setup (Optional)

Skip this if you want to run in simulation mode β€” the platform works fully without physical hardware.

1. Flash the Arduino Sketch

  1. Download Arduino IDE
  2. Clone the Neuphony EXG Synapse repo
  3. Open EXG-Synapse/src/EMG/serial/EMG_serial.ino
  4. Select Board: ESP32 Dev Module
  5. Select Port: your COM port (check Device Manager β†’ Ports)
  6. Upload the sketch
  7. Verify in Serial Monitor at 115200 baud β€” you should see numbers streaming

2. Start the Hardware Bridge

cd neurostride/hardware

# With real hardware:
python neuphony_bridge.py --port COM3 --servo COM4

# Without hardware (simulation mode):
python neuphony_bridge.py --simulate

# Auto-detect port:
python neuphony_bridge.py

Sensor WebSocket: ws://localhost:8765


πŸ“‘ API Reference

Endpoint Method Description
/api/auth/register POST Register a new user
/api/auth/login POST Login and receive JWT
/api/auth/me GET Get current user info
/api/patients GET List all patients (Doctor/Pharmacist)
/api/patients/{id} GET/PUT Get or update patient profile
/api/sessions POST Start a rehab session
/api/sessions/{id}/end PUT End session with metrics
/api/exercise-plans POST Create exercise plan (Doctor)
/api/prescriptions POST Create prescription (Doctor)
/api/pharmacy/orders GET List pharmacy orders
/api/pharmacy/inventory GET Get medicine inventory
/api/reports/patient/{id} GET Get progress reports
/api/reports/{id}/download GET Download report as DOCX
/ws/sensor/{patient_id} WS Live sensor data stream

Full interactive documentation: http://localhost:8000/docs


πŸ‘₯ User Roles & Test Credentials

After running python seed_data.py:

Role Email Password
Doctor dr.sharma@neurostride.in doctor123
Pharmacist pharmacy@neurostride.in pharmacy123
Patient 1 ravi@neurostride.in patient123
Patient 2 sunita@neurostride.in patient123
Patient 3 arjun@neurostride.in patient123

πŸ”­ Future Scope

NeuroStride is built with extensibility at its core. Here's the roadmap for what comes next:

πŸ€– AI & Intelligence

  • Adaptive Exercise Plans β€” LLM automatically adjusts difficulty based on session performance trends
  • Predictive Recovery Timelines β€” ML model trained on session data to forecast recovery milestones
  • Anomaly Detection β€” Alert doctors when EMG/EEG patterns deviate significantly from baseline
  • Voice-Controlled Interface β€” Hands-free navigation for patients with limited motor function
  • Multi-modal AI β€” Integrate computer vision (MediaPipe pose estimation) alongside EMG for form scoring

πŸ“± Mobile & Accessibility

  • React Native App β€” Cross-platform mobile app for patients to log sessions remotely
  • Offline Mode β€” PWA support so patients can use the app without internet
  • Multilingual Expansion β€” Add Tamil, Telugu, Bengali, Marathi support to the AI assistant
  • Accessibility Audit β€” WCAG 2.1 AA compliance for visually impaired users

πŸ”Œ Hardware & Biosignals

  • Multi-Channel EEG Support β€” Upgrade to 8-channel EXG board for full brain mapping
  • Wireless Streaming β€” ESP32 Wi-Fi/BLE mode to eliminate USB cable dependency
  • 3D-Printed Exoskeleton β€” Full-hand exoskeleton with individual finger servo control
  • Wearable Form Factor β€” Miniaturized PCB that attaches to the patient's forearm
  • ECG Monitoring β€” Heart rate variability (HRV) tracking during rehab sessions

πŸ₯ Clinical & Compliance

  • ABDM Integration β€” Link with India's Ayushman Bharat Digital Mission for health ID interoperability
  • HIPAA / DPDPA Compliance β€” Encrypt PHI at rest, audit logs, data retention policies
  • Telemedicine Module β€” In-platform video consultation between doctor and patient
  • HL7 FHIR Export β€” Standardized health data export for interoperability with hospital systems
  • Clinical Trial Dashboard β€” Aggregate de-identified data for research and outcome studies

⚑ Platform & DevOps

  • Kubernetes Deployment β€” Helm chart for production-grade scaling on GKE/EKS
  • CI/CD Pipeline β€” GitHub Actions for automated testing, linting, and deployment
  • Real-time Notifications β€” WebPush notifications for prescription updates and session reminders
  • Multi-tenant SaaS β€” Support multiple hospitals with isolated data namespaces
  • Analytics Dashboard β€” Aggregated, anonymized population-level rehab outcomes

πŸ“œ Patent

NeuroStride's core technology β€” including its real-time EMG/EEG biofeedback pipeline and AI-assisted neurorehabilitation methodology β€” is protected by a published patent.

Field Details
Inventor Prathmesh (LTPratham)
Status Published
Document docs/NeuroStride_Patent_Published.pdf

The full patent document is available in the docs/ folder of this repository.


🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines on branching, commit conventions, and the PR process.


πŸ”’ Security

Please review our SECURITY.md before reporting vulnerabilities. Do not open public issues for security bugs.


πŸ‘¨β€πŸ’» Contributors

Prathmesh
Prathmesh

Founder Β· Full-Stack Β· AI Β· Hardware
Bhavya Verma
Bhavya Verma

Co-Developer Β· Contributor

See CONTRIBUTORS.md for the full list.


πŸ“„ License

This project is licensed under the MIT License.


Built with ❀️ at LPU Ideathon 2026
"Restoring movement. Restoring life."

About

NeuroStride is an AI-powered neurorehabilitation platform combining BCI-based robotic control, real-time exercise coaching, clinical AI assistance, multilingual voice support, and smart pharmacy integration to make neurological recovery accessible from home.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors