Skip to content

hoaflee/lnp-chatgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring-Boot REST API Template

Table of Contents
  1. About The Project
  2. Built With
  3. Topics covered in this template
  4. Getting Started
  5. Roadmap

About The Project

This is a template for a REST API using Spring Boot. It was created to be used as a base for future projects.

Built With

Topics covered in this template

  • REST API
  • Domain-Driven Design
  • Tests with JUnit Jupiter, MockMvc and Mockito
  • Databases with H2 embedded database
  • Custom Exception Handling
  • Swagger UI API

Getting Started

  1. . Clone the repo

    Fork or clone the repo: https://github.com/hoaflee/lnp-chatgpt.git
  2. Run using Maven or your IDE

    mvn spring-boot:run
  3. In order to run the tests

    mvn test
  4. Some relevant lines from the application.properties

     # localhost:8080/
     port=8080
    
    
     # localhost:8080/swagger-ui/index.html
    
     springdoc.swagger-ui.path=/swagger-ui.html
     springdoc.api-docs.path=/v3/api-docs
     sprindoc.swagger-ui.config-url=/v3/api-docs/swagger-config
     springdoc.swagger-ui.url=/v3/api-docs
    
    
     # H2 Database name - in memory database
     spring.datasource.url=jdbc:h2:mem:testdb
     spring.h2.console.enabled=true
    
     # localhost:8080/h2-console
     spring.h2.console.path=/h2-console
    
     spring.datasource.driverClassName=org.h2.Driver
    
     # authentication to access the database console
     spring.datasource.username=sa
     spring.datasource.password=
  5. An API documentation can be accessed through localhost:8080/swagger-ui/index.html once the program is running

Roadmap

  • Create a basic REST API
  • Add a database support
  • Add a Swagger UI API documentation
  • Add tests for the controllers, services and repositories
  • Add a security layer
  • Add remote database support
  • Add a Dockerfile for the application
  • And more...?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages