This guide will help you set up and run the games in the EmoLearn project.
The games are served from the backend server. You have two options to start it:
python start_backend.pycd backend
python -m uvicorn main:app --host 127.0.0.1 --port 8000 --reloadIn a new terminal, start the frontend:
npm run dev
# or
yarn dev
# or
bun dev- Open your browser and go to
http://localhost:5173 - Click on the AI Assistant (brain icon)
- Click on the "Games" option
- Select a game to play
- Emoji Doodle 🎨 - Create fun doodles with emojis
- Story Spinner 📖 - Spin and create random stories
- Puzzle Pop 🧩 - Pop bubbles in the right order
- Line Shuffle 🔀 - Arrange code lines in correct order
- Concept Match 🔗 - Match related programming concepts
- Time To Solve ⏰ - Solve puzzles against the clock
- Quick Match ⚡ - Fast-paced matching game
- Reflex Dash 🏃 - Test your reflexes
- Juice It Up 🥤 - Energize with fun challenges
- Smash The Bug 🐛 - Find and eliminate bugs
- Laugh Trivia 😄 - Fun programming trivia
- Arrange The Code 📝 - Organize code blocks properly
Solution: Make sure the backend server is running on port 8000
-
Check if the server is running:
curl http://localhost:8000/docs
-
If not running, start it:
python start_backend.py
Solution: Check the server logs for errors
- Look at the terminal where the backend is running
- Check for any error messages
- Make sure all dependencies are installed:
pip install -r backend/requirements.txt
Solution: Check CORS settings and ports
- Make sure frontend is running on port 5173
- Make sure backend is running on port 8000
- Check that CORS is properly configured in the backend
emo-learn-nexus/
├── backend/
│ ├── main.py # Backend server with game routes
│ ├── requirements.txt # Python dependencies
│ └── modules/ # Emotion detection modules
├── src/
│ ├── config/
│ │ ├── games.ts # Game configurations
│ │ └── gameServer.ts # Server URL configuration
│ └── components/
│ └── GamesSection.tsx # Games UI component
├── start_backend.py # Backend startup script
└── GAMES_SETUP.md # This file
Games are accessible at:
http://localhost:8000/games/boredom/emoji-doodlehttp://localhost:8000/games/confusion/line-shufflehttp://localhost:8000/games/fatigue/quick-matchhttp://localhost:8000/games/frustration/smash-the-bug
Each game includes:
- ✅ Beautiful UI with gradients and animations
- ✅ Back button for easy navigation
- ✅ Responsive design
- ✅ Error handling and loading states
- ✅ Score tracking
- ✅ Interactive gameplay
To add a new game:
- Add the game configuration to
src/config/games.ts - Add the game implementation to the
gamesdictionary inbackend/main.py - Update the game icon in
src/components/GamesSection.tsx
If you encounter any issues:
- Check the browser console for errors
- Check the backend server logs
- Make sure all dependencies are installed
- Verify that both frontend and backend are running
The games are designed to help with different emotional states during learning:
- Boredom: Creative and engaging activities
- Confusion: Structured learning and problem-solving
- Fatigue: Quick, energizing challenges
- Frustration: Stress relief and confidence building
Happy learning! 🚀