-
Notifications
You must be signed in to change notification settings - Fork 2
Backend Architecture Overview
The nr-forest-client-backend is a reactive, cloud-native REST service engineered with Spring Boot 4 and Java 17, compiled into a native binary via GraalVM Native Image. It provides the core API endpoints that power the frontend single-page application.
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Framework | Spring Boot | 4.1.x | Reactive web application framework |
| Runtime | Java / OpenJDK | 17 LTS | Core language runtime |
| Reactive Web | Spring WebFlux | 4.1.x | Non-blocking, asynchronous reactive request handling |
| HTTP Client | Spring WebClient | 4.1.x | Reactive client for external API communication |
| Database Driver | R2DBC PostgreSQL | Modern | Reactive non-blocking database access |
| Native Compilation | GraalVM Native Image | 21+ | Sub-second startup time and reduced memory usage |
| Security & Auth | Spring Security + Nimbus JOSE | 6.5.x / 10.x | Bearer JWT decoding, validation, and role extraction |
| JSON Stack | Jackson 3 | 3.x | Reactive JSON serialization and deserialization |
| Tracing & Metrics | Micrometer + OpenTelemetry | 1.17.x / 1.64.x | Distributed trace propagation and observability |
| Testing | JUnit 5/6, Mockito, Testcontainers | Latest | Unit, reactive StepVerifier, and containerized tests |
Unlike traditional servlet containers (Tomcat), Spring WebFlux utilizes Project Reactor's Mono and Flux publishers built on Netty. From HTTP ingress to R2DBC database queries, threads are non-blocking, enabling high concurrency with low memory footprint.
The backend is configured with GraalVM Native Build Tools:
- Ahead-of-Time (AOT) compilation eliminates JVM bytecode interpretation overhead.
- Instantaneous container startup (typically under 100ms on OpenShift).
- Predictable memory footprint (~50-80MB RSS under load).
- Inbound HTTP requests require an
Authorization: Bearer <JWT>header containing an identity token issued by FAM (AWS Cognito). - The
SecurityConfigurationvalidates token signature, issuer, and expiry using Nimbus JOSE. - User roles (
CLIENT_VIEWER,CLIENT_EDITOR,CLIENT_ADMIN,CLIENT_SUSPEND) and provider claims (idir,bceidbusiness,bcsc) are parsed and mapped to SpringGrantedAuthorityobjects for method and route security.
All outbound communications to external services utilize configured WebClient instances with timeout and retry policies:
- BC Registry: Queries corporate registry status, incorporation number, and company name matching.
- Canada Post AddressComplete: Resolves street addresses, postal codes, and provincial jurisdictions.
- CHES (Common Hosted Email Service): Asynchronously dispatches transaction notification emails.
-
Legacy Connector: Communicates with the
nr-forest-client-legacyservice to query historic Oracle records.
-
Distributed Tracing: OpenTelemetry traces and spans propagate through incoming headers (
traceparent,X-B3-TraceId). -
Health Checks & Metrics: Spring Boot Actuator endpoints (
/actuator/health,/actuator/metrics) expose readiness and liveness probes to OpenShift.
This wiki serves as the central documentation and knowledge base for the Forests Client Management System, maintained by the British Columbia Ministry of Forests.
Please Note:
- This wiki is a living document maintained by the development team and contributors.
- When making substantial architectural or code changes, remember to update the corresponding wiki documentation.
- Always verify critical environment configurations against team vaults and OpenShift secret managers.
Have questions, found a documentation discrepancy, or need clarification?
- Questions or Bug Reports: Open an issue in the GitHub repository
- Pull Requests: Submit code or doc improvements via Pull Requests
- Database Schema Reference: Explore our SchemaSpy ER Diagrams
Forest Client Wiki | GitHub Repository
- Architecture Overview
- Frontend Architecture
- Frontend Structure
- Backend Architecture
- Backend Structure
- Legacy Architecture
- Processor Architecture
- Data Model
- Development Overview
- Local Setup & Docker
- Frontend Setup
- Backend Setup
- Project Conventions
- Frontend Structure Guidelines