An Educational Platform with Therapeutic Games for Children with Down Syndrome
TheraLearn is a comprehensive web application designed to support the cognitive development and learning of children with Down syndrome through interactive games, therapy activities, and educational content. The platform combines modern web technologies with evidence-based therapeutic approaches to create an engaging and supportive learning environment.
- Provide specialized therapeutic games tailored for children with Down syndrome
- Support cognitive development through interactive learning activities
- Facilitate communication between patients, families, and psychologists
- Offer educational resources and blog content about mental health and development
- Children with Down Syndrome: Primary users engaging with therapeutic games and activities
- Parents & Caregivers: Monitoring progress and supporting their children's development
- Psychologists & Therapists: Managing patients, creating content, and tracking progress
- Educators: Accessing specialized educational resources and tools
- Frontend: Runs on
http://localhost:3000
after setup - Backend API: Available at
http://localhost:5000/api
- Database: MongoDB connection required for full functionality
- Landing Page: Welcome screen with platform introduction
- Game Selection: Interactive game library with difficulty levels
- Progress Dashboard: Analytics and achievement tracking
- Therapist Portal: Patient management and progress monitoring
- Blog Section: Educational content and resources
Regular User:
- Email: user@example.com
- Password: password123
Psychologist:
- Email: drsmith@example.com
- Password: password123
Super Admin:
- Email: admin@example.com
- Password: admin123
TheraLearn follows a modern full-stack architecture:
┌─────────────────────────────────────────────────────────────┐
│ Frontend (React) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐│
│ │ Landing Page │ │ Therapeutic │ │ Dashboard & ││
│ │ & Auth │ │ Games │ │ Admin Panel ││
│ └─────────────────┘ └─────────────────┘ └─────────────────┘│
└─────────────────────────────────────────────────────────────┘
│
│ API Calls
▼
┌─────────────────────────────────────────────────────────────┐
│ Backend (Node.js/Express) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐│
│ │ Auth & │ │ Game Logic │ │ Blog & ││
│ │ User Mgmt │ │ & Progress │ │ Content Mgmt ││
│ └─────────────────┘ └─────────────────┘ └─────────────────┘│
└─────────────────────────────────────────────────────────────┘
│
│ Database Operations
▼
┌─────────────────────────────────────────────────────────────┐
│ MongoDB Database │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐│
│ │ Users & │ │ Games & │ │ Blogs & ││
│ │ Profiles │ │ Results │ │ Content ││
│ └─────────────────┘ └─────────────────┘ └─────────────────┘│
└─────────────────────────────────────────────────────────────┘
- Magic Memory: Memory matching game to improve cognitive recall
- Better Aim: Hand-eye coordination and motor skills development
- Math Game: Number recognition and basic arithmetic skills
- Count the Fish: Counting and number recognition activities
- Match Figures: Shape and pattern recognition
- Endless Runner: Reaction time and continuous attention training
- Object Guessing Game: Speech recognition-based naming activities
- Number Guessing Game: Counting and number recognition with voice interaction
- Emotion Detection: Facial emotion recognition for emotional intelligence
- Handpose Detector: Hand gesture recognition for motor skills
- User Management: Multi-role system (patients, psychologists, super admins)
- Progress Tracking: Detailed analytics on game performance and development
- Blog System: Educational content and mental health resources
- Patient-Psychologist Interaction: Secure communication and session management
- Content Management: Dynamic content updates and customization
- Dashboard Analytics: Comprehensive reporting and progress visualization
- Patient/Child: Access to age-appropriate games and activities
- Parent/Guardian: Monitor child's progress and communication with therapists
- Psychologist: Manage patients, create content, track therapeutic progress
- Super Admin: Full system administration, user management, content oversight
- Node.js (v16 or higher) - Tested with v20.19.5
- npm (v8 or higher) - Tested with v10.8.2
- MongoDB (local installation or cloud atlas)
- Git for version control
-
Clone the Repository
git clone https://github.com/chmuhammadasim/TheraLearn.git cd TheraLearn
-
Install Dependencies
# Install root dependencies npm install # Install frontend dependencies cd frontend npm install # Install backend dependencies cd ../backend npm install
-
Environment Configuration
Create a
.env
file in thebackend
directory:THERALEARN_DB_URL=mongodb://127.0.0.1:27017/theraLearn PORT_URL=5000 JWT_KEY=your_jwt_secret_key EMAIL_USER=your_email@gmail.com EMAIL_PASSWORD=your_email_password
-
Database Setup
# Start MongoDB service (if running locally) mongod # Seed the database with sample data (recommended for development) cd backend node Seed/Seed.js # Main seed data (users, games, psychologists) node Seed/BlogSeed.js # Blog posts and articles node Seed/ContentSeed.js # Landing page content
-
Start the Application
# From the root directory npm start # Or start frontend and backend separately # Frontend (http://localhost:3000) cd frontend && npm start # Backend (http://localhost:5000) cd backend && npm start
- React 18.3.1: Modern UI library for component-based development
- React Router 6.26.0: Client-side routing and navigation
- Tailwind CSS: Utility-first CSS framework for responsive design
- Material Tailwind: Pre-built components for enhanced UI
- Chart.js: Data visualization for progress tracking
- Axios: HTTP client for API communication
- TensorFlow.js: Machine learning for handpose and emotion detection
- React Speech Recognition: Voice interaction capabilities
- Canvas Confetti: Celebration animations for achievements
- Node.js: JavaScript runtime environment
- Express.js: Web application framework
- MongoDB: NoSQL database for flexible data storage
- Mongoose: ODM for MongoDB with schema validation
- JWT: JSON Web Tokens for secure authentication
- Bcrypt: Password hashing for security
- Helmet: Security middleware for Express
- CORS: Cross-origin resource sharing
- Express Rate Limit: API rate limiting for protection
- Nodemailer: Email sending functionality
- Nodemon: Auto-restart development server
- Concurrently: Run multiple npm scripts simultaneously
- ESLint: Code linting and style enforcement
- Jest: Testing framework (configured)
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logoutGET /api/auth/verify
- Token verification
GET /api/user/profile
- Get user profilePUT /api/user/profile
- Update user profileGET /api/user/progress
- Get user progress data
POST /api/game/save-score
- Save game score and progressGET /api/game/history/:userId
- Get user's game historyGET /api/game/leaderboard
- Get game leaderboards
GET /api/blog/posts
- Get all blog postsPOST /api/blog/create
- Create new blog post (psychologist/admin)GET /api/content/landing
- Get landing page content
GET /api/psychologist/patients
- Get assigned patientsPOST /api/psychologist/question
- Create therapy questionsGET /api/psychologistpatient/messages
- Get patient messages
GET /api/superadmin/users
- Get all usersPUT /api/superadmin/user/:id
- Update user informationDELETE /api/superadmin/user/:id
- Delete user account
{
username: String,
email: String,
password: String (hashed),
role: ['user', 'psychologist', 'superadmin'],
firstName: String,
lastName: String,
dateOfBirth: Date,
profilePicture: String,
isActive: Boolean,
createdAt: Date
}
{
userId: ObjectId,
sessions: [{
gameName: String,
level: Number,
score: Number,
duration: Number,
datePlayed: Date
}],
overallResults: {
highestScore: Number,
totalAttempts: Number,
totalScore: Number
}
}
{
title: String,
slug: String,
content: String,
author: ObjectId,
category: String,
tags: [String],
publishedAt: Date,
isPublished: Boolean,
likes: Number,
viewCount: Number
}
npm start # Start both frontend and backend concurrently
npm test # Run tests for both frontend and backend
npm start # Start development server (port 3000)
npm build # Build for production
npm test # Run React tests
npm eject # Eject from Create React App (irreversible)
npm start # Start server with nodemon (port 5000)
npm test # Run Jest tests
-
Port Already in Use
Error: listen EADDRINUSE: address already in use :::3000
Solution: Kill the process using the port or change the port
# Kill process on port 3000 npx kill-port 3000 # Or start frontend on different port PORT=3001 npm start
-
Database Connection Error
MongooseError: Operation `users.findOne()` buffering timed out
Solution:
- Ensure MongoDB is running locally:
mongod
- Check your connection string in
.env
- For cloud MongoDB, verify network access settings
- Ensure MongoDB is running locally:
-
Module Not Found Errors
Module not found: Can't resolve 'xyz'
Solution: Reinstall dependencies
rm -rf node_modules package-lock.json npm install
-
Build Fails with Memory Issues
FATAL ERROR: Ineffective mark-compacts near heap limit
Solution: Increase Node.js memory limit
export NODE_OPTIONS="--max-old-space-size=4096" npm run build
-
CORS Issues in Development
Access to fetch blocked by CORS policy
Solution: The backend already includes CORS middleware, but ensure your frontend is making requests to the correct backend URL.
- Development: Use
npm start
from root directory to run both servers concurrently - Production: Build frontend with
npm run build
and serve static files through Express - Database: Use MongoDB Atlas for production deployments
- Caching: Enable browser caching for better performance
- Code Style: The project uses ESLint for consistent code formatting
- Git Workflow: Create feature branches from main, submit PRs for review
- Testing: Write tests for new features and bug fixes
- Database: Use local MongoDB for development, cloud for production
- Create game component in
frontend/src/pages/Game/Games/
- Add route in
frontend/src/App.js
- Implement game logic with score tracking
- Create API endpoint for saving scores in backend
- Update game selection page
We welcome contributions from the community! Here's how you can help:
- Bug Fixes: Report or fix issues in the code
- New Games: Add therapeutic games for children
- UI/UX Improvements: Enhance user experience
- Documentation: Improve or translate documentation
- Testing: Add tests or improve test coverage
- Accessibility: Make the platform more accessible
-
Fork & Clone
git clone https://github.com/yourusername/TheraLearn.git cd TheraLearn
-
Setup Development Environment
npm install cd frontend && npm install cd ../backend && npm install
-
Create Feature Branch
git checkout -b feature/your-feature-name
-
Development Guidelines
- Follow existing code style and conventions
- Write meaningful commit messages
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation if needed
-
Testing
# Run all tests npm test # Run frontend tests only cd frontend && npm test # Run backend tests only cd backend && npm test
-
Submit Pull Request
- Provide clear description of changes
- Include screenshots for UI changes
- Reference any related issues
- Ensure CI tests pass
- JavaScript: Follow ESLint configuration
- React: Use functional components with hooks
- CSS: Use Tailwind CSS utility classes
- API: Follow RESTful conventions
- Database: Use Mongoose schemas with validation
When reporting bugs, please include:
- Steps to reproduce the issue
- Expected vs actual behavior
- Browser/environment information
- Screenshots if applicable
- Error logs or console messages
- JWT Authentication: Secure token-based authentication
- Password Hashing: Bcrypt for password security
- Rate Limiting: Protection against brute force attacks
- HELMET: Security headers for Express
- XSS Protection: Cross-site scripting prevention
- Input Sanitization: MongoDB injection prevention
- CORS: Cross-origin resource sharing control
- Code Splitting: React lazy loading for better performance
- Image Optimization: Cloudinary integration for image management
- Caching: Browser caching for static assets
- Compression: Gzip compression for reduced bundle size
- Database Indexing: Optimized MongoDB queries
Create .env
files for different environments:
Backend (.env)
# Database
THERALEARN_DB_URL=mongodb://127.0.0.1:27017/theraLearn # Local
# THERALEARN_DB_URL=mongodb+srv://user:pass@cluster.mongodb.net/theraLearn # Cloud
# Server Configuration
PORT_URL=5000
NODE_ENV=production
# Authentication
JWT_KEY=your_super_secret_jwt_key_here
# Email Configuration (for notifications)
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
# Optional: Test Database
THERALEARN_DB_URL_TEST=mongodb://127.0.0.1:27017/theraLearnTest
Frontend (.env) - Optional
REACT_APP_API_URL=http://localhost:5000/api
REACT_APP_ENV=development
-
Build for Production
cd frontend npm run build
-
Deploy to Static Hosting
- Netlify: Connect GitHub repo, set build command to
npm run build
, publish directory tobuild
- Vercel: Import project, framework preset: Create React App
- AWS S3: Upload build folder contents, configure as static website
- Netlify: Connect GitHub repo, set build command to
-
Environment Variables
REACT_APP_API_URL=https://your-backend-domain.com/api
-
Heroku Deployment
# Install Heroku CLI heroku create your-app-name heroku config:set THERALEARN_DB_URL=your_mongodb_atlas_url heroku config:set JWT_KEY=your_jwt_secret git push heroku main
-
Railway Deployment
# Connect GitHub repo to Railway # Set environment variables in Railway dashboard # Automatic deployment on push
-
VPS/Cloud Server
# Install Node.js and PM2 npm install -g pm2 # Start application with PM2 pm2 start app.js --name theralearn-backend pm2 startup pm2 save
- MongoDB Atlas: Cloud-hosted MongoDB service
- Local MongoDB: For development only
- Docker: Containerized MongoDB deployment
- Use HTTPS in production
- Set up proper CORS origins
- Configure rate limiting
- Enable MongoDB authentication
This project is licensed under the ISC License - see the LICENSE file for details.
Muhammad Asim Chattha
- Email: muhammadasimchattha@gmail.com
- GitHub: @chmuhammadasim
- Special thanks to the Down syndrome community for inspiration
- React and Node.js communities for excellent documentation
- TensorFlow.js team for machine learning capabilities
- All contributors who help make this project better
Q: What age group is TheraLearn designed for? A: TheraLearn is primarily designed for children with Down syndrome, typically ages 3-18, but can be adapted for various developmental levels.
Q: Do I need special hardware to run TheraLearn? A: No special hardware is required. The platform runs on standard computers, tablets, and smartphones with a web browser. Some games may benefit from a webcam for emotion detection or hand gesture features.
Q: Is TheraLearn free to use? A: The platform is open-source and free for educational and therapeutic use. Check the license for commercial usage terms.
Q: Can I use TheraLearn offline? A: Currently, TheraLearn requires an internet connection for full functionality. Offline mode is planned for future releases.
Q: What browsers are supported? A: TheraLearn works best on modern browsers including:
- Chrome (recommended)
- Firefox
- Safari
- Edge
Q: Can I customize the games for specific needs? A: Yes! The platform is designed to be customizable. Psychologists and therapists can adjust difficulty levels, and developers can create new games using the existing framework.
Q: How is user data protected? A: We implement industry-standard security measures including password hashing, JWT authentication, and secure database connections. No sensitive data is shared with third parties.
Q: Can I integrate TheraLearn with other therapy tools? A: The platform provides REST APIs that can be integrated with other systems. Contact us for specific integration requirements.
Q: How can I add a new therapeutic game? A: Follow these steps:
- Create a new component in
frontend/src/pages/Game/Games/
- Implement game logic with score tracking
- Add routing in
App.js
- Create backend API endpoints for score saving
- Test thoroughly and submit a pull request
Q: What's the database schema? A: The main collections include Users, Games, Blogs, Questions, and Results. See the "Database Models" section for detailed schemas.
Q: How do I set up a development environment? A: Follow the installation instructions in this README. You'll need Node.js, MongoDB, and Git installed on your system.
Q: How do I track a child's progress? A: Progress is automatically tracked through game scores, completion times, and difficulty levels. Parents and therapists can view detailed analytics in the dashboard.
Q: Can multiple children use the same account? A: We recommend creating separate accounts for each child to ensure accurate progress tracking and personalized experiences.
Q: What if my child has difficulty with certain games? A: All games have adjustable difficulty levels. Therapists can also provide guidance on which games are most suitable for individual needs.
Q: How often should children use TheraLearn? A: Usage recommendations should come from qualified therapists. Generally, short, frequent sessions (15-30 minutes) are more effective than long sessions.
- Mobile App: Native iOS and Android applications
- Offline Mode: Games and content available without internet
- Multi-language Support: Interface translation for global accessibility
- Advanced Analytics: AI-powered progress insights and recommendations
- Video Therapy Sessions: Integrated video calling for remote therapy
- Parent Portal: Dedicated interface for parents to monitor progress
- Gamification: Achievement system with badges and rewards
- Social Features: Safe interaction between users and families
- Assessment Tools: Standardized developmental assessments
- Content Management: Easy-to-use interface for creating custom content
- ✅ v1.0.0: Initial release with basic games and user management
- ✅ Speech Recognition: Voice-based games for language development
- ✅ Emotion Detection: Facial recognition for emotional intelligence
- ✅ Hand Gesture Recognition: Motor skills development games
- ✅ Progress Tracking: Comprehensive analytics dashboard
Have ideas for new features? We'd love to hear from you!
- Create a feature request issue on GitHub
- Join our community discussions
- Contribute code for planned features
- Documentation: Check this README and inline code comments
- GitHub Issues: Report bugs or request features
- Email Support: muhammadasimchattha@gmail.com
- Community: Join discussions in GitHub Discussions
- Bug Reports: Use GitHub Issues with detailed reproduction steps
- Feature Requests: Submit enhancement proposals via GitHub Issues
- Technical Questions: Email or create discussion threads
- Contributions: Follow the contributing guidelines above
- Critical Bugs: 24-48 hours
- General Issues: 3-5 business days
- Feature Requests: Reviewed during monthly planning cycles
- Pull Requests: Reviewed within 1 week
Made with ❤️ for the special needs community