Skip to content

A spring-boot project template with domain-driven design structure, swagger docs and unit tests with junit e mockito.

Notifications You must be signed in to change notification settings

farvic/spring-boot-template-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn GitHub Workflow Status (with branch)

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
  6. Contact

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/farvic/cinema-room-spring.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...?

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

If you want to talk about the project, feel free to contact me through one of my socials.

Victor Fonseca - @Linkedin

Project Link: https://github.com/farvic/cinema-room-spring

(back to top)

About

A spring-boot project template with domain-driven design structure, swagger docs and unit tests with junit e mockito.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages