-
Notifications
You must be signed in to change notification settings - Fork 7
Code structure
Open this project in an IDE, like IntelliJ.
- initial files provided by LHDI's Java Starter Kit in PR #8
- software changes in Current Software State
-
settings.gradle
: includes subdirectories as Gradle subprojects -
build.gradle
in the project root,api
, andapp
subdirectories -
buildSrc
subdirectory: LHDI Starter Kit provides Gradle plugins; details in the README.md - Run the software and browse to http://localhost:8080/swagger to see the OpenAPI spec
Based on build.gradle
files in each directory, here's the rough subproject dependencies (based on PR #50):
-
app
- main@SpringBootApplication
-
api
- annotated API, used to populate OpenAPI doc; defines request and response POJOs -
controller
- defines@RestController
classes (which implement api classes) and@Mapper
classes (which convertservice.model
objects from/to request/response POJOs)api
service:provider
service:spi
-
persistence:model
- defines DB@Entity
classes and DB query methods (the implementation of which is inpersistence:impl
) -
persistence:impl
- implements DBRepository
interfacespersistence:model
-
service:provider
- implementsservice:spi
; persistsservice.model
objects to/from DB using@Entity
classespersistence:model
-
service:spi
- used by controllers -
tests-data-factory
- provides factories used in tests
service:spi
-
UPDATE: has since been removed
Added in PR #63 as a separate container for Ruby services from the RRD prototype.
Contains the code for the abd_vro-service-ruby
package (container image).
List the microservices (which each have an associated Gradle project):
- 2 python assessors
- 1 python pdf generator
- 1 Java client for LH API
svc-lighthouse-api
- 1 Java client for MAS API
svc-mas-api
(in development)
Since the Python microservices have common code, it is extracted into a shared library:
service-python/main-consumer.py
And we have our big services:
- Postgres +
db-init
- RabbitMQ
- Redis
Plus we have our MVC layers initially set up by LH Starterkit:
-
api
defining VRO's API -
controller
for the API -
persistence:model
defining DB Entity classes -
service:db
for DB interactions -
service:spi
containing Java interface and model definitions -
service:provider
containing Camel configurations
A shared
folder where code for common (Java) libraries can be placed (so that the top-level directory isn't more cluttered):
lib-camel-connector
-
domain
(PR Move domain folder to new shared folder #551) - ...
There are tests in LayeredArchitectureTest
to check for undesirable dependencies:
Rule 'Layered architecture consisting of
layer 'API' ('gov.va.starter.example..api..')
layer 'API-Requests' ('gov.va.starter.example..api..requests..')
layer 'API-Responses' ('gov.va.starter.example..api..responses..')
layer 'Controllers' ('gov.va.starter.example..controller..')
layer 'SPI' ('gov.va.starter.example..service.spi..')
layer 'Services' ('gov.va.starter.example..service.provider..')
layer 'Persistence' ('gov.va.starter.example..persistence..')
where layer 'API' may only be accessed by layers ['Controllers']
where layer 'API-Requests' may only be accessed by layers ['Controllers', 'API']
where layer 'API-Responses' may only be accessed by layers ['Controllers', 'API']
where layer 'Controllers' may not be accessed by any layer
where layer 'SPI' may only be accessed by layers ['Controllers', 'Services']
where layer 'Persistence' may only be accessed by layers ['Services']'
For more description, check out LHDI's doc on project structure.