A comprehensive Next.js learning platform with AI-powered content generation, user authentication, and progress tracking.
- 🧠 AI-Powered Learning: Generate explanations and quizzes using Google Gemini AI
- 📚 Quick Learn: Get concise explanations with interactive quizzes
- 🎯 Deep Learn: Comprehensive learning modules with structured sections
- 👤 User Authentication: Firebase-based user management
- 📊 Progress Tracking: Track learning streaks, quiz scores, and study sessions
- 🌙 Dark Mode: Complete theme system with user preference persistence
- 📱 Responsive Design: Works seamlessly across all devices
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- Database: Firebase Firestore
- Authentication: Firebase Auth
- AI: Google Gemini API
- Deployment: Vercel
- Node.js 18+
- npm or yarn
- Firebase project
- Google Gemini API key
- Clone the repository:
git clone <repository-url>
cd smartutor- Install dependencies:
npm install- Set up environment variables:
Create a
.env.localfile in the root directory:
GEMINI_API_KEY=your_gemini_api_key
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id- Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
- Install Vercel CLI:
npm i -g vercel- Login to Vercel:
vercel login- Deploy:
vercel- Set environment variables in Vercel dashboard:
- Go to your project settings
- Add all environment variables from
.env.local - Redeploy if necessary
Set these in your Vercel project settings:
GEMINI_API_KEYNEXT_PUBLIC_FIREBASE_API_KEYNEXT_PUBLIC_FIREBASE_AUTH_DOMAINNEXT_PUBLIC_FIREBASE_PROJECT_IDNEXT_PUBLIC_FIREBASE_STORAGE_BUCKETNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_IDNEXT_PUBLIC_FIREBASE_APP_ID
- Create a Firebase project at Firebase Console
- Enable Authentication with Email/Password
- Create a Firestore database
- Set up Firestore security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can only access their own data
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Study sessions - users can only access their own
match /studySessions/{sessionId} {
allow read, write: if request.auth != null && request.auth.uid == resource.data.userId;
}
// Quiz results - users can only access their own
match /quizResults/{resultId} {
allow read, write: if request.auth != null && request.auth.uid == resource.data.userId;
}
}
}- Go to Google AI Studio
- Create an API key
- Add the key to your environment variables as
GEMINI_API_KEY
smartutor/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── dashboard/ # Dashboard page
│ ├── learn/ # Quick learn page
│ ├── deep-learn/ # Deep learn page
│ ├── progress/ # Progress tracking page
│ └── profile/ # User profile page
├── components/ # React components
├── lib/ # Utility libraries
│ ├── firebase.ts # Firebase configuration
│ ├── firestore.ts # Firestore functions
│ └── gemini.ts # Gemini AI integration
└── public/ # Static assets
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.