# NeuroCodex - Parkison, Demntia, Depresiion, Alzheimer Detection Platform
A web application for early Parkison, Demntia, Depresiion, Alzheimer detection using cognitive assessment games and AI-powered risk prediction.
- 7 Cognitive Assessment Games: Trail Making, Spiral, Word Recall, Pattern Replication, Verbal Fluency, Stroop, and Go/No-Go tests
- AI-Powered Risk Prediction: Uses trained Alzheimer model for risk assessment
- Modern UI/UX: Futuristic health-tech theme with dark mode and neon accents
- Comprehensive Reporting: Detailed PDF reports with recommendations
- Admin Dashboard: Monitor users and system performance
- Responsive Design: Works on desktop and mobile devices
- FastAPI: Modern Python web framework
- Machine Learning: Pre-trained Alzheimer detection model
- Authentication: JWT-based auth system
- Data Storage: In-memory storage (hackathon-ready)
- React.js: Modern React with hooks
- Tailwind CSS: Utility-first CSS framework
- Framer Motion: Smooth animations
- Lucide React: Beautiful icons
diseases/
├── backend/
│ ├── main.py # FastAPI application
│ ├── requirements.txt # Python dependencies
│ └── wsgi.py # WSGI configuration
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── games/ # Cognitive test games
│ │ │ ├── Navbar.js # Navigation component
│ │ │ └── ProtectedRoute.js
│ │ ├── contexts/ # React contexts
│ │ │ └── AuthContext.js # Authentication context
│ │ ├── pages/ # Main pages
│ │ │ ├── Login.js # Login page
│ │ │ ├── Signup.js # Signup page
│ │ │ ├── Dashboard.js # Main dashboard
│ │ │ ├── Questionnaire.js # Health questionnaire
│ │ │ ├── Games.js # Cognitive tests
│ │ │ ├── Report.js # Results report
│ │ │ └── AdminDashboard.js # Admin panel
│ │ ├── App.js # Main app component
│ │ ├── index.js # React entry point
│ │ └── index.css # Global styles
│ ├── public/
│ │ └── index.html # HTML template
│ ├── package.json # Node.js dependencies
│ ├── tailwind.config.js # Tailwind configuration
│ └── postcss.config.js # PostCSS configuration
├── model_training/
│ ├── saved_models/
│ │ ├── alz_model.pkl # Trained Alzheimer model
│ │ └── feature_names.pkl # Model feature names
│ └── scripts/ # Training scripts
└── README.md # This file
- Measures: Cognitive flexibility and processing speed
- Task: Click numbers in sequential order (1-25)
- Scoring: Based on time and accuracy
- Measures: Motor control and tremors
- Task: Draw a smooth spiral following a guide
- Scoring: Based on smoothness and accuracy
- Measures: Short-term memory
- Task: Memorize and recall words
- Scoring: Based on number of correctly recalled words
- Measures: Visuospatial reasoning
- Task: Recreate colored block patterns
- Scoring: Based on accuracy and speed
- Measures: Semantic memory and executive function
- Task: Generate words from categories
- Scoring: Based on number of unique words
- Measures: Attention and inhibitory control
- Task: Identify ink colors while ignoring word meanings
- Scoring: Based on accuracy and reaction time
- Measures: Sustained attention and response inhibition
- Task: Respond to "Go" signals, ignore "No-Go" signals
- Scoring: Based on accuracy and impulse control
- Python 3.8+ (Download from python.org)
- Node.js 16+ (Download from nodejs.org)
- Git (Download from git-scm.com)
# Clone the repository
git clone <repository-url>
cd diseases
# Verify the project structure
ls
# You should see: backend/, frontend/, model_training/, README.md# Navigate to backend directory
cd backend
# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# if u see error in creating venv environment then
🔧 Fix Steps:
1. Remove the broken venv
rmdir /s /q venv
(or just delete the venv folder manually inside backend).
2. Create a fresh venv in the current project
python -m venv venv
3. Activate the new venv
.\venv\Scripts\activate
You should see (venv) again in your terminal.
4. Install requirements
python.exe -m pip install --upgrade pip
pip install -r requirements.txt
# Install Python dependencies
pip install -r requirements.txt
# if numpy_core error comes
pip install --upgrade --force-reinstall numpy==1.26.4
# Start the FastAPI server
python main.pyExpected Output:
SUCCESS: FastAPI server starting...
INFO: Started server process [PID]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
✅ Backend is running at: http://localhost:8000
📚 API Documentation: http://localhost:8000/docs
Open a NEW terminal window (keep backend running):
# Navigate to frontend directory
cd frontend
# Install Node.js dependencies
npm install
# Start the React development server
npm startExpected Output:
Compiled successfully!
You can now view alzheimer-detection-frontend in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.x.x:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
✅ Frontend is running at: http://localhost:3000
✅ alzheimer is running at: http://localhost:3000/alzheimer
✅ depression is running at: http://localhost:3000/depression
✅ dementia is running at: http://localhost:3000/dementia
✅ chatbot is running at: http://localhost:3000/chatbot
- Open your browser and go to
http://localhost:3000 - Sign up for a new account or login with existing credentials
- Complete the health questionnaire
- Take the 7 cognitive assessment games
- View your personalized risk assessment report
# If port 8000 is busy:
# Kill existing processes
taskkill /f /im python.exe # Windows
# or
pkill -f python # macOS/Linux
# If dependencies fail to install:
pip install --upgrade pip
pip install -r requirements.txt --force-reinstall# If port 3000 is busy:
# Kill existing processes
taskkill /f /im node.exe # Windows
# or
pkill -f node # macOS/Linux
# If npm install fails:
npm cache clean --force
npm install
# If React fails to start:
rm -rf node_modules package-lock.json
npm install
npm startIf you encounter NumPy compatibility issues with the original model:
- The app uses
main_simple.pywhich has a simplified prediction algorithm - This ensures the app works without model loading issues
- All features remain fully functional
cd backend
python main_simple.py # Start server
python -m uvicorn main:app --reload # Alternative start methodcd frontend
npm start # Start development server
npm run build # Create production build
npm test # Run tests
npm run eject # Eject from Create React AppThe app is fully responsive and works on mobile devices:
- Start both backend and frontend
- Find your computer's IP address
- Access
http://YOUR_IP:3000from mobile device - Test the cognitive games on touch devices
POST /auth/signup- User registrationPOST /auth/login- User login
POST /questionnaire- Submit health questionnairePOST /games/score- Submit cognitive test scoresPOST /predict- Get AI risk predictionGET /report/{prediction_id}- Get assessment reportGET /report/{prediction_id}/pdf- Download PDF report
GET /admin/users- Get all usersGET /admin/reports- Get all reportsGET /admin/stats- Get system statistics
- Sign Up/Login: Create account or sign in
- Health Questionnaire: Complete demographic and health questions
- Cognitive Tests: Take 7 interactive cognitive assessment games
- AI Prediction: Get personalized risk assessment
- Report Generation: View detailed results and recommendations
The Alzheimer detection model is trained on:
- Features: Age, MMSE score, Memory complaints
- Algorithm: Logistic Regression
- Accuracy: 74.42% on test set
- Output: Risk probability (0-100%)
- Dark Theme: Futuristic health-tech aesthetic
- Neon Accents: Blue, green, purple color scheme
- Smooth Animations: Framer Motion for transitions
- Responsive Design: Works on all screen sizes
- Accessibility: Keyboard navigation and screen reader support
- User Management: View all registered users
- Report Analytics: Monitor assessment results
- Risk Distribution: Visualize risk level statistics
- Export Features: Download reports and data
- JWT Authentication: Secure token-based auth
- Input Validation: Pydantic models for data validation
- CORS Protection: Configured for frontend communication
- Error Handling: Comprehensive error management
The application is designed for easy deployment:
- Backend: Can be deployed on any Python hosting service
- Frontend: Can be deployed on Vercel, Netlify, or similar
- Database: Currently uses in-memory storage (easily upgradeable)
This is a hackathon project designed for rapid development and demonstration. For production use, consider:
- Adding a real database (PostgreSQL, MongoDB)
- Implementing proper user roles and permissions
- Adding more comprehensive error handling
- Implementing data encryption
- Adding unit tests
This project is created for hackathon purposes. Please ensure compliance with healthcare data regulations if used in production.
For questions or issues:
- Check the console for error messages
- Ensure both backend and frontend are running
- Verify all dependencies are installed
- Check network connectivity between frontend and backend
# NeuroCodex - Alzheimer Detection Platform
A hackathon-ready web application for early Alzheimer detection using cognitive assessment games and AI-powered risk prediction.
- 7 Cognitive Assessment Games: Trail Making, Spiral, Word Recall, Pattern Replication, Verbal Fluency, Stroop, and Go/No-Go tests
- AI-Powered Risk Prediction: Uses trained Alzheimer model for risk assessment
- Modern UI/UX: Futuristic health-tech theme with dark mode and neon accents
- Comprehensive Reporting: Detailed PDF reports with recommendations
- Admin Dashboard: Monitor users and system performance
- Responsive Design: Works on desktop and mobile devices
- FastAPI: Modern Python web framework
- Machine Learning: Pre-trained Alzheimer detection model
- Authentication: JWT-based auth system
- Data Storage: In-memory storage (hackathon-ready)
- React.js: Modern React with hooks
- Tailwind CSS: Utility-first CSS framework
- Framer Motion: Smooth animations
- Lucide React: Beautiful icons
diseases/
├── backend/
│ ├── main.py # FastAPI application
│ ├── requirements.txt # Python dependencies
│ └── wsgi.py # WSGI configuration
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── games/ # Cognitive test games
│ │ │ ├── Navbar.js # Navigation component
│ │ │ └── ProtectedRoute.js
│ │ ├── contexts/ # React contexts
│ │ │ └── AuthContext.js # Authentication context
│ │ ├── pages/ # Main pages
│ │ │ ├── Login.js # Login page
│ │ │ ├── Signup.js # Signup page
│ │ │ ├── Dashboard.js # Main dashboard
│ │ │ ├── Questionnaire.js # Health questionnaire
│ │ │ ├── Games.js # Cognitive tests
│ │ │ ├── Report.js # Results report
│ │ │ └── AdminDashboard.js # Admin panel
│ │ ├── App.js # Main app component
│ │ ├── index.js # React entry point
│ │ └── index.css # Global styles
│ ├── public/
│ │ └── index.html # HTML template
│ ├── package.json # Node.js dependencies
│ ├── tailwind.config.js # Tailwind configuration
│ └── postcss.config.js # PostCSS configuration
├── model_training/
│ ├── saved_models/
│ │ ├── alz_model.pkl # Trained Alzheimer model
│ │ └── feature_names.pkl # Model feature names
│ └── scripts/ # Training scripts
└── README.md # This file
- Measures: Cognitive flexibility and processing speed
- Task: Click numbers in sequential order (1-25)
- Scoring: Based on time and accuracy
- Measures: Motor control and tremors
- Task: Draw a smooth spiral following a guide
- Scoring: Based on smoothness and accuracy
- Measures: Short-term memory
- Task: Memorize and recall words
- Scoring: Based on number of correctly recalled words
- Measures: Visuospatial reasoning
- Task: Recreate colored block patterns
- Scoring: Based on accuracy and speed
- Measures: Semantic memory and executive function
- Task: Generate words from categories
- Scoring: Based on number of unique words
- Measures: Attention and inhibitory control
- Task: Identify ink colors while ignoring word meanings
- Scoring: Based on accuracy and reaction time
- Measures: Sustained attention and response inhibition
- Task: Respond to "Go" signals, ignore "No-Go" signals
- Scoring: Based on accuracy and impulse control
- Python 3.8+ (Download from python.org)
- Node.js 16+ (Download from nodejs.org)
- Git (Download from git-scm.com)
# Clone the repository
git clone <repository-url>
cd diseases
# Verify the project structure
ls
# You should see: backend/, frontend/, model_training/, README.md# Navigate to backend directory
cd backend
# Create virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# if u see error in creating venv environment then
🔧 Fix Steps:
1. Remove the broken venv
rmdir /s /q venv
(or just delete the venv folder manually inside backend).
2. Create a fresh venv in the current project
python -m venv venv
3. Activate the new venv
.\venv\Scripts\activate
You should see (venv) again in your terminal.
4. Install requirements
pip install --upgrade pip
pip install -r requirements.txt
# Install Python dependencies
pip install -r requirements.txt
# Start the FastAPI server
python main_simple.pyExpected Output:
SUCCESS: FastAPI server starting...
INFO: Started server process [PID]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
✅ Backend is running at: http://localhost:8000
📚 API Documentation: http://localhost:8000/docs
Open a NEW terminal window (keep backend running):
# Navigate to frontend directory
cd frontend
# Install Node.js dependencies
npm install
# Start the React development server
npm startExpected Output:
Compiled successfully!
You can now view alzheimer-detection-frontend in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.x.x:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
✅ Frontend is running at: http://localhost:3000
- Open your browser and go to
http://localhost:3000 - Sign up for a new account or login with existing credentials
- Complete the health questionnaire
- Take the 7 cognitive assessment games
- View your personalized risk assessment report
# If port 8000 is busy:
# Kill existing processes
taskkill /f /im python.exe # Windows
# or
pkill -f python # macOS/Linux
# If dependencies fail to install:
pip install --upgrade pip
pip install -r requirements.txt --force-reinstall# If port 3000 is busy:
# Kill existing processes
taskkill /f /im node.exe # Windows
# or
pkill -f node # macOS/Linux
# If npm install fails:
npm cache clean --force
npm install
# If React fails to start:
rm -rf node_modules package-lock.json
npm install
npm startIf you encounter NumPy compatibility issues with the original model:
- The app uses
main_simple.pywhich has a simplified prediction algorithm - This ensures the app works without model loading issues
- All features remain fully functional
cd backend
python main_simple.py # Start server
python -m uvicorn main:app --reload # Alternative start methodcd frontend
npm start # Start development server
npm run build # Create production build
npm test # Run tests
npm run eject # Eject from Create React AppThe app is fully responsive and works on mobile devices:
- Start both backend and frontend
- Find your computer's IP address
- Access
http://YOUR_IP:3000from mobile device - Test the cognitive games on touch devices
POST /auth/signup- User registrationPOST /auth/login- User login
POST /questionnaire- Submit health questionnairePOST /games/score- Submit cognitive test scoresPOST /predict- Get AI risk predictionGET /report/{prediction_id}- Get assessment reportGET /report/{prediction_id}/pdf- Download PDF report
GET /admin/users- Get all usersGET /admin/reports- Get all reportsGET /admin/stats- Get system statistics
- Sign Up/Login: Create account or sign in
- Health Questionnaire: Complete demographic and health questions
- Cognitive Tests: Take 7 interactive cognitive assessment games
- AI Prediction: Get personalized risk assessment
- Report Generation: View detailed results and recommendations
The Alzheimer detection model is trained on:
- Features: Age, MMSE score, Memory complaints
- Algorithm: Logistic Regression
- Accuracy: 74.42% on test set
- Output: Risk probability (0-100%)
- Dark Theme: Futuristic health-tech aesthetic
- Neon Accents: Blue, green, purple color scheme
- Smooth Animations: Framer Motion for transitions
- Responsive Design: Works on all screen sizes
- Accessibility: Keyboard navigation and screen reader support
- User Management: View all registered users
- Report Analytics: Monitor assessment results
- Risk Distribution: Visualize risk level statistics
- Export Features: Download reports and data
- JWT Authentication: Secure token-based auth
- Input Validation: Pydantic models for data validation
- CORS Protection: Configured for frontend communication
- Error Handling: Comprehensive error management
The application is designed for easy deployment:
- Backend: Can be deployed on any Python hosting service
- Frontend: Can be deployed on Vercel, Netlify, or similar
- Database: Currently uses in-memory storage (easily upgradeable)
This is a hackathon project designed for rapid development and demonstration. For production use, consider:
- Adding a real database (PostgreSQL, MongoDB)
- Implementing proper user roles and permissions
- Adding more comprehensive error handling
- Implementing data encryption
- Adding unit tests
This project is created for hackathon purposes. Please ensure compliance with healthcare data regulations if used in production.
For questions or issues:
- Check the console for error messages
- Ensure both backend and frontend are running
- Verify all dependencies are installed
- Check network connectivity between frontend and backend
Built with ❤️ for cognitive health awareness