본문으로 건너뛰기
cccskills
무료GitHub에 공개

architecture

Modular monolith architecture overview for melosys-api. Use when needing to understand module structure, dependencies between modules, where to place new code, or when changes in one module might affect others. Triggers: "architecture", "module dependencies", "where should I put", "which modules", "dependency graph".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md7.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Melosys-API Architecture

Modular monolith with 12 core modules plus the soknad-altinn types module (JAXB-generated classes from an Altinn XSD; depends on nothing internal, used by integrasjon). Understanding the dependency graph is essential for:

  • Knowing where to place new code
  • Understanding what tests to run after changes
  • Avoiding circular dependencies

Module Dependency Graph

                              ┌─────────────┐
                              │     app     │ ← Entry point (Spring Boot)
                              └──────┬──────┘
           ┌──────────────┬─────────┼─────────┬──────────────┐
           │              │         │         │              │
           ▼              ▼         ▼         ▼              ▼
    ┌──────────┐   ┌──────────┐ ┌──────┐ ┌─────────┐  ┌──────────┐
    │frontend- │   │ saksflyt │ │config│ │sikkerhet│  │statistikk│
    │   api    │   └────┬─────┘ └───┬──┘ └────┬────┘  └────┬─────┘
    └────┬─────┘        │           │         │            │
         │              │           │         │            │
         └──────┬───────┴───────────┴─────────┘            │
                │                                          │
                ▼                                          │
         ┌──────────┐                                      │
         │ service  │◄─────────────────────────────────────┘
         └────┬─────┘
              │
    ┌─────────┼─────────┬────────────┐
    │         │         │            │
    ▼         ▼         ▼            ▼
┌────────┐┌────────┐┌──────────┐┌───────────┐
│reposit-││integra-││saksflyt- ││   domain  │
│  ory   ││  sjon  ││   api    │└─────┬─────┘
└───┬────┘└───┬────┘└────┬─────┘      │
    │         │          │            │
    └─────────┴──────────┴────────────┘
                         │
                         ▼
                    ┌─────────┐
                    │  feil   │ ← Base exception module
                    └─────────┘

Module Descriptions

ModulePurposeKey Contents
appSpring Boot entry pointMain class, Flyway migrations, profiles
frontend-apiREST endpoints for melosys-webControllers, DTOs, GraphQL
saksflytSaga orchestrationSaga implementations, step handlers
saksflyt-apiSaga contracts/eventsEvent classes, saga interfaces
serviceBusiness logicCore services, validation, calculations
repositoryData accessJPA repositories, queries
integrasjonExternal systemsPDL, EESSI, Joark, Kafka consumers
domainJPA entitiesEntities, embeddables, converters
sikkerhetSecurityOIDC, ABAC, token handling
configCross-cutting configMDC, Unleash, ShedLock, metrics
statistikkDVH reportingEvent listeners, statistics producers
feilException hierarchyTekniskException, FunksjonellException
soknad-altinnAltinn A1 form typesJAXB classes generated from NAV_MedlemskapArbeidEOS XSD (no internal deps; used by integrasjon)

Dependency Rules

Allowed dependencies (downward only):

app → frontend-api, saksflyt, config, sikkerhet, statistikk, domain
frontend-api → service, repository, domain, sikkerhet, feil
saksflyt → service, saksflyt-api, domain, config, feil
service → repository, integrasjon, saksflyt-api, domain, config, feil
statistikk → service, domain
repository → domain
integrasjon → domain, sikkerhet, config, feil, soknad-altinn
saksflyt-api → domain, config
domain → feil
sikkerhet → feil
config → sikkerhet
feil → (none)

Forbidden: Circular dependencies, upward dependencies

Source of truth: These rules are derived from each module's pom.xml <dependencies> (artifacts under groupId no.nav.melosys, e.g. melosys-domain, melosys-integrasjon). They are hand-maintained here — regenerate from the POMs if module dependencies change.

Impact Analysis

When modifying code, test dependent modules:

If you change...Test these modules
feildomain, service, saksflyt, frontend-api, integrasjon, sikkerhet
domainrepository, service, saksflyt, frontend-api, integrasjon, saksflyt-api
repositoryservice, frontend-api
integrasjonservice
saksflyt-apiservice, saksflyt
servicesaksflyt, frontend-api, statistikk
sikkerhetintegrasjon, frontend-api, config
configservice, saksflyt, saksflyt-api, integrasjon

