Crate ifc_lite_server

Crate ifc_lite_server 

Source
Expand description

IFC-Lite Server - High-performance IFC processing server.

This server provides a REST API for parsing IFC files and extracting geometry. It supports:

  • Full synchronous parsing with caching
  • Streaming Server-Sent Events for progressive rendering
  • Quick metadata extraction without geometry processing

Β§Endpoints

  • GET /api/v1/health - Health check
  • POST /api/v1/parse - Full parse with all geometry (JSON)
  • POST /api/v1/parse/stream - Streaming parse (SSE)
  • POST /api/v1/parse/metadata - Quick metadata only
  • POST /api/v1/parse/parquet - Full parse with Parquet-encoded geometry (~15x smaller)
  • POST /api/v1/parse/parquet/optimized - ara3d BOS-optimized format (~50x smaller)
  • GET /api/v1/parse/symbolic/:cache_key - 2D symbol stream (IfcAnnotation + IfcGrid) as JSON
  • GET /api/v1/cache/:key - Retrieve cached result
  • DELETE /api/v1/cache/:key - Invalidate every cache entry for the source file a cache_key names

ModulesΒ§

admission πŸ”’
Request admission control: bounded parse concurrency + a byte-weighted memory budget + a coarse RSS circuit breaker.
config πŸ”’
Server configuration loaded from environment variables.
error πŸ”’
Error types and handling for the server.
in_flight πŸ”’
In-memory marker for β€œa data-model write is running right now for this cache key” (issue #5129).
mem_policy πŸ”’
Memory-budget policy: the readers and the resolver that decide the admission byte budget at startup.
middleware πŸ”’
Middleware modules.
panic_strategy πŸ”’
Self-check for the panic strategy this binary was actually built with.
routes πŸ”’
API routes for the IFC server.
services πŸ”’
Service modules for IFC processing and caching.
types πŸ”’
Type definitions for API requests and responses.
write_timeout πŸ”’
Connection-level write-idle enforcement.

StructsΒ§

AppState
Application state shared across handlers.

EnumsΒ§

LogDecision πŸ”’
Startup log level for the memory-admission β€œgate off” branch in main, derived purely from the re-parsed IFC_MEM_BUDGET_MB env var (#1547).

ConstantsΒ§

BODY_LIMIT_SLACK_MB πŸ”’
Slack added on top of max_file_size_mb for the raw framework-level body limit β€” covers multipart boundary/header overhead so the app’s own FileTooLarge check (clean 413) is what rejects an oversized file, not axum’s raw limit (generic 400 MultipartError).

StaticsΒ§

GLOBAL πŸ”’

FunctionsΒ§

build_cors_layer πŸ”’
Build CORS layer based on configuration.
build_router πŸ”’
Build the application router with all routes and middleware.
main πŸ”’
memory_admission_log_level πŸ”’
Pure decision for LogDecision from the resolved IFC_MEM_BUDGET_MB env var: None (unset/unparseable), Some(0) (explicit opt-out), or Some(n) with n > 0 (an explicit positive budget).