Skip to content

πŸŽ“ AI-powered platform that transforms videos into interactive courses with intelligent chat assistance

License

Notifications You must be signed in to change notification settings

galfrevn/aristocrat

Repository files navigation

Aristocrat Logo

Aristocrat

AI-Powered Course Generation Platform
Transform videos into comprehensive learning experiences using advanced AI

Get Started Β»

Features Β· Tech Stack Β· API Docs Β· Contributing

About Aristocrat

Aristocrat is a cutting-edge educational platform that leverages artificial intelligence to automatically generate comprehensive courses from video content. Our platform transforms raw video materials into structured, interactive learning experiences with AI-powered chat assistance, progress tracking, and personalized learning paths.

🎯 Key Features

  • πŸ€– AI Course Generation: Automatically create structured courses from video content using advanced AI models
  • πŸ’¬ Interactive Chat: Built-in AI assistant "Bart" for real-time learning support and Q&A
  • πŸ“Š Progress Tracking: Comprehensive learning analytics and progress monitoring
  • 🎨 Modern UI: Beautiful, responsive interface built with React and Tailwind CSS
  • πŸ” Secure Authentication: Enterprise-grade authentication with Better Auth
  • πŸ“± Cross-Platform: Responsive design that works seamlessly across all devices
  • ⚑ Real-time Updates: Live course updates and collaborative features
  • πŸ“ File Management: Integrated file upload and management system

Tech Stack

Aristocrat is built using modern, scalable technologies:

Frontend

Backend

  • Hono - Lightweight, fast web framework
  • tRPC - End-to-end typesafe APIs
  • Better Auth - Modern authentication solution
  • Drizzle ORM - TypeScript ORM with PostgreSQL
  • PostgreSQL - Robust relational database

Development & Deployment

  • Bun - Fast JavaScript runtime and package manager
  • Turbo - High-performance build system
  • Biome - Fast linter and formatter
  • Docker - Containerized deployment
  • Trigger.dev - Background job processing (planned)

Additional Tools

Project Structure

aristocrat/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ server/          # Hono + tRPC API server
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ db/      # Database schema and migrations
β”‚   β”‚   β”‚   β”œβ”€β”€ lib/     # Auth, context, and utilities
β”‚   β”‚   β”‚   └── routers/ # tRPC route definitions
β”‚   β”‚   └── drizzle.config.ts
β”‚   β”œβ”€β”€ website/         # Next.js frontend application
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ app/     # App Router pages and layouts
β”‚   β”‚   β”‚   β”œβ”€β”€ components/ # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ hooks/   # Custom React hooks
β”‚   β”‚   β”‚   └── lib/     # Client utilities and auth
β”‚   β”‚   └── next.config.ts
β”‚   └── workers/         # Background job processing
β”œβ”€β”€ docs/                # Documentation and assets
β”œβ”€β”€ scripts/             # Development automation scripts
└── package.json         # Workspace configuration

Getting Started

Prerequisites

Ensure you have the following installed:

Quick Start

  1. Clone the repository

    git clone https://github.com/galfrevn/aristocrat.git
    cd aristocrat
  2. Install dependencies

    bun install
  3. Set up environment variables

    # Copy environment template
    cp apps/server/.env.example apps/server/.env
    
    # Edit the environment file with your configuration
    # Required variables:
    # - DATABASE_URL=postgres://postgres:mypassword@localhost:5432/postgres
    # - CORS_ORIGIN=http://localhost:3001
    # - BETTER_AUTH_SECRET=your-secret-here
    # - BETTER_AUTH_URL=http://localhost:3000
  4. Start the development environment

    bun run dev

    This command will:

    • βœ… Check system requirements (Docker, Bun)
    • 🐳 Create and start PostgreSQL container if needed
    • ⏳ Wait for database to be ready
    • πŸ—„οΈ Run database migrations
    • πŸš€ Start all development servers
  5. Access the application

Development

Available Scripts

# Development
bun run dev              # Start all services with automated setup
bun run dev:turbo        # Start development servers only
bun run dev:web          # Start website only
bun run dev:server       # Start API server only

# Database
bun run db:push          # Push schema changes to database
bun run db:studio        # Open Drizzle Studio
bun run db:generate      # Generate migration files
bun run db:migrate       # Run pending migrations

# Build & Quality
bun run build            # Build all applications
bun run check            # Run Biome linter and formatter
bun run check-types      # TypeScript type checking

Development Workflow

  1. Database Changes: Update schema in apps/server/src/db/schema/
  2. Push Changes: Run bun run db:push to sync with database
  3. API Routes: Add tRPC routes in apps/server/src/routers/
  4. Frontend: Use tRPC client hooks in React components
  5. Testing: Create test files alongside source code
  6. Formatting: Pre-commit hooks automatically format code

Environment Configuration

Server (.env)

# Database
DATABASE_URL=postgres://postgres:mypassword@localhost:5432/postgres

# CORS
CORS_ORIGIN=http://localhost:3001

# Authentication
BETTER_AUTH_SECRET=your-super-secret-key-here
BETTER_AUTH_URL=http://localhost:3000

# Optional
NODE_ENV=development

Website (Environment Variables)

NEXT_PUBLIC_SERVER_URL=http://localhost:3000
UPLOADTHING_TOKEN=your-uploadthing-token

API Documentation

Authentication Endpoints

POST /api/auth/sign-up     # User registration
POST /api/auth/sign-in     # User login
POST /api/auth/sign-out    # User logout
GET  /api/auth/session     # Get current session

tRPC Routes

The API uses tRPC for type-safe client-server communication:

// Example client usage
import { trpc } from '@/utils/trpc'

// Get user profile
const { data: user } = trpc.user.profile.useQuery()

// Update course progress
const updateProgress = trpc.course.updateProgress.useMutation()

Architecture

Monorepo Structure

Aristocrat uses a monorepo architecture with multiple applications:

  • apps/server: Hono-based API server with tRPC
  • apps/website: Next.js frontend application
  • apps/workers: Background job processing (Trigger.dev)

Database Schema

-- Core tables
users                    # User accounts and profiles
sessions                 # Authentication sessions
accounts                 # OAuth account linking
courses                  # Generated course content
course_progress         # User learning progress
chat_sessions           # AI chat conversations
files                   # Uploaded content and assets

Authentication Flow

  1. User registers/logs in via Better Auth
  2. Session tokens stored securely with HTTP-only cookies
  3. tRPC middleware validates sessions for protected routes
  4. Frontend redirects unauthenticated users to login

Deployment

Production Build

# Build all applications
bun run build

# Check production readiness
bun run check-types

Docker Deployment

# Production Dockerfile example
FROM oven/bun:alpine

WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile

COPY . .
RUN bun run build

EXPOSE 3000
CMD ["bun", "run", "start"]

Environment Variables

Set these in your production environment:

NODE_ENV=production
DATABASE_URL=postgresql://user:password@host:port/database
BETTER_AUTH_SECRET=production-secret-key
CORS_ORIGIN=https://yourdomain.com

Contributing

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

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests
  4. Ensure code quality: bun run check
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Code Style

  • TypeScript: Strict mode enabled
  • Formatting: Biome with consistent rules
  • Naming: Descriptive, camelCase for variables, PascalCase for components
  • Comments: JSDoc for functions, inline comments for complex logic

License

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

Support


Built with ❀️ by the Aristocrat Team

⭐ Star on GitHub

About

πŸŽ“ AI-powered platform that transforms videos into interactive courses with intelligent chat assistance

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages