Skip to content

2pasha/testing-app

Repository files navigation

🧠 Knowledge Testing App

Created by: Kostyshyn Pavlo
Node.js Version: v18.20.7

A modern web platform for creating and taking knowledge tests with support for various question types and user management system.

🚀 Key Features

For Teachers

  • Registration and Authentication with "teacher" role
  • Test Creation with flexible configuration
  • Question Pool System - organizing questions by topics
  • Multiple Question Types:
    • Single correct answer (single_choice)
    • Multiple correct answers (multiple_choice)
    • Text-based answers (text)
    • True/False (true_false)
  • Question Weight Configuration for different pools
  • Unique Test Code Generation for sharing
  • Access Management to tests (activate/deactivate)
  • Test Statistics View for each test
  • Student Results Monitoring

For Students

  • Registration and Authentication with "student" role
  • Test Search by Code for taking tests
  • Test Taking with all question types
  • Automatic Score Calculation considering question weights
  • Test History View with grades and results
  • User Profile with personal statistics

🛠 Technology Stack

Frontend

  • Next.js 15.2.0 - React framework with SSR
  • React 19.0.0 - UI library
  • Tailwind CSS 4.0.9 - styling
  • Framer Motion 12.4.10 - animations
  • Radix UI - interface components
  • Lucide React - icons

Backend

  • Next.js API Routes - server logic
  • Sequelize 6.37.5 - ORM for database operations
  • PostgreSQL - main database
  • JWT - authentication
  • bcryptjs - password hashing

Development Tools

  • TypeScript 5 - type safety
  • ESLint - code linting
  • Sequelize CLI - database migrations
  • ts-node - TypeScript execution

🗄 Database

Main Tables:

  • Users - users (teachers and students)
  • Tests - tests
  • Questions - questions with different types
  • TestConfigs - question pool configurations
  • TestResults - test completion results
  • Answers - student answers

Relationships:

  • Teacher → Tests (1:many)
  • Test → Questions (1:many)
  • Test → Pool Configurations (1:many)
  • Student → Test Results (1:many)
  • Question → Answers (1:many)

🔐 Authentication System

  • JWT Tokens with 10-hour expiration
  • HttpOnly Cookies for security
  • User Roles: student | teacher
  • Authorization Middleware for endpoint protection
  • Password Hashing with bcrypt

🎯 Question Types

  1. Single Choice - selecting one correct answer
  2. Multiple Choice - selecting multiple correct answers
  3. Text - free text answer
  4. True/False - yes/no questions

📊 Scoring System

  • Question Weights - each question has its own weight
  • Automatic Score Calculation
  • Attempt Tracking - students can take tests multiple times
  • Statistics for teachers on each test

🚀 Installation and Setup

Prerequisites

  • Node.js v18.20.7+
  • PostgreSQL
  • npm or yarn

Installation Steps

  1. Clone Repository
git clone <repository-url>
cd testing-app
  1. Install Dependencies
npm install
  1. Database Setup
# Create .env.local file with database settings
DATABASE_URL=postgresql://username:password@localhost:5432/testing_app
JWT_SECRET=your_jwt_secret_key
  1. Start Development Server
npm run dev
  1. Open Browser
http://localhost:3000

📝 Available Scripts

  • npm run dev - start development server with Turbopack
  • npm run build - build for production
  • npm run start - start production server
  • npm run lint - run ESLint code check
  • npm run migrate - run database migrations
  • npm run migrate:undo - rollback migrations
  • npm run seed - populate database with test data

🎨 Design Features

  • Dark Theme by default
  • Responsive Design for all devices
  • Video Background on homepage
  • Modern UI with Tailwind CSS
  • Smooth Animations with Framer Motion

🔧 Configuration

Test Settings

  • Number of question pools
  • Number of questions per pool
  • Question weights for different pools
  • Test activity status

Security

  • HttpOnly cookies
  • JWT tokens
  • Authorization middleware
  • Data validation

👨‍💻 Author

Kostyshyn Pavlo - developer and project architect

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •