Giter Site home page Giter Site logo

bellmit / realworld-backend-spring-ddd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from borovikovd/realworld-backend-spring-ddd

0.0 0.0 0.0 163 KB

Realworld spec implementation using Spring Boot

License: MIT License

Makefile 0.36% Shell 0.61% Java 99.03%

realworld-backend-spring-ddd's Introduction

RealWorld Example App

DDD architecture implementation using Spring Boot (Spring Security, Spring Data, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully-fledged application built with Spring including CRUD operations, authentication, routing, pagination, and more.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

This application uses Spring Boot with Java 11. The implementation is meant to demonstrate idiomatic usage of Spring Framework and other modern Java technologies.

Basic approach

The app is created using API-first approach. I.e. a swagger file (see the api directory) is used to generate a skeleton of the REST API together with models (DTO) used for json representation.

In pom.xml you can see the usage of openapi-generator-maven-plugin plugin which performs actual code generation.

The app itself implements generated interfaces using DDD philosophy. See the structure below.

Project structure:

application/            -> API of the app, encapsulates the domain
+-- service/            -> implementation of generated interfaces
+-- exception           -> application exceptions
+-- util                -> some helper classes including DTO mapping layer
domain/                 -> core business implementation layer
+-- aggregate/          -> aggregates are cluster of domain entities
+-- service/            -> doamin services that operate with domain entities
infrastructure/         -> technical details layer
+-- config/             -> dependency injection configuration
+-- security/           -> security configuration

Some features of the project setup

Getting started

Start the local server

 make run

The server should be running at http://localhost:8080

Running postman collection tests

make postman-test

Building jar file

make

What can be improved

  • There is no command and query segregation, as the result, we can see a lot of JPA hacking
  • JEP 359 aka Java records is still a preview, but it could simplify the codebase
  • openapi-generator-maven-plugin is not a perfect generator - it uses some old spring dependencies
  • Test coverage can be improved

realworld-backend-spring-ddd's People

Contributors

borovikovd 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.