platform capa

platform-subdivision-plan-api

The plan application's server as a mountable library: connect to the plan's own database, apply the auth and plan schemas, and serve the rows, the checks, the sources, the renders and the exported page as JSON and SVG behind a session, with the staff-ui bundle as the fallback.

The plan application's server as a mountable library: connect to the plan's own database, apply the auth and plan schemas, and serve the rows, the checks, the sources, the renders and the exported page as JSON and SVG behind a session, with the staff-ui bundle as the fallback.

Tierplatform
Roleadapter
Pathcrates/platform/subdivision-plan-api
Edition2021
Targetsplatform_subdivision_plan_api
Public items23 across 0 modules
Tests1

What it is for

The plan application's server, as a library a host mounts.

What a host keeps for itself is the process: tracing, the connection, the listener. What lives here is everything the browser talks to: login and sessions from application-auth, the plan's rows as JSON, the renders as SVG, the exported page as HTML, and the staff-ui bundle as the fallback for every other path.

Capabilities

crate root

The plan application's server, as a library a host mounts.

Item
async fn connect(var : & str) -> PgPool
async fn ensure_schema(pool : & PgPool, url : & str) -> Result <(), String>
async fn app(pool : PgPool, spa_dist : & std::path::Path) -> Router

ApiError

The plan application's server, as a library a host mounts.

Item
ApiError :: fn into_response(self) -> Response
ApiError :: fn from(e : sqlx::Error) -> Self

AppState

The plan application's server, as a library a host mounts.

Item
pub struct AppState
fn plan_router() -> Router <AppState>

CheckDto

The plan application's server, as a library a host mounts.

Item
pub struct CheckDto

LayerDto

The plan application's server, as a library a host mounts.

Item
pub struct LayerDto

LotDto

The plan application's server, as a library a host mounts.

Item
pub struct LotDto

MeasurementDto

The plan application's server, as a library a host mounts.

Item
pub struct MeasurementDto

NormDto

The plan application's server, as a library a host mounts.

Item
pub struct NormDto

OriginDto

The plan application's server, as a library a host mounts.

Item
pub struct OriginDto

PartDto

The plan application's server, as a library a host mounts.

Item
pub struct PartDto

PgPool

The plan application's server, as a library a host mounts.

Item
PgPool :: fn from_ref(s : & AppState) -> PgPool

ProvenanceDto

The plan application's server, as a library a host mounts.

Item
pub struct ProvenanceDto

RenderDto

The plan application's server, as a library a host mounts.

Item
pub struct RenderDto

RenderListDto

The plan application's server, as a library a host mounts.

Item
pub struct RenderListDto

SectionDto

The plan application's server, as a library a host mounts.

Item
pub struct SectionDto

SourceDto

The plan application's server, as a library a host mounts.

Item
pub struct SourceDto

Summary

The plan application's server, as a library a host mounts.

Item
pub struct Summary

Tally

The plan application's server, as a library a host mounts.

Item
pub struct Tally

TestDto

The plan application's server, as a library a host mounts.

Item
pub struct TestDto

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub struct AppState
PgPool :: fn from_ref(s : & AppState) -> PgPool
async fn connect(var : & str) -> PgPoolConnect to the database named by an environment variable, or refuse to guess one.
async fn ensure_schema(pool : & PgPool, url : & str) -> Result <(), String>Apply the auth schema and the plan schema; seed the admin named by PLAN_KM3_ADMIN_EMAIL and PLAN_KM3_ADMIN_PASSWORD when both are set.
ApiError :: fn into_response(self) -> Response
ApiError :: fn from(e : sqlx::Error) -> Self
pub struct Tally
pub struct Summary
pub struct LayerDto
pub struct LotDto
pub struct PartDto
pub struct SectionDto
pub struct CheckDto
pub struct MeasurementDto
pub struct SourceDto
pub struct NormDto
pub struct RenderListDto
pub struct RenderDto
pub struct OriginDto
pub struct TestDto
pub struct ProvenanceDto
fn plan_router() -> Router <AppState>The plan's routes, every one behind a session.
async fn app(pool : PgPool, spa_dist : & std::path::Path) -> RouterEverything the application serves, as one router: login and sessions, the plan API, and the staff-ui bundle at spa_dist for every other path

No pub use re-exports: every item above is declared in this crate.

Boundary

Reaches into application, domain.

Shares tier platform with 11 other crates: platform-api, platform-corpus-console, platform-customer-ui, platform-disclosure-lab, platform-dto, platform-html-components, platform-leptos-components, platform-privacy-scan-api, … (11 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)platform
Architectural role (taxonomy)adapter
Locationcrates/platform/subdivision-plan-api
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_platform["platform"] --> n_application["application"]
  n_platform["platform"] --> n_domain["domain"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-auth`applicationnoalways
`application-core`applicationnoalways
`application-engine`applicationnoalways
`application-parties`applicationnoalways
`domain-subdivision-plan`domainnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
axum^0.7multipartnoalways
rust_decimal^1serdenoalways
serde^1derive, derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
tokio^1fullnoalways
tower^0.5noalways
tower-http^0.6fs, trace, cors, request-id, fs, set-headernoalways
tower-sessions^0.13noalways
tower-sessions-sqlx-store^0.14postgresnoalways
tracing^0.1noalways
uuid^1v4, v7, serde, jsnoalways

Development. None.

Build. None.

Depended on by. Nothing in this workspace.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  SELF["platform-subdivision-plan-api"]
  SELF -->|runtime| n_application_auth["application-auth"]
  SELF -->|runtime| n_application_core["application-core"]
  SELF -->|runtime| n_application_engine["application-engine"]
  SELF -->|runtime| n_application_parties["application-parties"]
  SELF -->|runtime| n_domain_subdivision_plan["domain-subdivision-plan"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libplatform_subdivision_plan_api`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimeyes
database accessyes
network I/Oyes
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
PLAN_KM3_ADMIN_EMAILsrc/lib.rs
PLAN_KM3_ADMIN_PASSWORDsrc/lib.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests1
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root2000

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc423
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 4
    "No rustdoc detected" : 19

Metrics

MetricValue
Rust source files1
Source lines650
Code lines579
Public API items23
Public modules0
Tests1
Examples0
Cargo features0
Direct runtime dependencies17
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "function" : 4
    "method" : 3
    "struct" : 16
pie showData
    title Rust source composition
    "Code" : 579
    "Blank or comment" : 71

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las platform · Manual