Skip to content

andrewyang0620/ByteQuiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ByteQuiz Logo

A self-hosted coding interview practice platform

Practice algorithms, SQL, system design β€” all in one place.

MIT License Node React TypeScript SQLite PRs Welcome


Preview

ByteQuiz Screenshot


Features

⚑ Monaco Editor VS Code-grade editor in the browser
πŸ—‚ Custom Categories Add, edit, and delete categories with custom colors
πŸ‘ Instant Answers View solutions without submitting
✏️ Full CRUD Add, edit, delete problems via UI
πŸ” Smart Filters Filter by difficulty, category, tags
πŸ’Ύ Local First No cloud, no account, runs on SQLite
πŸ€– AI Grading Submit code to get instant feedback from GPT-4.1 β€” logic errors, syntax issues, and fix suggestions

Tech Stack

Frontend

React TypeScript Vite TailwindCSS Monaco Editor

Backend

Node.js Express TypeScript

Database

SQLite


Getting Started

Prerequisites

Installation

# 1. Clone the repo
git clone https://github.com/andrewyang0620/ByteQuiz.git
cd ByteQuiz

# 2. Install all dependencies
cd client && npm install
cd ../server && npm install

# 3. Start development servers
# Terminal 1 β€” backend
cd server && npm run dev

# Terminal 2 β€” frontend
cd client && npm run dev
Service URL
Frontend http://localhost:5173
API http://localhost:3001/api

Production (single process): Build the client (npm run build in client/), then run npm run build && node dist/index.js in server/. Everything is served from one Express process.


Project Structure

bytequiz/
β”œβ”€β”€ client/                 # React frontend (Vite)
β”‚   └── src/
β”‚       β”œβ”€β”€ components/     # Reusable UI components
β”‚       β”œβ”€β”€ pages/          # Route-level pages
β”‚       └── api/            # Axios API client
β”œβ”€β”€ server/                 # Express backend
β”‚   └── src/
β”‚       β”œβ”€β”€ routes/         # API route handlers
β”‚       β”œβ”€β”€ db/             # Schema, seed data
β”‚       └── executor/       # Code runner (vm sandbox)
β”œβ”€β”€ README.md
└── package.json            # Root scripts

Usage

  • Add problems β€” click + Add Problem, fill in title, category, description, and optional examples / test cases
  • Practice β€” open any problem, write code in the Editor tab, hit β–Ά Run to test against saved test cases
  • AI Grading β€” click β–Ά Submit to send your code to GPT-4.1 for instant feedback: logic errors with line-by-line fixes and format/syntax issues
  • View answer β€” switch to the Answer tab in the right panel
  • Track progress β€” hit +1 on any problem to track how many times you've practiced it
  • Manage categories β€” go to Categories to add, edit (name + color), or delete categories

AI Grading Setup

ByteQuiz uses OpenAI GPT-4.1 to review your code submissions.

  1. Add your API key to server/.env:
    OPENAI_API_KEY=sk-...
    
  2. Rebuild and restart the server:
    cd server && npm run build && pm2 restart bytequiz-server
  3. Open any problem, write code, and click β–Ά Submit β€” the AI Grading tab will show feedback structured as:
    • πŸ”΄ Logic Errors β€” line-level issues with suggested fixes
    • 🟑 Format / Syntax Errors β€” typos, naming violations, syntax mistakes

The output language defaults to English. To switch to Chinese, change OUTPUT_LANGUAGE in server/src/routes/grade.ts line 5 to 'zh', then rebuild.


Contributing

Contributions are welcome!

  1. Fork the repo
  2. Create your branch: git checkout -b feat/your-feature
  3. Commit your changes: git commit -m 'feat: add some feature'
  4. Push and open a PR

To add new built-in problems or categories, edit server/src/db/seed.ts.


License

MIT Β© 2025 β€” feel free to fork and self-host.

  • Add your own problems with full Markdown support
  • Create custom categories (SQL, system design, etc.)
  • Zero external dependencies - runs fully on your machine

Tech Stack

Layer Technology
Frontend React + Vite + TypeScript + Tailwind CSS
Backend Node.js + Express + TypeScript
Database SQLite (node:sqlite built-in)
Editor Monaco Editor

Getting Started

Prerequisites

  • Node.js >= 22.5

Install & Run

git clone https://github.com/andrewyang0620/ByteQuiz.git
cd ByteQuiz
npm run install:all
npm run dev

Project Structure

bytequiz/
|-- client/          # React frontend
|-- server/          # Express backend
|   -- data/        # SQLite database (gitignored)
-- README.md

Adding Problems

Click "+ Add Problem" in the nav bar to add a problem via the UI, or seed the database directly via server/src/db/seed.ts.

Managing Categories

Go to Categories in the nav bar to add or remove custom categories. Built-in categories (Array, SQL, etc.) cannot be deleted.

License

MIT

About

A local coding quiz app to practice interview problems. Built with React, Express, and SQLite.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages