Skip to content

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

 
 
 

Contributors

Languages