Giter Site home page Giter Site logo

the-api-boilerplate's Introduction

The API Boilerplate

The API Boilerplate (TAB) is a pre-configured boilerplate for APIs with the Spring Framework.

Anatomy

Here's an explanation of the package structure. You can see examples on the source code.

There are 4 main packages for now. Alphabetically, they are:

  • api Holds everything related to how to interact with the clients.
  • config Everything that needs configuration goes here. Mostly beans and configurations of libraries.
  • domain Contains the business code.
  • infrastructure May contain code related to databases or third-party services, often related to persistence.
.
├── api
│   ├── controller -- Behaviour related to client requests (how to respond).
│   ├── exceptionhandler -- Specifies how to handle exceptions for the API layer.
│   └── model -- Specifies what the client gets from the API, basicallly.
│       ├── input -- Specifies what the client sends to the API, basically.
│       └── mapper -- Maps domain, model and input objects between each other.
├── config
├── domain
│   ├── exception -- Domain exceptions.
│   ├── model -- Specifies the business model, generally what's persisted.
│   ├── repository -- Contracts on how to interact with persisted data.
│   └── service -- Implementations of business rules and code.
├── infrastructure -- Implementations on how to interact with persisted data.
└── TheApiBoilerplateApplication.java -- the main method and other app-wide information/configuration.

Pre-configured libraries

Library Details Version
Spring Boot Starters -web, -data-mongodb, -validation 2.3.1.RELEASE
Model Mapper Maps objects from one type to another (http://modelmapper.org/) 2.3.0
SpringFox Generates OpenAPI (Swagger) documentation of the API (https://springfox.github.io/springfox/) 2.9.2
Lombok Java compile-time boilerplate code generator (https://projectlombok.org/) 1.18.12
Apache Commons I'm using ExceptionUtils for now (http://commons.apache.org/proper/commons-lang/) 3.10

To-do

  • Add database migration tool
  • Add security

the-api-boilerplate's People

Contributors

brunodrugowick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.