Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quiz Application Backend

Status Purpose

This repository is a learning project focused on exploring Spring Data REST. I built this to understand how to rapidly expose JPA repositories as REST APIs.

A lightweight, efficient backend for a Quiz application built using Spring Boot and Spring Data REST. This implementation focuses on the rapid development of RESTful APIs by automatically exposing JPA repositories.

Key Features

  • Rapid API Development: Utilizes Spring Data REST to automatically generate CRUD operations (Create, Read, Update, Delete) and pagination/sorting functionality without boilerplate code.
  • Entity Management: Structured data models for Quiz and Question entities with proper relationships.
  • Relational Mapping: One-to-Many relationship between Quizzes and Questions.
  • Persistence: Configured with MySQL for robust data storage.
  • Automated Generation: Uses Lombok to reduce code verbosity for getters and setters.

Tech Stack

  • Framework: Spring Boot 3.4
  • Language: Java
  • Build Tool: Maven
  • Database: MySQL
  • Data Access: Spring Data JPA & Spring Data REST
  • Utilities: Lombok

Project Structure

  • Entities:
    • Quiz: Contains fields like title, description, createdDate, and banner.
    • Question: Contains content, options (as a collection), answer, and a link to its parent Quiz.
  • Repositories:
    • QuizRepository and QuestionRepository extending JpaRepository to enable automatic REST exposure.

Setup Instructions

  1. Database Configuration: Update application.properties with your MySQL database credentials.
    spring.datasource.url=jdbc:mysql://localhost:3306/your_db_name
    spring.datasource.username=your_username
    spring.datasource.password=your_password
    spring.jpa.hibernate.ddl-auto=update
  2. Run Application: Start the Spring Boot application.
  3. API Usage: - The APIs are automatically exposed under the base path.
    • Standard HTTP methods (GET, POST, PUT, DELETE) are available for /quizzes and /questions endpoints.
    • Relationships can be managed by linking the URI of the parent resource when creating child resources.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages