# gschamisle/law-orbit architecture

> Architecture diagram of the GitHub repository gschamisle/law-orbit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gschamisle/law-orbit
- Repository: https://github.com/gschamisle/law-orbit

## Overview

법의 궤도는 한국 법령·조문을 인용 관계로 탐색하고, 연결 근거와 공식 원문을 확인하는 공개 웹 제품이며 로컬 개정안 검토 기능도 제공합니다. 주 흐름은 분야·법령·조문 선택에서 연결 지도, 인용 근거, 본문·출처 확인으로 이어집니다. 별도 로컬 흐름은 개정안 파일을 분석해 번호 밀림과 병행개정 후보를 검토합니다. 공개 웹의 일부 내부 호출은 발췌에서 확인되지 않아 README에 명시된 동작만 연결했습니다.

Main entry points: [`web/app.mjs`](https://github.com/gschamisle/law-orbit/blob/main/web/app.mjs) (공개 웹 화면), [`ui/amendment_review_ui.py`](https://github.com/gschamisle/law-orbit/blob/main/ui/amendment_review_ui.py) (개정안 검토 화면), [`core/universe_builder.py`](https://github.com/gschamisle/law-orbit/blob/main/core/universe_builder.py) (분야별 법령 자료), [`app.py`](https://github.com/gschamisle/law-orbit/blob/main/app.py) (로컬 앱)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_explore["법령 탐색"]
  node_webapp["공개 웹 화면<br/>[app.mjs]"]
  node_catalog["정적 자료 로더<br/>[store.mjs]"]
  node_scopequery["조문 범위 필터<br/>[query.mjs]"]
end

subgraph group_content["본문·근거"]
  node_lawpair["법령 쌍 근거<br/>[law-overview.mjs]"]
  node_reading["본문 읽기<br/>[reading.mjs]"]
  node_annex["별표·서식<br/>[annex.mjs]"]
  node_citationengine["인용 파서<br/>[citation_parser.py]"]
  node_lawapi["법령 API 연동<br/>[law_api.py]"]
end

subgraph group_coverage["분야 자료"]
  node_domaindata["분야별 법령 자료"]
  node_taxmap["국세 관계 지도<br/>[law_galaxy.py]"]
  node_localtaxmap["지방세 관계 지도<br/>[local_tax_graph.py]"]
  node_procurement["조달·계약 자료"]
  node_finance["금융 분야 자료<br/>[fsc_universe.py]"]
end

subgraph group_local["로컬 개정 검토"]
  node_localapp["로컬 앱<br/>[app.py]"]
  node_amendui["개정안 검토 화면"]
  node_upload[("업로드 저장<br/>[upload_storage.py]")]
  node_billparser["개정안 파서"]
  node_renumber["번호 이동 분석<br/>[renumber_scan.py]"]
  node_parallel["병행개정 후보<br/>[parallel_matrix.py]"]
  node_draftui["조문 초안 작성<br/>[stage1_draft.py]"]
  node_crossref["인용·준용 점검"]
end

node_reader(("탐색 사용자"))
node_localuser(("로컬 검토 사용자"))

node_reader -->|"선택·탐색"| node_webapp
node_webapp -->|"자료 로드"| node_catalog
node_webapp -->|"범위 필터"| node_scopequery
node_webapp -->|"근거 요청"| node_lawpair
node_webapp -->|"본문 요청"| node_reading
node_webapp -->|"별표 표시"| node_annex
node_reader -->|"근거·출처 확인"| node_webapp
node_lawapi -->|"인용 파싱"| node_citationengine
node_localuser -->|"화면 이용"| node_localapp
node_localapp -->|"검토 화면 표시"| node_amendui
node_amendui -->|"파일 저장"| node_upload
node_upload -->|"본문 분석"| node_billparser
node_amendui -->|"개정문 파싱"| node_billparser
node_amendui -->|"번호 누락 탐색"| node_renumber
node_amendui -->|"대응 후보 표시"| node_parallel
node_localapp -->|"초안 기능 제공"| node_draftui
node_draftui -->|"법령 검색·조회"| node_lawapi
node_draftui -->|"인용 관계 점검"| node_crossref
node_domaindata -.->|"국세 자료 구성"| node_taxmap
node_domaindata -.->|"지방세 자료 구성"| node_localtaxmap
node_domaindata -.->|"분야 자료 구성"| node_procurement
node_domaindata -.->|"분야 자료 구성"| node_finance

click node_webapp "https://github.com/gschamisle/law-orbit/blob/main/web/app.mjs"
click node_catalog "https://github.com/gschamisle/law-orbit/blob/main/web/store.mjs"
click node_scopequery "https://github.com/gschamisle/law-orbit/blob/main/web/query.mjs"
click node_lawpair "https://github.com/gschamisle/law-orbit/blob/main/web/law-overview.mjs"
click node_reading "https://github.com/gschamisle/law-orbit/blob/main/web/reading.mjs"
click node_annex "https://github.com/gschamisle/law-orbit/blob/main/web/annex.mjs"
click node_citationengine "https://github.com/gschamisle/law-orbit/blob/main/core/citation_parser.py"
click node_lawapi "https://github.com/gschamisle/law-orbit/blob/main/core/law_api.py"
click node_domaindata "https://github.com/gschamisle/law-orbit/blob/main/core/universe_builder.py"
click node_taxmap "https://github.com/gschamisle/law-orbit/blob/main/core/law_galaxy.py"
click node_localtaxmap "https://github.com/gschamisle/law-orbit/blob/main/core/local_tax_graph.py"
click node_procurement "https://github.com/gschamisle/law-orbit/blob/main/core/procurement_universe.py"
click node_finance "https://github.com/gschamisle/law-orbit/blob/main/core/fsc_universe.py"
click node_localapp "https://github.com/gschamisle/law-orbit/blob/main/app.py"
click node_amendui "https://github.com/gschamisle/law-orbit/blob/main/ui/amendment_review_ui.py"
click node_upload "https://github.com/gschamisle/law-orbit/blob/main/core/upload_storage.py"
click node_billparser "https://github.com/gschamisle/law-orbit/blob/main/core/draft_bill_parser.py"
click node_renumber "https://github.com/gschamisle/law-orbit/blob/main/core/renumber_scan.py"
click node_parallel "https://github.com/gschamisle/law-orbit/blob/main/core/parallel_matrix.py"
click node_draftui "https://github.com/gschamisle/law-orbit/blob/main/ui/stage1_draft.py"
click node_crossref "https://github.com/gschamisle/law-orbit/blob/main/core/cross_ref_checker.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_catalog,node_scopequery toneBlue
class node_lawpair,node_reading,node_annex,node_citationengine,node_lawapi toneAmber
class node_domaindata,node_taxmap,node_localtaxmap,node_procurement,node_finance toneMint
class node_localapp,node_amendui,node_upload,node_billparser,node_renumber,node_parallel,node_draftui,node_crossref toneRose
class node_reader,node_localuser toneIndigo
```

## Components

### 법령 탐색

- [공개 웹 화면](https://github.com/gschamisle/law-orbit/blob/main/web/app.mjs): `web/app.mjs`
- [정적 자료 로더](https://github.com/gschamisle/law-orbit/blob/main/web/store.mjs): `web/store.mjs`
- [조문 범위 필터](https://github.com/gschamisle/law-orbit/blob/main/web/query.mjs): `web/query.mjs`

### 본문·근거

- [법령 쌍 근거](https://github.com/gschamisle/law-orbit/blob/main/web/law-overview.mjs): `web/law-overview.mjs`
- [본문 읽기](https://github.com/gschamisle/law-orbit/blob/main/web/reading.mjs): `web/reading.mjs`
- [별표·서식](https://github.com/gschamisle/law-orbit/blob/main/web/annex.mjs): `web/annex.mjs`
- [인용 파서](https://github.com/gschamisle/law-orbit/blob/main/core/citation_parser.py): `core/citation_parser.py`
- [법령 API 연동](https://github.com/gschamisle/law-orbit/blob/main/core/law_api.py): `core/law_api.py`

### 분야 자료

- [분야별 법령 자료](https://github.com/gschamisle/law-orbit/blob/main/core/universe_builder.py): `core/universe_builder.py`
- [국세 관계 지도](https://github.com/gschamisle/law-orbit/blob/main/core/law_galaxy.py): `core/law_galaxy.py`
- [지방세 관계 지도](https://github.com/gschamisle/law-orbit/blob/main/core/local_tax_graph.py): `core/local_tax_graph.py`
- [조달·계약 자료](https://github.com/gschamisle/law-orbit/blob/main/core/procurement_universe.py): `core/procurement_universe.py`
- [금융 분야 자료](https://github.com/gschamisle/law-orbit/blob/main/core/fsc_universe.py): `core/fsc_universe.py`

### 로컬 개정 검토

- [로컬 앱](https://github.com/gschamisle/law-orbit/blob/main/app.py): `app.py`
- [개정안 검토 화면](https://github.com/gschamisle/law-orbit/blob/main/ui/amendment_review_ui.py): `ui/amendment_review_ui.py`
- [업로드 저장](https://github.com/gschamisle/law-orbit/blob/main/core/upload_storage.py): `core/upload_storage.py`
- [개정안 파서](https://github.com/gschamisle/law-orbit/blob/main/core/draft_bill_parser.py): `core/draft_bill_parser.py`
- [번호 이동 분석](https://github.com/gschamisle/law-orbit/blob/main/core/renumber_scan.py): `core/renumber_scan.py`
- [병행개정 후보](https://github.com/gschamisle/law-orbit/blob/main/core/parallel_matrix.py): `core/parallel_matrix.py`
- [조문 초안 작성](https://github.com/gschamisle/law-orbit/blob/main/ui/stage1_draft.py): `ui/stage1_draft.py`
- [인용·준용 점검](https://github.com/gschamisle/law-orbit/blob/main/core/cross_ref_checker.py): `core/cross_ref_checker.py`

### Other components

- **탐색 사용자**
- **로컬 검토 사용자**

## Connections

- 탐색 사용자 → 공개 웹 화면: 선택·탐색
- 공개 웹 화면 → 정적 자료 로더: 자료 로드 (evidence: `web/app.mjs`)
- 공개 웹 화면 → 조문 범위 필터: 범위 필터 (evidence: `web/app.mjs`)
- 공개 웹 화면 → 법령 쌍 근거: 근거 요청 (evidence: `web/app.mjs`)
- 공개 웹 화면 → 본문 읽기: 본문 요청 (evidence: `web/app.mjs`)
- 공개 웹 화면 → 별표·서식: 별표 표시 (evidence: `web/app.mjs`)
- 탐색 사용자 → 공개 웹 화면: 근거·출처 확인
- 법령 API 연동 → 인용 파서: 인용 파싱 (evidence: `core/law_api.py`)
- 로컬 검토 사용자 → 로컬 앱: 화면 이용
- 로컬 앱 → 개정안 검토 화면: 검토 화면 표시 (evidence: `app.py`)
- 개정안 검토 화면 → 업로드 저장: 파일 저장 (evidence: `ui/amendment_review_ui.py`)
- 업로드 저장 → 개정안 파서: 본문 분석 (evidence: `core/upload_storage.py`)
- 개정안 검토 화면 → 개정안 파서: 개정문 파싱 (evidence: `ui/amendment_review_ui.py`)
- 개정안 검토 화면 → 번호 이동 분석: 번호 누락 탐색 (evidence: `ui/amendment_review_ui.py`)
- 개정안 검토 화면 → 병행개정 후보: 대응 후보 표시
- 로컬 앱 → 조문 초안 작성: 초안 기능 제공 (evidence: `app.py`)
- 조문 초안 작성 → 법령 API 연동: 법령 검색·조회 (evidence: `ui/stage1_draft.py`)
- 조문 초안 작성 → 인용·준용 점검: 인용 관계 점검 (evidence: `ui/stage1_draft.py`)
- 분야별 법령 자료 → 국세 관계 지도: 국세 자료 구성
- 분야별 법령 자료 → 지방세 관계 지도: 지방세 자료 구성
- 분야별 법령 자료 → 조달·계약 자료: 분야 자료 구성
- 분야별 법령 자료 → 금융 분야 자료: 분야 자료 구성
