Skip to content

Repository files navigation

StudyPal β€” Your AI-Powered Study Companion

The study pal every student always needed. AI-powered study accountability for African students who work while they study. Study smarter, even offline.

Live Demo: studypal-your-ai-study-companion.vercel.app


πŸ“‹ Overview

StudyPal is a full-stack AI-powered study application designed specifically for students in Africa who balance work, school, and life. Built for the YPIT Hackathon 2026 β€” Education Track, StudyPal transforms the study experience by:

  • πŸ“ Structuring your notes into bite-size lessons using AI
  • 🎧 Reading content aloud for hands-free learning while you commute, work, or cook
  • ❓ Quizzing you instantly with voice-based comprehension checks
  • πŸ“Š Tracking real progress with Daily Pulse β€” actual coverage data, no motivation quotes
  • πŸ”Œ Working offline after the first load β€” no internet required
  • 🎯 Adapting to your reality with "Life Happened Mode" that replans when you miss days

Beta tested by 200+ students from UNILAG, LASU, UI, Covenant, and ABU with a 4.9/5 rating.


🎯 The Problem We Solve

Why Students Struggle

  1. Inconsistent Internet β€” NEPA goes. Data finishes. Study apps shouldn't punish you for that.
  2. No One Checking In β€” Self-study is lonely. Without accountability, weeks blur into nothing.
  3. Life Gets in the Way β€” You work, you commute, you cook. Most planners weren't built for real students.

StudyPal is built to work for any learner β€” university students, polytechnic students, JAMB/WAEC candidates, or self-studiers. It fits into your real schedule, not the other way around.


✨ Core Features

1. Voice Lessons 🎧

  • AI reads your content aloud in 10–15 minute sessions
  • Perfect for learning while doing chores, commuting, or working

2. Smart Study Planner

  • Personalized micro-sessions adapted to your real schedule
  • Automatically reschedules when life happens

3. Comprehension Checks ❓

  • 3 quick voice-based or text questions after every session
  • Instant feedback β€” real understanding, not just recall

4. Daily Pulse πŸ“Š

  • Real progress data day by day
  • Streak tracking, average performance, and days remaining
  • Zero guilt-tripping if you miss a day

5. Offline Mode πŸ”Œ

  • Full functionality without internet after the first load
  • Syncs automatically when you're back online

6. AI-Powered Content Structuring πŸ€–

  • Upload lecture notes, past questions, or PDFs
  • AI structures them into 5–7 ordered lesson topics
  • Groq + Aethex power the intelligence

πŸ›  Tech Stack

99.1% TypeScript | 0.9% Other

Frontend & Framework

  • React 19.2.0 β€” Modern UI with Concurrent features
  • TanStack Start β€” Full-stack framework with file-based routing
  • TanStack Router β€” Type-safe routing & query management
  • TanStack React Query β€” Server state management

UI & Animation

  • Radix UI β€” Unstyled, accessible components (accordion, dialog, dropdown, etc.)
  • Tailwind CSS 4.2 β€” Utility-first styling
  • Framer Motion β€” Smooth animations and transitions
  • Lucide React β€” Icon library

Forms & Validation

  • React Hook Form β€” Efficient form handling
  • Zod β€” Runtime TypeScript schema validation
  • Class Variance Authority β€” Component variant management

Backend & Database

  • Supabase β€” PostgreSQL database + authentication
  • Groq β€” AI content structuring (LLM inference)

Build & Deployment

  • Vite 7.3.1 β€” Lightning-fast build tool
  • Vercel β€” Deployment platform (configured in vercel.json)
  • TypeScript 5.8.3 β€” Type safety

Development

  • ESLint β€” Code quality
  • Prettier β€” Code formatting
  • Bun β€” Fast package manager
  • Nitro β€” Backend framework (beta)

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ or Bun
  • Git
  • Supabase account (free tier available)
  • Groq API key

Installation

# Clone the repository
git clone https://github.com/zion-robotics/studypal-your-ai-study-companion.git
cd studypal-your-ai-study-companion

# Install dependencies
bun install
# or
npm install

# Create .env.local
cp .env.example .env.local

Environment Setup

Create a .env.local file with:

VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_GROQ_API_KEY=your_groq_api_key

Development Server

# Start dev server with hot reload
bun run dev
# or
npm run dev

Open http://localhost:5173 in your browser.

Production Build

# Build for production
bun run build
# or
npm run build

# Preview production build
bun run preview

πŸ“ Project Structure

src/
β”œβ”€β”€ routes/                    # File-based routing (TanStack Start)
β”‚   β”œβ”€β”€ __root.tsx             # App shell with authentication
β”‚   β”œβ”€β”€ index.tsx              # Landing page
β”‚   β”œβ”€β”€ login.tsx              # Login page
β”‚   β”œβ”€β”€ signup.tsx             # Registration page
β”‚   β”œβ”€β”€ onboarding.tsx         # User setup flow
β”‚   β”œβ”€β”€ dashboard.tsx          # Main dashboard
β”‚   β”œβ”€β”€ upload.tsx             # Note upload & AI structuring
β”‚   β”œβ”€β”€ session.tsx            # Study session (voice, quizzes)
β”‚   β”œβ”€β”€ documents.tsx          # Document management
β”‚   β”œβ”€β”€ courses.tsx            # Folder/course organization
β”‚   β”œβ”€β”€ notes.tsx              # Personal notes
β”‚   β”œβ”€β”€ community.tsx          # Social feed
β”‚   β”œβ”€β”€ discussions.tsx        # Discussion threads
β”‚   β”œβ”€β”€ settings.tsx           # User preferences
β”‚   β”œβ”€β”€ -AppShell.tsx          # Sidebar layout
β”‚   └── README.md              # Route conventions
β”œβ”€β”€ components/
β”‚   └── sp/                    # StudyPal-specific UI components
β”‚       β”œβ”€β”€ TopNav.tsx
β”‚       β”œβ”€β”€ Logo.tsx
β”‚       β”œβ”€β”€ ThemeToggle.tsx
β”‚       └── AppShell.tsx
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ supabase.ts            # Supabase client
β”‚   β”œβ”€β”€ groq.ts                # Groq API integration
β”‚   β”œβ”€β”€ validation.ts          # Form validation
β”‚   β”œβ”€β”€ guards.ts              # Route protection
β”‚   └── lovable-error-reporting.ts
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useAuth.ts             # Authentication
β”‚   β”œβ”€β”€ useProfile.ts          # User profile
β”‚   └── useCountUp.ts          # Animation helpers
β”œβ”€β”€ styles.css                 # Global styles
└── types/                     # TypeScript types


πŸ“Š Database Schema (Supabase)

Tables

users (via Supabase Auth)
β”œβ”€β”€ id (UUID)
β”œβ”€β”€ email
β”œβ”€β”€ created_at

user_profiles
β”œβ”€β”€ user_id (FK)
β”œβ”€β”€ full_name
β”œβ”€β”€ school_name
β”œβ”€β”€ user_type (tertiary | secondary)
β”œβ”€β”€ learning_mode (mixed | online | offline)
β”œβ”€β”€ notifications_enabled
β”œβ”€β”€ voice_id
β”œβ”€β”€ exam_date
β”œβ”€β”€ avatar_url
β”œβ”€β”€ onboarding_completed

lessons
β”œβ”€β”€ id
β”œβ”€β”€ user_id (FK)
β”œβ”€β”€ subject
β”œβ”€β”€ notes (text)
β”œβ”€β”€ topics (string[])
β”œβ”€β”€ exam_type (JAMB | WAEC | NECO | POST-UTME | null)
β”œβ”€β”€ created_at

documents
β”œβ”€β”€ id
β”œβ”€β”€ user_id (FK)
β”œβ”€β”€ folder_id (FK)
β”œβ”€β”€ name
β”œβ”€β”€ file_path
β”œβ”€β”€ file_size
β”œβ”€β”€ public_url
β”œβ”€β”€ created_at

courses (Folders)
β”œβ”€β”€ id
β”œβ”€β”€ user_id (FK)
β”œβ”€β”€ parent_folder_id (FK, nullable)
β”œβ”€β”€ title
β”œβ”€β”€ created_at

notes
β”œβ”€β”€ id
β”œβ”€β”€ user_id (FK)
β”œβ”€β”€ title
β”œβ”€β”€ body (markdown)
β”œβ”€β”€ color (yellow | sage | coral | sky | lavender | white)
β”œβ”€β”€ tags (Chemistry | Biology | Economics | Math | General | Important)
β”œβ”€β”€ created_at
β”œβ”€β”€ updated_at

πŸ” Authentication

