Skip to content

TJZine/CertPrep.ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
CertPrep.ai Logo

CertPrep.ai

A comprehensive certification preparation platform with offline-first capabilities.

CertPrep.ai is a modern, offline-first quiz application designed to help users prepare for certifications. It features secure authentication, multiple quiz modes (Zen and Proctor), and detailed analytics to track your progress.

License Version Build Status Coverage

TypeScript Next.js Supabase Tailwind CSS


Features

Authentication icon
Secure Authentication
Email/password auth with Supabase, session management, and secure cookies
Sync icon
Offline-First Sync
Local IndexedDB storage with automatic cloud synchronization
Quiz modes icon
Quiz Modes
Proctor, Zen, Topic Study, and Spaced Repetition modes
Analytics dashboard icon
Analytics Dashboard
Track progress, heatmaps, and trend charts
Responsive design icon
Responsive Design
Fully responsive UI that works on all devices
Accessibility icon
Accessible
WCAG 2.1 compliant with full keyboard navigation

📋 Table of Contents

Click to expand

Demo

Live Demo: https://cert-prep-ai.vercel.app

Access

Please sign up for a new account to use the application.


Getting Started

Prerequisites

Requirement Version Installation
Node.js >=20.9.0 Download
npm/yarn/pnpm Latest Comes with Node.js
Supabase Account - Sign up

Installation

# Clone the repository
git clone https://github.com/TJZine/CertPrep.ai.git

# Navigate to directory
cd CertPrep.ai

# Install dependencies
npm install
# or
yarn install
# or
pnpm install

Environment Setup

  1. Copy the environment template:
cp .env.example .env.local
  1. Configure required variables:
# Supabase Configuration (Required)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# Optional: Analytics
NEXT_PUBLIC_ANALYTICS_ID=your_analytics_id
📖 Where to find these values
Variable Location
SUPABASE_URL Supabase Dashboard → Settings → API → Project URL
SUPABASE_ANON_KEY Supabase Dashboard → Settings → API → anon public key
  1. Set up the database:

This project does not currently ship Supabase migrations in-repo. You will need to:

  • Create a Supabase project.
  • Configure the database schema described in docs/ARCHITECTURE.md (tables for users, quizzes, results, etc.).
  • Optionally manage your own migrations using the Supabase CLI (supabase db ...) in your environment.
  1. Start the development server:
npm run dev

Tip

The app will be available at http://localhost:3000


📖 Usage

Quick Start

  1. Start the development server with npm run dev.
  2. Open http://localhost:3000 in your browser.
  3. Sign up for a new account (or log in).
  4. Import a sample quiz from docs/SAMPLE_QUIZ.json via the Library/Import UI.
  5. Start a quiz (Zen or Proctor mode), complete it, and view your results and analytics.

For code-level examples (auth, quizzes, results, and sync), see the dedicated API Reference.

Quiz Modes

Mode Description Best For
🎯 Proctor Timed, monitored quiz environment Assessments, exams
🧘 Zen Relaxed, self-paced learning Practice, study
🧠 SRS Spaced repetition review (Leitner) Long-term retention
📚 Topic Targeted category practice Weak area improv.
🔀 Interleaved Mixed questions from all quizzes Varied practice
View mode comparison
graph TD
    A[Start Quiz] --> B{Select Mode}
    B -->|Proctor| C[Timer Enabled]
    B -->|Zen| D[No Timer]
    B -->|SRS/Topic| D
    C --> E[Strict Navigation]
    D --> F[Free Navigation]
    E --> G[Submit on Complete]
    F --> G
    G --> H[View Results]
Loading

Architecture

Tech Stack

┌─────────────────────────────────────────────────────────────┐
│                        Frontend                              │
├─────────────────────────────────────────────────────────────┤
│  Next.js 16 (App Router) │ React 19 │ TypeScript │ Tailwind │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                      State & Storage                         │
├─────────────────────────────────────────────────────────────┤
│          Dexie.js (IndexedDB)  │  React Context             │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                        Backend                               │
├─────────────────────────────────────────────────────────────┤
│     Supabase (Auth + PostgreSQL + RLS + Realtime)           │
└─────────────────────────────────────────────────────────────┘

Project Structure

src/
├── app/                          # Next.js App Router
│   ├── analytics/                # Analytics dashboard
│   ├── auth/                     # Auth callback routes
│   ├── login/, signup/           # Auth pages
│   ├── library/                  # Quiz library
│   ├── create/                   # Create custom quizzes guide
│   ├── quiz/                     # Quiz flows ([id]/zen, [id]/proctor)
│   ├── results/                  # Results pages
│   └── settings/                 # Settings pages
├── components/                   # React components
│   ├── auth/                     # Authentication forms
│   ├── dashboard/                # Dashboard/library components
│   ├── quiz/                     # Quiz components
│   ├── results/                  # Results display
│   ├── analytics/                # Analytics components
│   └── ui/                       # Shared UI components
├── db/                           # Dexie IndexedDB setup
│   ├── index.ts                  # Database initialization
│   ├── quizzes.ts                # Quiz operations
│   └── results.ts                # Results operations
├── hooks/                        # Custom React hooks
├── lib/                          # Utility libraries
│   ├── supabase/                 # Supabase clients
│   ├── sync/                     # Sync engine
│   └── sanitize.ts               # HTML sanitization
└── types/                        # TypeScript definitions
View detailed module diagram
graph TB
    subgraph "Client Layer"
        A[Pages/Routes] --> B[Components]
        B --> C[Hooks]
    end

    subgraph "Data Layer"
        C --> D[Dexie DB]
        C --> E[Supabase Client]
    end

    subgraph "Sync Layer"
        D <--> F[Sync Manager]
        E <--> F
    end

    subgraph "Backend"
        E --> G[Supabase Auth]
        E --> H[PostgreSQL + RLS]
    end
Loading

📚 Documentation

Document Description
📖 API Reference API overview and examples
🏗️ Architecture System design and patterns
🔒 Security Security policies and practices
🤝 Contributing Contribution guidelines
📝 Changelog Version history
❓ FAQ Frequently asked questions
👩‍💻 Code Review Implementation standards & persona

Testing

# Run the unit test suite (Vitest)
npm test

Deployment

Vercel (Recommended)

Deploy with Vercel

Manual Deployment

# Build for production
npm run build

# Start production server
npm start

Environment Variables for Production

Important

Ensure all required environment variables are set in your production environment.

Variable Required Description
NEXT_PUBLIC_SUPABASE_URL Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase anonymous key
NEXT_PUBLIC_SITE_URL Production site URL

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

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

Development Commands

Command Description
npm run dev Start development server
npm run build Build for production
npm run lint Run ESLint
npm test Run the test suite
npm run security-check Run basic secret scanning
npm run supabase:types Generate DB types

Security

Caution

If you discover a security vulnerability, please report it responsibly.

Do NOT open a public issue. Please refer to SECURITY.md for reporting instructions.

See SECURITY.md for our full security policy.


License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Copyright 2025 TJZine
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0

Acknowledgments

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors