Spring Boot is an open-source Java-based framework designed to simplify the process of building, deploying, and running production-ready applications based on the Spring framework. Spring Boot provides a convention-over-configuration approach, allowing developers to create stand-alone, production-grade Spring-based Applications with minimal effort.
Spring MVC (Model-View-Controller) is a framework within the broader Spring framework that facilitates the development of web applications based on the Model-View-Controller architectural pattern. It provides a structured way to build scalable and maintainable web applications in Java.
Spring Security is a versatile module that simplifies authentication and authorization for Java applications. Key features include support for various authentication mechanisms, fine-grained access control, token-based security (such as JWT), secure password storage, and seamless integration with Spring Boot.
Spring Data JPA is part of the larger Spring Data project, aiming to simplify data access in Spring-based applications, particularly in the context of Java Persistence API (JPA). JPA is a standard specification for object-relational mapping (ORM) in Java, providing a programming interface for managing relational data in Java applications.
Spring OpenApi Docs helps to document RESTful services, providing explanations of the input, output, and endpoint URL for each API to enhance effective usage. In this project, the springdoc-openapi java library is used to automate API generation and integration with Swagger. Default Swagger link is http://localhost:8080/swagger-ui/index.html.
PostgreSQL is a powerful open-source relational database management system. It is known for its advanced features, extensibility, and compliance with SQL standards. PostgreSQL is widely used for various types of applications, ranging from small projects to large enterprise-level systems.
- Java: 17
- Spring Boot: 3.0.0
Ensure you have the following installed:
- Maven
- MongoDB
- Clone the repository:
git clone https://github.com/juzyz/SpringBoot_MainModules_Mongo.git
- Navigate to the project directory:
cd SpringBoot_MainModules_Mongo
- Build the project using Maven:
mvn clean install
Configure the Mongo database connection in src/main/resources/application.yml:
spring:
data:
mongodb:
host: localhost
port: 27017
database: studentManager
Endpoints | Method | Description | Parameters | Request Body |
---|---|---|---|---|
api/v1/auth/authenticate | POST | Authenticates a user based on provided credentials. | None | email (String): The email of the user.password (String): The password of the user. |
The access token is eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbi5tYWlsQGdtYWlsLmNvbSIsImF1dGhvcml0aWVzIjpbeyJhdXRob3JpdHkiOiJST0xFX0FETUlOIn1dLCJpYXQiOjE3MDI0NDAxNjcsImV4cCI6MTcwMjUyNjU2N30.XhxHpimn-nnVS6eKgRHdKgjhI4R8dGichVKhx4O6ALg
Endpoints | Method | Description | Parameters | Request Body |
---|---|---|---|---|
api/v1/student | GET | Retrieves a list of all students. | None | None |
api/v1/student | POST | Creates a new student with the provided details. | None | name (String): The student's name email (String): The student's email addressdateOfBirth (String): The student's date of birth |
api/v1/student/{studentId} | PUT | Updates the student information based on the provided student's data. | studentId (Integer): The unique identifier of the student. |
name (String): The student's name email (String): The student's email address. |
api/v1/student/{studentId} | DELETE | Deletes the student information based on the provided studentId . |
studentId (Integer): The unique identifier of the student. |
None |
Feel free to contribute to this project by opening issues or submitting pull requests.