StudyPal uses Supabase Auth with magic links and password-based login. The app includes:

  • Email validation & password strength checks
  • OAuth callback handling with automatic redirects
  • Session restoration from localStorage
  • Onboarding flow for new users
  • Protected routes with requireAuth and requireGuest guards

🎨 Design System

  • Colors: Accent-driven (teal/cyan) with light/dark mode support
  • Typography: Display fonts for headings, monospace for metadata
  • Spacing: Tailwind's default scale (px-4, gap-6, etc.)
  • Components: Radix UI primitives + custom StudyPal variants
  • Animations: Framer Motion for micro-interactions
  • Icons: Lucide React

πŸ“± Key Pages & Features

Landing Page (/)

  • Hero section with parallax scrolling
  • Problem statement (3 challenges)
  • Feature showcase
  • How-it-works timeline
  • Testimonials from beta testers
  • Call-to-action

Authentication (/login, /signup)

  • Email validation
  • Password strength indicator
  • Error handling with friendly messages
  • Redirect based on onboarding status

Dashboard (/dashboard)

  • User's study stats & streaks
  • Recent lessons & documents
  • Quick-start actions
  • Progress visualization

Upload (/upload)

  • Drag-and-drop file/text input
  • AI content structuring (via Groq)
  • Exam-type selection (JAMB/WAEC/NECO)
  • Topic preview & confirmation

Study Session (/session)

  • Voice-based lesson playback
  • Comprehension quiz (3 questions)
  • Session timer & progress
  • Offline support

Documents (/documents)

  • File browser (PDFs, Word, Excel, Images, etc.)
  • List & grid views
  • Search & filter
  • Real-time sync with Supabase

Courses (/courses)

  • Hierarchical folder management
  • Drag-and-drop organization
  • Quick actions (rename, delete, move)
  • Document count per folder

Notes (/notes)

  • Rich text editing
  • Color & tag organization
  • Full-text search
  • Real-time sync

Community (/community)

  • Social feed of student posts
  • Categories: University & Exam Prep
  • Tags for filtering
  • Like & comment functionality

Settings (/settings)

  • Profile management (name, school, user type)
  • Learning preferences
  • Voice settings
  • Notification controls

πŸ”Œ API Integrations

Supabase

  • PostgreSQL database
  • Row-level security policies
  • Real-time subscriptions
  • Storage for documents

Groq

  • Structured output API for content parsing
  • Fast inference for note structuring
  • Model: Best available in Groq (configurable)

πŸ§ͺ Development

# Run linter
bun run lint

# Format code
bun run format

# Watch for changes
bun run dev

πŸ“ˆ Performance Optimizations

  • βœ… Code splitting with TanStack Router
  • βœ… Lazy loading of routes
  • βœ… Image optimization (Unsplash CDN)
  • βœ… Framer Motion GPU acceleration
  • βœ… Offline-first architecture (via localStorage + Supabase)
  • βœ… React Query caching & stale-while-revalidate

🌐 Deployment

Vercel (Recommended)

# Deploy automatically on push to main
git push origin main

The app is configured in vercel.json for SSR + edge runtime.

Environment Variables (Vercel)

Set these in your Vercel dashboard:

  • VITE_SUPABASE_URL
  • VITE_SUPABASE_ANON_KEY
  • VITE_GROQ_API_KEY

🎯 Beta Users & Testimonials

"I work at a phone repair shop till 5pm. StudyPal gives me 10-minute sessions I can actually finish. My GPA went from 2.8 to 3.4 this semester." β€” Tunde A., 300L Engineering, LASU

"I uploaded my Biology past questions and StudyPal turned them into daily quizzes. I scored 287 on my JAMB. I wasn't expecting that at all." β€” Chisom E., JAMB Candidate, Enugu

"The voice lessons are everything. I listen while I'm cooking or on the bus. It actually asks me questions and waits for my answer. Nothing else does that." β€” Amaka O., HND Accounting, Yaba Tech


🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit changes (git commit -m 'Add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

πŸ“„ License

This project is part of the YPIT Hackathon 2026. See LICENSE file for details.


πŸ“ž Contact

  • GitHub: @zion-robotics
  • Built for: YPIT Hackathon 2026 β€” Education Track

πŸš€ What's Next?

  • Mobile app (React Native)
  • AI-generated exam simulations
  • Peer tutoring marketplace
  • Integration with school LMS
  • Multi-language support
  • Advanced analytics dashboard

Built for students who work while they study.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages