Getting started
The arch repo service is a library. It is embedded into a jEAP microservice, which supplies the runtime
configuration - the database, the credentials of the systems to import from, and the schedules. There is no
spring-boot-maven-plugin and no application.yml in this repository, and the artifact is not deployable on its
own.
Prerequisites
- A jEAP microservice, i.e. a project whose parent chain reaches
ch.admin.bit.jeap:jeap-spring-boot-parent - A PostgreSQL database for the architecture model
- An OAuth2 authorization server, for the endpoints protected with semantic roles - see Security
Add the dependency
<dependency>
<groupId>ch.admin.bit.jeap</groupId>
<artifactId>jeap-archrepo-instance</artifactId>
<version>${jeap-archrepo.version}</version>
</dependency>
jeap-archrepo-instance is a pom-packaged aggregator pulling in jeap-archrepo-web - which carries the
@SpringBootApplication and all logic - together with jeap-archrepo-test. Depend on jeap-archrepo-web alone
if the instance does not want the test module.
Minimal configuration
spring:
application:
name: my-archrepo-service
datasource:
url: jdbc:postgresql://localhost:5432/archrepo
username: archrepo
password: ${DB_PASSWORD}
server:
servlet:
context-path: /${spring.application.name}
archrepo-config:
environment: dev
archrepo:
openapi-base-url: "https://archrepo.example.com/my-archrepo-service/swagger-ui/index.html?url=/my-archrepo-service/api/openapi/"
update-schedule: "0 35 1 * * *"
api:
secret: "{noop}${ARCHREPO_API_SECRET}"
jeap:
security:
oauth2:
resourceserver:
system-name: "my-system"
That starts a service with no importer active: every importer is registered conditionally on its own configuration, so an instance opts in to the sources it has. See Importers for what to add, and Configuration for the complete property list. Architecture documentation is generated by the jEAP Doc Service from the OAuth2-protected Docs API, not by this service.
jeap.security.oauth2.resourceserver.system-name is what enables semantic authorization, and it is
required: the docs API authorizes every one of its resources with a semantic role, so the
service does not start without it - see Security.
Database
The Flyway migrations ship with jeap-archrepo-persistence under db/migration/common and run while the service
starts. The database user therefore needs permission to create tables in its schema.
Verifying the instance
-
The service starts and the actuator reports it healthy.
-
GET /api/modelanswers with the systems - an empty list on a fresh database. -
Declare the first system and its owning team in the instance configuration, then restart:
archrepo:model:teams:- name: team-bluesystems:- name: footeam: team-blueBoth lists must be non-empty for onboarding to run. For an existing database, export its metadata first; see Configuration for the bootstrap procedure and authoritative deletion semantics.
-
Trigger an update to onboard the system and import its components without waiting for the schedule:
POST /api/jobsContent-Type: application/json{ "type": "UPDATE_MODEL" }See API for the job endpoints and Operations for the rest of the manual maintenance.
Optional: the MCP server for AI agents
Add jeap-archrepo-mcp next to jeap-archrepo-instance to let AI agents search and read the systems and
components of the model via the Model Context Protocol. It needs the external URL of its endpoint; for now its tools
are open to every caller, like GET /api/model:
jeap:
mcp:
security:
resource-uri: https://archrepo.example.com/my-archrepo-service/mcp
See MCP server for the tools, the routing, how to connect a client, and how to require the role
<system-name>_@architecture-model_#read instead.
Related
- Concepts - what the arch repo is for, and the conventions an instance has to follow
- Architecture - what the library is built from
- Importers - the sources the model is built from
- Operations - the jobs, monitoring, and creating the first system
- Configuration - every property
- Security - authentication and the semantic roles
- API - the REST API
- MCP server - the optional tools for AI agents