This project uses Google's Gemini AI API to power the AI tools. Follow these steps to get started.
- Node.js 18+ and npm
- Python 3.9+
- Google Account (for Gemini API key)
- Go to Google AI Studio
- Click "Create API Key"
- Copy your API key
- Open
.envfile in the project root - Replace
your-gemini-api-key-herewith your actual API key:
GOOGLE_API_KEY=your-actual-api-key-here# Install Node.js dependencies
npm install
# Install Python dependencies
python3 -m pip install -r server/requirements.txtchmod +x start.sh
./start.shTerminal 1 - Start the AI server:
cd server
python3 -m uvicorn ai_server:app --host 0.0.0.0 --port 4000Terminal 2 - Start the React app:
npm run dev- Frontend: http://localhost:5173
- API Server: http://localhost:4000
Ask the AI assistant questions, get code help, or troubleshooting assistance.
- Endpoint:
POST /api/ai/chat - Request:
{ "prompt": "Your question here" }
Get personalized study plans based on your goals and available time.
- Endpoint:
POST /api/ai/planner - Request:
{ "goals": "...", "timeAvailable": "30", "level": "Beginner" }
Generate summaries of your learning progress with suggestions for improvement.
- Endpoint:
POST /api/ai/summary - Request:
{ "data": { /* your progress data */ } }
- Ensure
GOOGLE_API_KEYis set in.env - Check that
google-generativeaiis installed:pip list | grep google
- Verify your API key is valid at https://ai.google.dev/
- Ensure the key has sufficient quota
- Make sure the Python server is running on port 4000
- Check
VITE_API_BASEin.envmatches your server URL
- Frontend: React 18 + Vite + TypeScript
- Backend: Python 3 + FastAPI
- AI Model: Google Gemini
- Styling: Tailwind CSS
.
├── src/ # React components and pages
│ ├── components/ai/ # AI tool components
│ │ ├── AIChat.tsx
│ │ ├── AIPlanner.tsx
│ │ └── AISummary.tsx
│ └── pages/ # Page components
├── server/ # Python backend
│ ├── ai_server.py # FastAPI server
│ └── requirements.txt # Python dependencies
├── .env # Environment configuration
└── package.json # Node.js dependencies
curl -X POST http://localhost:4000/api/ai/chat \
-H "Content-Type: application/json" \
-d '{"prompt": "How do I learn React?"}'curl -X POST http://localhost:4000/api/ai/planner \
-H "Content-Type: application/json" \
-d '{
"goals": "Learn React and TypeScript",
"timeAvailable": "60",
"level": "Intermediate"
}'curl -X POST http://localhost:4000/api/ai/summary \
-H "Content-Type: application/json" \
-d '{"data": {"completedLessons": 5, "hoursSpent": 10}}'- Keep your API key secret and never commit
.envto version control - Monitor your API usage at https://ai.google.dev/
- The Gemini API has rate limits; adjust requests accordingly
For issues with:
- Gemini API: See https://ai.google.dev/docs
- FastAPI: See https://fastapi.tiangolo.com/
- React/Vite: See https://vitejs.dev/
Happy coding with AI-powered learning! 🚀