Modern enterprise platform built with Spring Boot 4
Modern enterprise platform built with Spring Boot 4
This repository is the backend of the five-repo ArchForge project. It builds two Spring Boot applications from one codebase: the admin (:8080) API consumed by ArchForgeAdmin, and the C-end (:8081) API consumed by ArchForgeWeb.
server-admin (B-end, {code,message,data} envelope) and server-web (C-end, RFC 9457 ProblemDetail), each with its own sa-token realmspec/openapi.yaml owns OpenAPI 3.1 + enums in this repo; CI diffs the live spec against it and blocks breaking changes./archforge bootstraps env secrets, docker infra, DB backups, AI skills, MCPSystem context — how the five sibling repositories fit together:
flowchart LR
subgraph clients["Frontends"]
A["ArchForgeAdmin
Vue 3 · :8848"]
W["ArchForgeWeb
Next.js · :3000"]
end
subgraph backend["this repo — two Spring Boot apps"]
SA["server-admin :8080
B-end API"]
SW["server-web :8081
C-end API"]
SPEC["spec/
OpenAPI · enums · rules"]
end
PG[("PostgreSQL 17")]
RD[("Redis 7")]
A -->|"REST /api"| SA
W -->|"REST + SSE"| SW
SA --> PG & RD
SW --> PG & RD
SPEC -. "openapi.yaml (breaking-change CI gate)" .-> SA
SPEC -. "generated TS types" .-> A
SPEC -. "generated TS types" .-> WBackend module layering — every Java module is prefixed with archforge-:
…Layering is enforced by tests: controllers never touch repositories, domain modules never depend on server packages, and every rule fails if it accidentally matches zero classes. See ArchitectureTest.
The full story lives in the architecture guide.
Prerequisites: Java 25, Docker.
git clone [email protected]:sofn/ArchForge.git && cd ArchForge
./archforge init --write # .env secrets + postgres/redis containers + Flyway migrate
# Load .env into your shell, then start the admin app:
set -a; source .env; set +a # Linux/macOS
# Windows cmd: for /f "usebackq tokens=1,2 delims==" %a in (".env") do set "%a=%b"
# Windows pwsh: Get-Content .env | ? { $_ -match '^([^#=]+)=(.*)$' } | % { [Environment]::SetEnvironmentVariable($Matches[1], $Matches[2]) }
./gradlew :archforge-server-admin:bootRunDefault admin login is admin / admin123 (captcha is on in dev). C-end API:
./gradlew :archforge-server-web:bootRunStpAdminUtil + class-level @SaCheckLogin + write @SaCheckPermission("resource:action").StpWebUtil + WebAuthInterceptor, refresh-token flow with single-use rotation.@RateLimit).DB_PASSWORD, ARCH_FORGE_RSA_PRIVATE_KEY, and storage keys; missing RSA in prod fails fast.| Module | Purpose |
|---|---|
archforge-common/archforge-common-{base,error,jpa} |
shared kernels: utils, ErrorCode framework, JPA conventions |
archforge-builtin/archforge-admin-user |
users, roles, menus, depts, dicts (DDD) |
archforge-builtin/archforge-meta-runtime |
low-code table engine — runtime (definition model, dynamic CRUD, datascope) |
archforge-builtin/archforge-meta-designer |
low-code table engine — design-time only (codegen, DDL, import); never published |
archforge-module-cms |
articles, categories |
archforge-module-task |
task domain |
archforge-infrastructure |
sa-token config, Redis, dynamic datasources, security filters |
archforge-server-admin |
B-end application (:8080) |
archforge-server-web |
C-end application (:8081) |
archforge-starters/* |
cache / lock / redisson / trace starters |
archforge-cli |
./archforge developer CLI + MCP server |
archforge-dependencies |
version platform (BOM) |
Non-Gradle dirs stay unprefixed: docker/, config/, scripts/, .agents/.
./gradlew build # spotless + compile + all tests
./gradlew test -Ptags=P0,contract # only tagged tests
./gradlew build -PexcludeTags=slow # skip container-backed integration tests
./gradlew jacocoAggregateReport # merged coverage reportWhat CI enforces on every PR (ci.yml):
| Gate | Mechanism |
|---|---|
| Diff coverage ≥ 60% | diff-cover on the aggregated JaCoCo report |
| No breaking API changes | oasdiff live spec vs spec/openapi.yaml (on the target branch) |
| Error codes documented | scripts/check-error-codes.py vs docs/specs/error-codes.md |
| Frontend SDK in sync | git diff --exit-code after regenerating schema.d.ts (in Web/Admin repos) |
| Architecture rules | ArchUnit with failOnEmptyShould=true |
./archforge --help
./archforge init --write # one-time: .env secrets + deps + Flyway migrate
./archforge dev # local dev stack (detached; logs/ + run/*.pid)
./archforge up # containerized full stack
./archforge up -p allinone # one container: nginx + both servers + next.js
./archforge status | doctor # what's running / env health check
./archforge db backup | db restore
./archforge skills install claude
./archforge mcp # MCP stdio serverSee archforge-cli/README.md for the full command reference.
The ./archforge wrapper rebuilds the CLI jar when sources changed and
fails fast if java is older than JDK 25.
Windows: run archforge.bat instead — same commands (archforge --help, archforge init --write, …). It builds the jar via gradlew.bat on first run and needs java on PATH.
| Layer | Choice |
|---|---|
| Runtime | Java 25 (preview), Spring Boot 4.1.0, Gradle 9.5.1 |
| Auth | sa-token 1.45.0 (StpAdminUtil / StpWebUtil) |
| Data | PostgreSQL 17, Flyway 12.4.0, dynamic-datasource, Redis 7 |
| Observability | Micrometer + OpenTelemetry 1.62.0 |
| Storage | Local dir or AWS S3 SDK 2.46.x |
| Style | Spotless + Eclipse formatter, JSpecify @NullMarked |
Canonical conventions: .agents/skills/archforge-project-standard/standard.md.
No open issues yet, or sync has not completed.