Git Product home page Git Product logo

treblle / springboot-api-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 26 KB

An awesome boilerplate for your next Spring boot based API. Its only goal is to simply kick-start your API development and provide you with some of the best practices when building amazing and scalable REST APIs

Home Page: https://www.treblle.com/

License: MIT License

Java 100.00%
api api-monitoring api-observability backend boilerplate java rest-api restful-api spring-boot treblle

springboot-api-boilerplate's Introduction

Spring Boot API boilerplate

MIT Licence

An awesome boilerplate for your next Spring Boot based API. It's only goal is to simply kick-start your API development and provide you with some of the best practices when building amazing and scalable REST APIs πŸ”₯

Features

REST API Best Practices

We baked in all the best REST API practices in terms of structuring your API, naming conventions, HTTP methods, responses and optimizations

Concrete examples

We all like to learn by examples and that's why the boilerplate comes with a concrete example that include everything from folder structure, repositories, services and controllers

OpenAPI/Swagger support

The API documentation is generated automatically on application start using the awesome SpringDoc OpenAPI library

Entities and migrations

We built two tables Users and Posts and defined everything you might need on a database and entity level. Schema migrations are handled by Liquibase.

Spawn a new user quickly

New users can be added quickly by using the public endpoint:

POST /api/v1/users

Real world authentication

We provide examples of using both HTTP Basic and JWT Bearer authentication

Treblle built-in

We added an awesome Spring Boot dependency called Treblle. Out of the box Treblle gives you: real-time API monitoring, automatically generated and updated documentation, error tracking and logging, API analytics, quality scoring and much more. To get started with Treblle visit treblle.com for more information.

Treblle makes it super easy to understand what’s going on with your APIs and the apps that use them. Just by adding Treblle to your API out of the box, you get:

  • Real-time API monitoring and logging
  • Auto-generated API docs with OAS support
  • API analytics
  • Quality scoring
  • One-click testing
  • API management on the go
  • and more...

Requirements

  • Spring Boot 2.7.4
  • Java 8+

Getting started

  1. Configure your Treblle API key and Project ID in the application.properties file

  2. Run the following command in the terminal

     ./mvnw spring-boot:run
    
  3. Access the Swagger UI at http://localhost:8080/swagger-ui/index.html#/

  4. Create a user by calling (check the Swagger UI)

     POST /api/v1/users
    
  5. Authenticate using HTTP Basic using the users email and password by calling

     POST /api/v1/iam/authenticate
    
  6. Use the resulting JWT token to access all other resources

Thank you

The boilerplate was built by IvoMajic and sponsored by Treblle. We would love to have you as our contributor so please feel free to make pull requests and help us make the best API boilerplate on Github πŸ’ͺ🏻

The 10 REST Commandments E-book

# The 10 REST CommandmentsGrab a free copy of The 10 REST Commandments e-book and learn how to build great REST APIs that scale in any language πŸ‘‰ https://treblle.com/ebooks/the-10-rest-commandments

Support

If you have problems of any kind feel free to reach out via https://treblle.com or email [email protected], and we'll do our best to help you out.

License

Copyright 2022, Treblle Limited. Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php

springboot-api-boilerplate's People

Contributors

ivomajic avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

ayewo

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.