Skip to main content

OpenBucket — Implementation White Paper

Status: implementation plan (v1). This document specifies how OpenBucket is built, in enough detail that a senior engineer can implement directly from it. It is the operational sibling of ARCHITECTURE.md (the what) and supersedes BACKEND-DESIGN.md (the summary-level how) at the level of code.


Scope

OpenBucket is a single-container, single-process, self-contained S3-compatible object store with an embedded admin UI. One Docker image, one Node process, one host-mounted volume. No external database, no sidecars.

This white paper covers the implementation in five sections:

§SectionOwner concern
1Backend Architecture & BootstrapNestJS topology, the classifier middleware, config, filters, shutdown
2S3 Wire Protocol & SigV4 AuthenticationXML serialization, SigV4 reverse-verify, full operation route table, error taxonomy
3Persistence & Storage LayerMikroORM entities, migrations, path-mirror BlobStore, two-phase commit, crash recovery
4Streaming I/O, Concurrency & Background WorkPUT/GET streaming, multipart, range requests, the background tick scheduler
5Admin API, Frontend, Auth & DeliveryAdmin endpoints, JWT flow, Angular SPA, OpenAPI client gen, Docker, CI

Each section is implementable from the code it contains. Cross-references between sections appear as [see §N].


Locked-in decisions (from BACKEND-DESIGN.md §0)

AreaChoice
HTTP platformExpress adapter
Module topologyOne Nest app, two controller trees (S3 + Admin) sharing services
ORMMikroORM + libsql (SQLite)
Validationnestjs-zod (Zod-derived DTOs, swagger-integrated)
Loggingnestjs-pino
Admin authJWT access (15 m) + refresh in HttpOnly cookie scoped to /api/admin/auth
S3 authSigV4 reverse-verify via aws4; chunked-payload signing rejected in v1
Frontend contractOpenAPI 3 → generated Angular client
Image basenode:22-bookworm-slim (not alpine — argon2 glibc dependency; libsql has both glibc/musl N-API prebuilds)
TestingUnit + e2e (supertest) + S3 conformance (aws-cli, mc, s3cmd)

How to read this document

The sections are intentionally vertically deep. Reading top-to-bottom is the recommended path for an engineer about to implement; reading by section is the right path for an engineer touching a specific subsystem. Each section assumes the locked-in decisions above and the context in ARCHITECTURE.md §§1–11.

The code samples are not pseudocode. File paths are intended to match the resulting source tree. Where an interface is consumed in one section and implemented in another, both sections name the same method signature.