Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/selcuksert/digilib

Digital book library app based on Spring Modulith
https://github.com/selcuksert/digilib

modulith react-js spring-modulith springboot

Last synced: 7 days ago
JSON representation

Digital book library app based on Spring Modulith

Awesome Lists containing this project

README

        

= Digital Library

This project implements a basic digital library with searching books via ISBN and inventory management (add/delete book) functions using link:https://spring.io/projects/spring-modulith[Spring Modulith,window=_blank] and ReactJS.
This application uses link:https://openlibrary.org/[Open Library,window=_blank] as book info database. The project supports Java SDK 21.

See Medium article: https://medium.com/@selcuk.sert/modular-monoliths-with-spring-modulith-96361f3167c9[Modular Monoliths with Spring Modulith
]

[cols="a,a"]
|===
| image:docs/images/ui-1.png[ui-1]
| image:docs/images/ui-2.png[ui-2]
|===

== Architecture

The project is compatible with docker and comprises of modules and services that underpins a typical Spring Modulith based application:

image:docs/models/arch.png[arch]

=== Traefik

Serves as edge router for docker-compose setup.

=== Neo4J

Serves as event registry for digilib modulith.
It includes *Neo4J browser* for data browsing on graph DB.

=== Kafka

Serves as message broker for event externalization. *Kafdrop* is used as event browser.

=== PostgreSQL

Serves as relational database to store book inventory. *PgAdmin* is used as DB viewer.

=== Zipkin

Is used to capture and view micrometer spans originated by digilib modulith for telemetry and tracing.

== Start-up Modes

The project comes with two different modes based on docker-compose:

* One for link:docker/docker-compose.yml[development] to activate mandatory external services for development with opening required ports for IDE,
* The other one for link:docker/docker-compose.yml[production] complementing previous one with serving full-stack application inside docker-compose setup.

The link:docker/start.sh[start script] (based on `zsh`) has the following options:

[source,shell]
----
start.sh -h
----

[source,text]
----
Start script for digilib app

Syntax: start.sh [-h|p|d]
options:
h Prints this Help.
p Start in production mode.
d Start in developer mode.
u Uninstall setup.
----

The start script also generates (under `certificates` folder) and registers a self-signed certificate (public certificate and private key) to enable TLS on Traefik edge router. The `digilib.crt` should be imported into trusted CA list for seamless browsing.

See link:docker/.env[environment file] for credentials and parameters used in docker-compose setup.

=== URLs

Some DNS entries should be added with IP of node that hosts Traefik deployment.
For local deployments a typical `hosts` file content for digilib would be:

[source,text]
----
127.0.0.1 portainer.digilib.local
127.0.0.1 neo4j.digilib.local
127.0.0.1 pgadmin.digilib.local
127.0.0.1 ui.digilib.local
127.0.0.1 api.digilib.local
127.0.0.1 kafdrop.digilib.local
127.0.0.1 zipkin.digilib.local
----

|===
|URL |Mode |Detail

|https://portainer.digilib.local
|Production
|Portainer UI

|https://neo4j.digilib.local
|All modes
|Neo4J browser

|https://pgadmin.digilib.local
|All modes
|PgAdmin UI

|https://kafdrop.digilib.local
|All modes
|Kafdrop UI

|https://zipkin.digilib.local
|All modes
|Zipkin UI

|https://ui.digilib.local
|Production
|digilib UI

|http://localhost:5173/
|Development
|digilib UI

|https://api.digilib.local
|Production
|digilib API host
|===

For OpenAPI definitions `{API Host}/swagger-ui` should be used.