Placement Guidelines

Type of codeModule
REST endpointfrontend-api
Business logicservice
JPA entitydomain
Repository interfacerepository
External API clientintegrasjon
Saga/workflowsaksflyt (impl), saksflyt-api (contract)
Security filtersikkerhet
Kafka consumerintegrasjon
Kafka producerservice or integrasjon
Statistics listenerstatistikk
Flyway migrationapp
Cross-cutting configconfig
Custom exceptionfeil

Data Flow Examples

REST Request Flow

frontend-api → service → repository → domain
                     ↘→ integrasjon (external calls)

Saga Flow

frontend-api → service → saksflyt-api (event)
                              ↓
                         saksflyt (saga execution)
                              ↓
                         service (steps)

Kafka Event Flow

integrasjon (consumer) → service → domain/repository
service → integrasjon (producer)

Test Module

ModuleType
integrasjonstestIntegration tests with Spring context
arkitekturArchUnit architecture tests

Run integration tests with: mvn verify -pl integrasjonstest

Enforcement

The module-level boundaries above are enforced primarily by Maven: a module can only reference code in modules it declares as <dependencies>. The ArchUnit test arkitektur/src/test/kotlin/no/nav/melosys/ArkitekturTestIT.kt adds a coarser layering check on packages (Controller ..tjenester.gui.. → Service ..service.. → Integrations ..integrasjon.. / Persistence ..repository..), so it is weaker than — not a substitute for — the module dependency rules.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Expert knowledge of Altinn A1 application processing for posted workers in melosys-api. Use when: (1) Understanding Altinn søknad/skjema processing, (2) Debugging MedlemskapArbeidEOS form mapping, (3) Understanding SoeknadMapper transformations, (4) Investigating posted worker application issues, (5) Understanding the MOTTAK_SOKNAD_ALTINN saga flow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

Expert knowledge of Employer/Employment integration (EREG/AAREG) in melosys-api. Use when: (1) Working with organization data from EREG (Enhetsregisteret), (2) Working with employment data from AAREG (Arbeidsforhold), (3) Understanding employer/organization lookup, (4) Debugging employer or employment issues, (5) Understanding the mapping between register data and domain models. Triggers: orgnummer, arbeidsforhold, EREG, AAREG, Enhetsregisteret, registeropplysninger, ansettelsesperiode, saksopplysning.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

Expert knowledge of Behandling (case treatment) domain in melosys-api. Use when: (1) Understanding the behandling lifecycle and status transitions, (2) Debugging issues with behandling creation, status changes, or closure, (3) Understanding relationships between Fagsak, Behandling, and Behandlingsresultat, (4) Investigating why a behandling is stuck or has wrong status, (5) Understanding Behandlingstyper, Behandlingstema, Behandlingsstatus enums, (6) Debugging journalføring or SED-triggered behandling creation, (7) Understanding behandling creation via saksflyt sagas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

Expert knowledge of Behandlingsresultat (treatment result) domain in melosys-api. Use when: (1) Understanding result types and their meaning (FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc.), (2) Working with periods - Lovvalgsperiode, Medlemskapsperiode, Anmodningsperiode, Utpekingsperiode, (3) Debugging vedtak/decision metadata, criteria evaluation, or social insurance charges, (4) Understanding EU/EEA coordination logic and Article 16 exception handling, (5) Working with trygdeavgift (social insurance charge) calculations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

brev

무료

Expert knowledge of Brev (letter generation) in melosys-api. Use when: (1) Producing letters and decision documents (vedtaksbrev), (2) Understanding Dokgen templates and mapping, (3) Configuring letter recipients and distribution, (4) Debugging letter generation issues, (5) Adding new letter types or templates.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

database

무료

Expert knowledge of the melosys-api Oracle database schema. Use when: (1) Writing SQL queries against the melosys database, (2) Understanding table relationships and foreign keys, (3) Debugging data issues by querying the database, (4) Understanding what data is stored where, (5) Creating or modifying Flyway migrations, (6) Mapping domain entities to database tables. Triggers: SQL against melosys DB, table/column lookup, FK relationships, "where is X stored", "what column stores X", "why is data missing", beh_resultat_id, behandlingsresultat_id, saksnummer, schema.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

navikt의 스킬 모두 보기

이 스킬의 문제 신고