A modern web application for creating, managing, and taking online exams. Built with Next.js, TypeScript, Drizzle ORM, and PostgreSQL.
- 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
- 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
- Node.js (v18 or newer)
- pnpm (v8 or newer)
- PostgreSQL (v14 or newer)
- Clone the repository:
git clone https://github.com/yourusername/online-exam-app.git
cd online-exam-app- Install dependencies:
pnpm install- Create a
.envfile in the root directory with the following variables:
cp .env.example .env
- Start the PostgreSQL database (requires Docker):
# in bash or wsl
chmod +x start-database.sh
./start-database.sh- Initialize the database schema:
pnpm db:push- Seed the database with an admin user:
pnpm seed:admin- (Optional) Seed the database with student users:
pnpm seed:studentspnpm devThe application will be available at http://localhost:3000.
pnpm build
pnpm start-
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
-
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
MIT