Skip to content

schambeck/clean-architecture

Repository files navigation

clean-architecture

build

Simple Clean Architecture

With a more simplistic architectural vision, following all the good concepts, specially keeping total isolation of the core, but with a single external layer for the application, simulating a physically modular division into packages with config, entrypoint and dataprovider.

simple-clean-architecture.png

Tech Stack

  • Java 17
  • Spring Boot
  • PostgreSQL, Flyway
  • JUnit 5, Mockito, JaCoCo

Running project

Start infra (PostgreSQL)

$ make compose-up

Build artifact

$ make dist

Run backend

$ make run

API

Creating a notification

POST /notifications (creates a new notification)
Payload
{
  "type": "SSE",
  "title": "Order created #1",
  "message": "Created at 2023-02-03",
  "link": "/orders/1"
}
Response

Code : 201 CREATED

{
  "id": "7c08629a-4d23-4b6d-9363-b0f0d7303aa4",
  "type": "SSE",
  "title": "Order created #1",
  "message": "Created at 2023-02-03",
  "link": "/orders/1",
  "read": false
}

Counting unread notifications

GET /queries/count-unread (counts unread notifications)
Response

Code : 200 OK

{
  "countUnread": 10
}

References

Languages