A production-ready web application that serves as an AI-powered personal operating system for students. Built with Next.js, TypeScript, Tailwind CSS, Supabase, and Stripe.
- Student Dashboard - Overview of daily tasks, study progress, and upcoming exams
- AI Study Planner - Generate personalized study schedules based on subjects, exam dates, and available hours
- AI Tutor - Get teacher-style explanations, answers to questions, and practice problems
- Exam Intelligence - High-probability topics, common mistakes, and exam tips
- Settings - Profile management, subscription status, and billing
- Email/password authentication with Supabase Auth
- Protected routes with middleware
- Row Level Security (RLS) for database access
- Session persistence
- Stripe integration for subscriptions
- Free and Pro plans
- Webhook handling for subscription events
- Customer portal for billing management
- Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS
- UI Components: shadcn/ui (40+ pre-built components)
- Backend: Supabase (PostgreSQL, Auth, Real-time)
- Payments: Stripe (Checkout, Subscriptions, Webhooks)
- AI: API-based AI service (abstracted for easy swapping)
app/
├── api/
│ └── stripe/
│ └── webhook/ # Stripe webhook handler
├── dashboard/ # Main dashboard page
├── planner/ # AI Study Planner
├── ai-tutor/ # AI Tutor interface
├── exam-intel/ # Exam Intelligence
├── settings/ # Settings & billing
├── login/ # Login page
├── signup/ # Signup page
├── page.tsx # Landing page
├── layout.tsx # Root layout
└── globals.css # Global styles
components/
├── ui/ # shadcn/ui components
├── dashboard-layout.tsx # Dashboard layout with sidebar
└── theme-provider.tsx # Theme provider
lib/
├── supabase/
│ ├── client.ts # Browser client
│ ├── server.ts # Server client
│ └── middleware.ts # Auth middleware
└── utils.ts # Utility functions
types/
└── index.ts # TypeScript types
supabase/
└── schema.sql # Database schema
- Node.js 18+
- npm or yarn
- Supabase account
- Stripe account (for payments)
Create a .env.local file with the following variables:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Stripe
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
# AI Service (optional - can be swapped)
AI_API_KEY=your_ai_api_key
AI_API_URL=your_ai_api_url- Clone the repository:
git clone https://github.com/yourusername/studentos.git
cd studentos- Install dependencies:
npm install-
Set up Supabase:
- Create a new project in Supabase
- Run the SQL schema from
supabase/schema.sqlin the SQL Editor - Copy your project URL and anon key to
.env.local
-
Set up Stripe:
- Create a Stripe account
- Set up products and prices in the Stripe Dashboard
- Add price IDs to your environment variables
- Configure webhook endpoint to
/api/stripe/webhook
-
Run the development server:
npm run dev- Open http://localhost:3000 in your browser.
Run the following SQL in your Supabase SQL Editor to set up the database schema:
-- The full schema is in supabase/schema.sql
-- It includes:
-- - profiles table (extends auth.users)
-- - subscriptions table (Stripe integration)
-- - study_plans table (AI study plans)
-- - study_tasks table (individual tasks)
-- - ai_usage table (track AI requests)
-- - exam_intel table (exam insights)
-- - tutor_sessions table (tutor history)
-- - RLS policies for security-
Create products in Stripe Dashboard:
- Pro Plan - Monthly ($9.99/month)
- Set lookup_key to
pro_monthly
-
Configure webhook endpoint:
- URL:
https://yourdomain.com/api/stripe/webhook - Events to listen for:
customer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_failed
- URL:
-
Add Stripe customer metadata:
- When creating checkout sessions, include
userIdin customer metadata
- When creating checkout sessions, include
npm run build- Push your code to GitHub
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
Make sure to update the Supabase RLS policies to allow access from your production domain.
- 10 AI tutor requests per month
- Basic study planner
- Limited exam intelligence
- Email support
- Unlimited AI requests
- Advanced study planner with AI-generated schedules
- Full exam intelligence with pattern analysis
- Priority support
- Early access to new features
The AI service is abstracted in a way that allows easy swapping:
- Current Implementation: Simulated responses for demo
- Production: Replace
generateAIResponse()functions with actual API calls
Supported AI features:
- Teacher-style explanations
- Practice question generation
- Study schedule generation
- Exam topic prediction
- All database access is protected by Row Level Security (RLS)
- Users can only access their own data
- API routes are protected by authentication middleware
- Stripe webhooks are verified with signature
- Parent dashboard
- School licensing
- Mobile app (React Native)
- Multiple languages support
- Advanced analytics
- Study groups
- Flashcards with spaced repetition
- Note-taking with AI summarization
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - see LICENSE file for details
For support, email support@studentos.com or join our Discord community.
Built with ❤️ for students everywhere.