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.
- 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)
- โ 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)
com.quizforge
โโโ controller # REST endpoints
โโโ service # Business logic
โโโ repository # JPA interfaces
โโโ model # Entities (User, Quiz, Question, etc.)
โโโ config # JWT filters, security config
โโโ QuizForgeApplication.java
git clone https://github.com/yourusername/QuizForge-Backend.git
cd QuizForge-Backend# 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_keymvn clean install
mvn spring-boot:runThe app will be accessible at:
http://localhost:8080
-
Users login and receive a JWT token
-
Token must be included in the
Authorizationheader as:Authorization: Bearer <your_token> -
Role-based access control restricts routes for Admin and User
| 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 |
- Postman
- Swagger UI (optional setup)
- PostgreSQL with PgAdmin for DB management
- Quiz timer & submission tracking
- Leaderboard & analytics
- Docker containerization
- Swagger/OpenAPI documentation
Om Rathod ๐ง omrathod@example.com ๐ LinkedIn ๐ GitHub
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.