Skip to content

Latest commit

 

History

History
269 lines (182 loc) · 5.17 KB

File metadata and controls

269 lines (182 loc) · 5.17 KB

🎓 Zetoe Academy

Modern Learning Management System built with Next.js 15, TypeScript, and Supabase.


🚀 Features

  • Student Management - Registration, course enrollment, payment tracking
  • Course Management - Create and manage courses with exams
  • Exam System - Timed exams with automatic grading
  • Role-Based Access - Student, Admin, Super Admin roles
  • Certificate Verification - Upload and verify certificates with unique codes
  • Performance Optimized - Database indexes, API caching

📚 Tech Stack

  • Framework: Next.js 15.5.4 (App Router)
  • Language: TypeScript
  • Database: PostgreSQL (Supabase)
  • Authentication: Supabase Auth
  • Styling: Tailwind CSS
  • Caching: In-memory cache with auto-invalidation

🏃 Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account

Installation

# Clone repository
git clone <repository-url>
cd zetoe_academy

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local
# Add your Supabase credentials

# Run development server
npm run dev

Visit http://localhost:3000


🗄️ Database Setup

1. Run Optimization Script

# In Supabase SQL Editor
# Run: supabase/database-optimization.sql

This creates:

  • 15+ performance indexes
  • Query optimization functions
  • Full-text search capabilities

📊 Performance

Database Optimization

  • 15+ indexes (composite, GIN, B-tree)
  • pg_trgm for full-text search
  • Pagination on all list queries
  • Query optimization functions

📖 See: docs/QUERY_OPTIMIZATION_GUIDE.md

API Caching

  • In-memory cache with TTL
  • Automatic cache expiration
  • Pattern-based invalidation
  • 95% faster cached responses

📖 See: docs/API_CACHING_GUIDE.md


🎯 Available Scripts

Script Description
npm run dev Start development server
npm run build Build for production
npm start Start production server
npm run lint Run ESLint

📁 Project Structure

zetoe_academy/
├── src/
│   ├── app/                    # Next.js app router
│   │   ├── api/               # API routes
│   │   ├── dashboard/         # Student dashboard
│   │   ├── admin-dashboard/   # Admin dashboard
│   │   └── certificates/      # Certificate verification
│   └── lib/                    # Utilities
│       ├── cache.ts           # Caching system
│       └── swr-config.ts      # Client-side cache config
├── supabase/                   # Database
│   └── database-optimization.sql
└── docs/                       # Documentation
    ├── API_CACHING_GUIDE.md
    └── QUERY_OPTIMIZATION_GUIDE.md

🔐 User Roles

Student

  • View enrolled courses
  • Take exams
  • View scores and certificates
  • Dashboard access

Admin

  • Create students
  • Assign courses
  • Set payment status
  • Create exams
  • View scores
  • Manage students

Super Admin

  • All admin permissions
  • Create/delete admins
  • System-wide access
  • View admin logs

🎓 Certificate System

Admin: Upload Certificate

  1. Navigate to Admin Dashboard
  2. Go to Certificates section
  3. Upload certificate with unique code
  4. Certificate stored in Supabase Storage

Public: Verify Certificate

  1. Visit /certificates
  2. Enter certificate code
  3. View certificate if valid

📖 See: docs/CERTIFICATE_SYSTEM_SUMMARY.md


🚀 Deployment

Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Environment Variables

Required:

NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

📖 Documentation

Document Description
API Caching Caching implementation
Query Optimization Database optimization
Certificate System Certificate verification

🐛 Known Issues

None at this time. Report issues in GitHub Issues.


🤝 Contributing

  1. Fork repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Open pull request

📄 License

MIT License


🙏 Acknowledgments

  • Next.js team for amazing framework
  • Supabase for backend infrastructure
  • Playwright for testing framework

📞 Support


✅ Status

Production Ready

All features implemented and tested:

  • ✅ Student management
  • ✅ Course management
  • ✅ Exam system
  • ✅ Certificate verification
  • ✅ Database optimization
  • ✅ API caching

GitHub Issues Resolved:

  1. ✅ Database Query Optimization
  2. ✅ API Caching Implementation

Built with ❤️ by the Zetoe Academy Team