Skip to content

mienaiyami/online-exam-app

Repository files navigation

Online Exam Application

A modern web application for creating, managing, and taking online exams. Built with Next.js, TypeScript, Drizzle ORM, and PostgreSQL.

Features

  • User Authentication: Secure login and role-based access (Admin, Instructor, Student)
  • Exam Management:
    • Create and edit exams with time limits
    • Schedule exam availability with start and end dates
    • Support for multiple question types (Multiple Choice, Short Answer, Essay)
  • Interactive Testing Environment:
    • Rich text editor for questions and answers
    • Real-time exam session management
    • Automated grading for multiple-choice questions
  • User Management:
    • Manage users with different roles
    • Assign exams to specific users
  • Analytics & Reporting:
    • View exam results and statistics
    • Track student progress

Technology Stack

  • Framework: Next.js 15
  • Language: TypeScript
  • Database: PostgreSQL with Drizzle ORM
  • Authentication: NextAuth.js
  • UI Components: Tailwind CSS, Radix UI
  • Form Handling: React Hook Form, Zod
  • Rich Text Editor: Tiptap
  • API: tRPC
  • File Uploads: UploadThing

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/online-exam-app.git
cd online-exam-app
  1. Install dependencies:
pnpm install
  1. Create a .env file in the root directory with the following variables:
cp .env.example .env
  1. Start the PostgreSQL database (requires Docker):
# in bash or wsl
chmod +x start-database.sh
./start-database.sh
  1. Initialize the database schema:
pnpm db:push
  1. Seed the database with an admin user:
pnpm seed:admin
  1. (Optional) Seed the database with student users:
pnpm seed:students

Running the Application

Development Mode

pnpm dev

The application will be available at http://localhost:3000.

Production Build

pnpm build
pnpm start

Database Management

  • Generate migration files based on schema changes:

    pnpm db:generate
  • Push schema changes to the database:

    pnpm db:push
  • Open Drizzle Studio (database GUI):

    pnpm db:studio

Development Scripts

  • Check code for errors:

    pnpm check
  • Format code:

    pnpm format:write
  • Type checking:

    pnpm typecheck
  • Linting:

    pnpm lint
  • List mock users (after seeding):

    pnpm list:mock-users

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages