🚀 ORYZIMA QUIZ - Project Story

The Journey: From Struggle to Simplicity

Background & Challenges

As a student facing personal challenges rooted in my environment and background, this hackathon journey has been far from smooth. Despite the difficulties, I held onto hope and kept pushing forward. I've attempted countless projects that never came to fruition, each failure teaching me valuable lessons about perseverance and adaptation.

Through this process, I discovered a fundamental truth: simplicity is the key. Smart people appreciate elegant, straightforward solutions. As the French saying goes, "Vingt fois sur le métier remettez votre ouvrage" (Twenty times put your work back on the loom) - discipline consistently beats raw talent.

The Pivot Moments

Initially, I planned to work in a team, but the tight timeline made collaboration impossible. I then attempted to build an e-signature system, but became frustrated with endless bugs and technical roadblocks. Each problem forced me to step back, simplify my approach, and learn something new.

The breakthrough came when I realized: don't reinvent the wheel. Stand on the shoulders of giants and leverage existing powerful tools. This mindset led me to discover Supabase - an amazing and efficient backend solution that I plan to use in all my future projects.

Technical Evolution & Deep Implementation

This project embodies my newfound philosophy of strategic simplicity:

Smart Technology Stack & Architecture

// Core Stack Decision Matrix
Frontend: React + TypeScript + Vite
├── UI Framework: Tailwind CSS + Framer Motion
├── State Management: React Hooks (useState, useEffect)
├── File Processing: Built-in File API
└── Real-time Updates: Supabase Realtime

Backend: Supabase (PostgreSQL + Real-time + Storage)
├── Database: Two simple tables (quizzes, results)
├── Real-time: WebSocket subscriptions for leaderboards
├── Storage: Direct file upload for quiz content
└── API: Auto-generated REST + GraphQL endpoints

AI Services: Strategic API Integration
├── OpenAI GPT-4: Structured quiz generation
├── ElevenLabs: Dynamic voice synthesis
└── Prompt Engineering: Context window optimization

Database Design Philosophy

Instead of complex schemas, I chose radical simplicity:

-- Minimalist but powerful schema
CREATE TABLE quizzes (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  title text NOT NULL,
  description text,
  questions jsonb NOT NULL, -- Flexible JSON storage
  public_link text UNIQUE,
  created_at timestamptz DEFAULT now()
);

CREATE TABLE results (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  quiz_id uuid REFERENCES quizzes(id),
  player_name text NOT NULL,
  score integer DEFAULT 0,
  total integer DEFAULT 5,
  time_taken integer, -- Performance tracking
  created_at timestamptz DEFAULT now()
);

Why JSONB for questions? Maximum flexibility without migration headaches. Each quiz can have different question types, structures, and metadata without schema changes.

AI Integration Strategy

Structured Prompting System:

const generateQuizPrompt = (content: string, settings: QuizSettings) => {
  return `
CONTEXT: You are an expert quiz creator
INPUT: ${content}
REQUIREMENTS:
- Generate exactly ${settings.questionCount} questions
- Types: ${settings.questionTypes.join(', ')}
- Difficulty: ${settings.difficulty}
- Format: Return valid JSON only

OUTPUT_SCHEMA:
{
  "questions": [{
    "type": "multiple_choice|true_false|fill_blank",
    "question": "string",
    "options": ["string"] // for multiple choice only
    "correct_answer": "string",
    "explanation": "string"
  }]
}`;
};

Context Window Management:

  • Input validation: 20-5000 characters
  • File processing: Extract text, limit to 4000 tokens
  • Chunking strategy for large content
  • Error handling with graceful fallbacks

Real-time Implementation

Supabase Real-time Magic:

// Live leaderboard updates
const subscribeToResults = (quizId: string) => {
  return supabase
    .channel(`quiz_${quizId}`)
    .on('postgres_changes', {
      event: 'INSERT',
      schema: 'public',
      table: 'results',
      filter: `quiz_id=eq.${quizId}`
    }, (payload) => {
      // Update leaderboard in real-time
      updateLeaderboard(payload.new);
    })
    .subscribe();
};

Frontend Architecture Decisions

Component Strategy:

src/
├── components/
│   ├── QuizCreator.tsx      // Smart component with AI integration
│   │   ├── TextInput.tsx    // Direct text input with validation
│   │   ├── FileUpload.tsx   // Drag & drop with progress
│   │   └── TopicGenerator.tsx // AI-powered topic suggestions
│   ├── QuizPlayer.tsx       // State machine for quiz flow
│   │   ├── QuestionDisplay.tsx // Dynamic question rendering
│   │   ├── ProgressBar.tsx  // Visual progress tracking
│   │   └── VoiceCommentary.tsx // ElevenLabs integration
│   ├── Leaderboard.tsx      // Real-time ranking system
│   └── UI/
│       ├── HackathonBadges.tsx // Mandatory sponsor badges
│       ├── LoadingSpinner.tsx  // Consistent loading states
│       └── ErrorBoundary.tsx   // Graceful error handling

State Management Philosophy:

// Simple but effective state pattern
interface QuizState {
  currentQuestion: number;
  answers: Record<number, string>;
  score: number;
  timeStarted: Date;
  isCompleted: boolean;
}

// No Redux complexity - just React hooks
const useQuizState = () => {
  const [state, setState] = useState<QuizState>(initialState);

  const nextQuestion = () => setState(prev => ({
    ...prev,
    currentQuestion: prev.currentQuestion + 1
  }));

  return { state, nextQuestion, /* other actions */ };
};

Voice Integration Technical Details

ElevenLabs Smart Commentary:

const generateVoiceCommentary = async (performance: Performance) => {
  const script = generateCommentaryScript(performance);

  const audio = await elevenlabs.generate({
    voice: "Rachel", // Consistent voice across app
    text: script,
    model_id: "eleven_multilingual_v2",
    voice_settings: {
      stability: 0.8,
      similarity_boost: 0.8,
      style: 0.2 // Encouraging tone
    }
  });

  return audio;
};

const generateCommentaryScript = (perf: Performance) => {
  if (perf.percentage >= 90) return "Outstanding work! You're clearly mastering this topic.";
  if (perf.percentage >= 70) return "Great job! You're on the right track.";
  if (perf.percentage >= 50) return "Good effort! Keep learning and you'll improve.";
  return "Don't give up! Every expert was once a beginner.";
};

Performance Optimization Strategies

Lazy Loading & Code Splitting:

// Component-level code splitting
const QuizPlayer = lazy(() => import('./QuizPlayer'));
const Leaderboard = lazy(() => import('./Leaderboard'));

// API optimization
const debouncedGeneration = debounce(generateQuiz, 1000);

Caching Strategy:

  • Local storage for draft quizzes
  • Session storage for quiz progress
  • Supabase built-in caching for repeated queries

Error Handling & User Experience

Comprehensive Error Strategy:

const ErrorBoundary = ({ children }: { children: ReactNode }) => {
  const [hasError, setHasError] = useState(false);

  if (hasError) {
    return (
      <div className="min-h-screen flex items-center justify-center">
        <div className="text-center space-y-4">
          <h2>Something went wrong</h2>
          <p>Don't worry, your progress is saved locally</p>
          <button onClick={() => setHasError(false)}>
            Try Again
          </button>
        </div>
      </div>
    );
  }

  return children;
};

Deployment & DevOps Simplicity

Netlify Deployment Pipeline:

# netlify.toml
[build]
  command = "npm run build"
  publish = "dist"

[build.environment]
  NODE_VERSION = "18"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Environment Configuration:

// Secure API key management
const config = {
  supabase: {
    url: import.meta.env.VITE_SUPABASE_URL,
    anonKey: import.meta.env.VITE_SUPABASE_ANON_KEY
  },
  openai: {
    apiKey: import.meta.env.VITE_OPENAI_API_KEY
  },
  elevenlabs: {
    apiKey: import.meta.env.VITE_ELEVENLABS_API_KEY
  }
};

Core Philosophy: Authentic Simplicity

The technical foundation rests on three pillars:

  1. Leverage, Don't Build: Use Supabase instead of building backend infrastructure
  2. JSON-First: Flexible data structures that adapt without migrations
  3. API-Driven: Compose powerful services rather than building from scratch

Key Learnings

This intense journey taught me more than any successful project could have:

  1. Resilience is Key: I learned that failure isn't an endpoint; it's a necessary part of the creative process. Every failed attempt gave me a clue that led to the final idea.

  2. Innovation is Connection: The true breakthrough didn't come from inventing something new, but from connecting existing, powerful technologies in a novel way to solve a human problem.

  3. Passion Trumps Perfection: I know this concept needs refinement, but I've learned that submitting a passionate, well-thought-out, and functional idea is more valuable than giving in to the fear of imperfection.

  4. Technical Debt is Optional: By choosing simple, proven technologies and patterns, complex problems become manageable puzzles.

The Turning Point

Last night, after receiving the second hackathon email reminder, I realized: I have nothing to lose. This moment of clarity transformed my approach from fear-driven complexity to confidence-driven simplicity.

Technical Implementation Highlights

  • Smart Context Management: Implemented structured prompting for consistent AI quiz generation
  • Real-time Leaderboards: Authentic scoring system with Supabase real-time subscriptions
  • Voice-First UX: ElevenLabs integration for performance-based audio feedback
  • Responsive Design: Glassmorphism UI with smooth Framer Motion animations
  • Instant Sharing: Unique URL generation for seamless quiz distribution
  • Zero-Config Deployment: Netlify integration with automatic environment handling

Message of Hope

To whoever reads this: keep hope alive and work relentlessly. We can only win when we pursue our dreams with unwavering dedication. Sometimes the best solutions come not from the most complex code, but from the simplest connections between powerful tools.

This project represents more than code - it's proof that resilience, simplicity, and strategic thinking can transform struggle into innovation.


Built with passion, powered by simplicity, driven by hope.

Tech Stack Summary: React + TypeScript + Supabase + OpenAI + ElevenLabs + Netlify
Philosophy: Leverage giants, embrace simplicity, ship fast
Result: Functional AI quiz platform in record time

Built With

Share this project:

Updates