Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StudentOS - AI-Powered Personal Operating System for Students

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.

Features

Core Features

  • 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

Authentication & Security

  • Email/password authentication with Supabase Auth
  • Protected routes with middleware
  • Row Level Security (RLS) for database access
  • Session persistence

Payments

  • Stripe integration for subscriptions
  • Free and Pro plans
  • Webhook handling for subscription events
  • Customer portal for billing management

Tech Stack

  • 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)

Project Structure

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

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account
  • Stripe account (for payments)

Environment Variables

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

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/studentos.git
cd studentos
  1. Install dependencies:
npm install
  1. Set up Supabase:

    • Create a new project in Supabase
    • Run the SQL schema from supabase/schema.sql in the SQL Editor
    • Copy your project URL and anon key to .env.local
  2. 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
  3. Run the development server:

npm run dev
  1. Open http://localhost:3000 in your browser.

Database Setup

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

Stripe Setup

  1. Create products in Stripe Dashboard:

    • Pro Plan - Monthly ($9.99/month)
    • Set lookup_key to pro_monthly
  2. Configure webhook endpoint:

    • URL: https://yourdomain.com/api/stripe/webhook
    • Events to listen for:
      • customer.subscription.created
      • customer.subscription.updated
      • customer.subscription.deleted
      • invoice.payment_failed
  3. Add Stripe customer metadata:

    • When creating checkout sessions, include userId in customer metadata

Deployment

Build for Production

npm run build

Deploy to Vercel

  1. Push your code to GitHub
  2. Import project in Vercel
  3. Add environment variables in Vercel dashboard
  4. Deploy!

Update Supabase RLS for Production

Make sure to update the Supabase RLS policies to allow access from your production domain.

Features in Detail

Free Plan

  • 10 AI tutor requests per month
  • Basic study planner
  • Limited exam intelligence
  • Email support

Pro Plan ($9.99/month)

  • Unlimited AI requests
  • Advanced study planner with AI-generated schedules
  • Full exam intelligence with pattern analysis
  • Priority support
  • Early access to new features

AI Integration

The AI service is abstracted in a way that allows easy swapping:

  1. Current Implementation: Simulated responses for demo
  2. Production: Replace generateAIResponse() functions with actual API calls

Supported AI features:

  • Teacher-style explanations
  • Practice question generation
  • Study schedule generation
  • Exam topic prediction

Security

  • 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

Future Roadmap

  • Parent dashboard
  • School licensing
  • Mobile app (React Native)
  • Multiple languages support
  • Advanced analytics
  • Study groups
  • Flashcards with spaced repetition
  • Note-taking with AI summarization

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE file for details

Support

For support, email support@studentos.com or join our Discord community.


Built with ❤️ for students everywhere.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages