Skip to content

QuizForge is a secure and scalable quiz management system built with Spring Boot, featuring JWT authentication, Spring Security, Bcrypt password hashing, and PostgreSQL integration. It provides clean REST APIs for user management, quiz creation, and role-based access control, ideal for real-world quiz or test-based applications.

Notifications You must be signed in to change notification settings

Om357/QuizForge-BackEnd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ QuizForge โ€“ Backend

QuizForge is a scalable and secure backend system for an online quiz platform, built using Spring Boot. It handles user authentication, quiz management, and role-based access control using JWT, Spring Security, and Bcrypt. The application integrates PostgreSQL as the database and uses Spring Data JPA for ORM.

This backend serves as the core engine for creating, managing, and participating in quizzes through a RESTful API.


๐Ÿš€ Tech Stack

  • Language: Java 17+
  • Framework: Spring Boot 3.x
  • Database: PostgreSQL
  • ORM: Spring Data JPA
  • Security: Spring Security, JWT, Bcrypt
  • Build Tool: Maven
  • API Testing: Postman / Swagger (optional)

๐Ÿ” Key Features

  • โœ… User registration and login with JWT-based authentication
  • โœ… Passwords securely hashed using Bcrypt
  • โœ… Role-based access control (Admin, User)
  • โœ… CRUD operations for Quizzes, Questions, and Categories
  • โœ… Seamless data access via Spring Data JPA
  • โœ… Integrated PostgreSQL database
  • โœ… Modular and clean code architecture (Controller-Service-Repository)

๐Ÿ“ฆ Project Structure


com.quizforge
โ”œโ”€โ”€ controller       # REST endpoints
โ”œโ”€โ”€ service          # Business logic
โ”œโ”€โ”€ repository       # JPA interfaces
โ”œโ”€โ”€ model            # Entities (User, Quiz, Question, etc.)
โ”œโ”€โ”€ config           # JWT filters, security config
โ””โ”€โ”€ QuizForgeApplication.java


โš™๏ธ Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/QuizForge-Backend.git
cd QuizForge-Backend

2. Configure application.properties

# PostgreSQL Configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/quizforge
spring.datasource.username=your_db_username
spring.datasource.password=your_db_password

# JPA Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true

# JWT Secret
jwt.secret=your_jwt_secret_key

3. Run the App

mvn clean install
mvn spring-boot:run

The app will be accessible at: http://localhost:8080


๐Ÿ” Security Flow

  • Users login and receive a JWT token

  • Token must be included in the Authorization header as:

    Authorization: Bearer <your_token>
    
  • Role-based access control restricts routes for Admin and User


๐Ÿ“ฎ Sample API Endpoints

Method Endpoint Description Access
POST /api/auth/signup Register new user Public
POST /api/auth/login Login and receive JWT token Public
GET /api/quiz/all Fetch all quizzes User/Admin
POST /api/quiz/ Create a new quiz Admin only
POST /api/question/ Add question to a quiz Admin only
GET /api/category/ List all quiz categories Public

๐Ÿงช Tools for Testing

  • Postman
  • Swagger UI (optional setup)
  • PostgreSQL with PgAdmin for DB management

๐Ÿ“ˆ Future Enhancements

  • Quiz timer & submission tracking
  • Leaderboard & analytics
  • Docker containerization
  • Swagger/OpenAPI documentation

๐Ÿ‘จโ€๐Ÿ’ป Author

Om Rathod ๐Ÿ“ง omrathod@example.com ๐Ÿ”— LinkedIn ๐Ÿ”— GitHub


๐Ÿ™Œ Contributions

Feel free to fork this project and raise PRs if you'd like to contribute or improve any functionality. For issues, bugs, or enhancements, raise a GitHub issue.


About

QuizForge is a secure and scalable quiz management system built with Spring Boot, featuring JWT authentication, Spring Security, Bcrypt password hashing, and PostgreSQL integration. It provides clean REST APIs for user management, quiz creation, and role-based access control, ideal for real-world quiz or test-based applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages