This page describes the current technology stack, the key architectural choices, the infrastructure cost model, the build-versus-buy decisions, the scaling path, and the architectural risks. DomiDo is built by Avvyland Limited (UK) and sells universal blocks and fasteners only; every construction shown on the platform is a user-generated design. The architecture serves a small team operating a public Web/PWA beta and pre-order conversion while staying ready for the longer fulfilment, marketplace, and international expansion that follow. The system uses a modular monolith for the backend in Go, a Progressive Web Application for the frontend on React Native, Expo, and React Three Fiber, and an event-driven asynchronous processing model for the compute-intensive pipelines, and it is optimised against three constraints: a small team (microservices are unjustifiable, and a modular monolith reduces operational complexity and eliminates inter-service communication overhead), a tight infrastructure budget (every technology choice has to justify its cost against a ceiling that stays well under one percent of revenue across the first several years), and a fast launch (pre-existing assets — the dd-mesher engine in Go, a substantial React Native screen base, and a large architecture-documentation set — mean the build period is integration rather than greenfield).
A single Go binary is deployed in two modes: one binary serves as the application programming interface (API) server and as the asynchronous pipeline worker, with no inter-service communication between them, and the two roles scale independently as Kubernetes Deployments. The Progressive Web Application client delivery uses React Native Web fronted by a content delivery network, which avoids App Store review cycles at the launch surface. Stripe is the sole payment processor: SetupIntent handles Phase A.5 card verification, PaymentIntent handles Phase 2 kit sales, Billing handles subscriptions, and Connect Express handles designer payouts. MongoDB Atlas is the primary data store, with a flexible schema, Atlas Vector Search for image-embedding search, and managed backups. Redis with Asynq runs the asynchronous processing layer so that pipeline jobs are decoupled from the API server, and KEDA (the Kubernetes Event-Driven Autoscaler) provides queue-depth-based scaling, including scale-to-zero for cost efficiency.
The technology stack splits across four working surfaces: frontend, backend, infrastructure, and payment. Each table below is the active set of components rather than a menu of alternatives.
| Component | Technology | Rationale |
|---|---|---|
| UI framework | React Native | Cross-platform code base (web now, native later); large ecosystem. |
| Platform SDK | Expo | Managed workflow; over-the-air updates; PWA build support. |
| React version | Recent React | Concurrent features and lazy loading for the 3D viewer. |
| 3D rendering | React Three Fiber | Declarative Three.js in React; hooks-based API; mature drei ecosystem. |
| State management | Zustand | Minimal boilerplate; no providers; tiny bundle. |
| Language | TypeScript | Type safety; integrated-development-environment support; refactoring confidence. |
| Navigation | React Navigation | Standard React Native navigation; deep linking; tab, stack, and drawer patterns. |
| Data fetching | TanStack Query | Server-state caching; automatic refetch; optimistic updates. |
| Component | Technology | Rationale |
|---|---|---|
| Language | Go | Performance for the CPU-intensive pipeline; goroutine concurrency; single-binary deployment. |
| HTTP router | Chi router on net/http |
Lightweight; middleware-compatible; close to the standard library. |
| Database driver | MongoDB Go driver | Official; full BSON support; change streams. |
| Queue and cache | Asynq with go-redis |
Purpose-built distributed task processing with retry, scheduling, and dead-letter queues. |
| Payment | Stripe Go SDK | Official; strongly typed; webhook verification built in. |
| Authentication | OAuth 2.0 with Proof Key for Code Exchange (PKCE) and JSON Web Tokens (JWT) | Three identity providers (Google, Microsoft, Apple); refresh token rotation; no passwords. |
| Observability | OpenTelemetry Go SDK | Vendor-neutral telemetry; Prometheus and Loki at launch; distributed tracing added at scale. |
| Component | Technology | Rationale |
|---|---|---|
| Container orchestration | K3s (lightweight Kubernetes) | Full Kubernetes API compatibility; lower resource overhead; no managed control plane cost. |
| Cloud provider | Hetzner Cloud | European Union data residency; competitive cost; General Data Protection Regulation compliance. |
| Database | MongoDB Atlas (Flex and M10 managed) | Flexible schema; Vector Search; managed backups; European Union region. |
| Object storage | Hetzner Object Storage (S3-compatible) | Co-located with compute; competitive pricing. |
| Content delivery network and web application firewall | Cloudflare (free plan) | Distributed-denial-of-service protection; transport-layer-security termination; rate limiting. |
| Continuous integration and continuous deployment | GitLab CI/CD (free tier) | Integrated with source; Docker and Kaniko builds. |
| Monitoring | Prometheus, Grafana, Loki | Self-hosted on Kubernetes; PromQL; label-based log querying. |
| Secrets | SOPS with age encryption |
Encrypted secrets in source; no external secrets-manager dependency. |
| Autoscaling | KEDA | Queue-depth-based scaling; scale-to-zero; Kubernetes-native. |
| Ingress | Traefik (K3s default) | Transport-layer-security termination; path-based routing; long-lived server-sent-event connections. |
| Transport-layer security | cert-manager with Let's Encrypt | Automated certificate issuance and renewal. |
| Analytics | A product-analytics provider with a European Union data-residency option | Feature flags; session recording; funnel analysis. |
| Component | Technology | Purpose |
|---|---|---|
| Card verification (Phase A.5) | Stripe SetupIntent via hosted Checkout in setup mode | Zero-charge card verification with Payment Card Industry (PCI) scope as Self-Assessment Questionnaire A (SAQ A). |
| Kit purchase (Phase 2) | Stripe PaymentIntent (off-session for repeats; hosted Checkout for new) | Charge stored payment methods with strong customer authentication via three-domain-secure (3DS). |
| Subscriptions | Stripe Billing via hosted Checkout in subscription mode | Monthly AI design-credit subscriptions with webhook-driven lifecycle. |
| Designer payouts | Stripe Connect Express | Platform-managed onboarding; automated payout scheduling. |
| Payment Card Industry compliance | SAQ A | Hosted Checkout handles all card input. |
Go is the sole backend language because goroutines provide lightweight concurrency for parallel pipeline stages, fast compilation enables sub-second incremental builds, a single static binary simplifies container images, and the standard library covers HTTP, JSON, and cryptography without external dependencies; Node.js was unsuitable for CPU-bound 3D processing, Rust was a steeper curve with slower iteration, and Python carried Global Interpreter Lock (GIL) limits. MongoDB Atlas runs on the M10 tier in a European-Union region because the document schema accommodates evolving design metadata without migrations, Atlas Vector Search provides native vector indexing for image-embedding search and so eliminates a separate vector database, and the managed service eliminates database administration overhead for the small team. React Native plus Expo as the frontend framework gives a single TypeScript codebase that serves the web with architectural readiness for future native builds, React Three Fiber provides declarative Three.js in React, and the Expo managed workflow reduces operations overhead; the viewer adds bundle size, which is mitigated by code splitting and lazy loading.
Stripe is the only payment provider that supports all three of the platform's requirements simultaneously — SetupIntent for zero-charge card verification in Phase A.5, PaymentIntent for physical goods in Phase 2, and Connect Express for marketplace payouts — and hosted Checkout reduces Payment Card Industry scope to SAQ A. Hetzner Cloud provides European-Union data residency, materially lower cost than the main hyperscalers, and General Data Protection Regulation compliance, with a comparable European Union cloud provider held in reserve as the fallback. K3s is a lightweight Kubernetes distribution with full Kubernetes API compatibility, a lower resource footprint than full Kubernetes, and no managed control-plane cost; the launch-time trade-off is a single control-plane node, and the upgrade path to a high-availability multi-server control plane is documented for Phase B. OAuth-only authentication uses OAuth 2.0 Authorization Code with PKCE for all user authentication, with no email-password registration at all, so password storage, brute-force attacks, credential stuffing, and password-reset flows are eliminated by design; three identity providers (Google, Microsoft, Apple) cover broad audience reach with graceful degradation if one is unavailable. The modular monolith deploys a single Go binary with internal Clean Architecture layers as two Kubernetes Deployments (API server and worker), eliminating inter-service communication overhead, enforcing module boundaries through Go packages and interface contracts, and accepting the trade-off that all modules share a deployment boundary (which is mitigated by layer separation and a strong test suite).
Several additional choices have been accepted as part of the same decision set: Asynq with Redis for asynchronous processing, Server-Sent Events (SSE) for real-time updates over HTTP/1.1, hosted Stripe Checkout for PCI SAQ A compliance, SOPS with age for secret management, Prometheus, Grafana, and Loki for observability, GitLab CI/CD for deployment, Hetzner Object Storage for S3-compatible storage, a vector-embedding model with a 768-dimensional output for gallery search, an established transactional email provider with high deliverability, application-level rate limiting with a Redis sliding-window, Cloudflare content delivery network for static-asset delivery, an open-source load-test framework with a Prometheus exporter, and the Asynq dashboard for queue inspection in Phase A.
The K3s cluster is organised into four namespaces. The application namespace runs the API server, the pipeline worker, the AI orchestration worker, Redis, and the Web/PWA front. The infrastructure namespace runs the certificate manager and the external Domain Name System (DNS) integration. The Kubernetes-system namespace runs the Traefik ingress controller, CoreDNS, and the metrics server. The monitoring namespace runs Prometheus, Grafana, Loki, and the log forwarder. Each service has explicit base replicas, autoscaling rules, and health checks.
| Service | Base replicas | Autoscaling | Health checks |
|---|---|---|---|
| API server (Go) | Two | Horizontal pod autoscaler from two to six on central-processing-unit (CPU) utilisation. | Liveness /healthz at ten seconds; readiness /readyz at five seconds. |
| Web application (React Native Web) | Two | Horizontal pod autoscaler from two to four on CPU utilisation. | Liveness HTTP 200 on / at fifteen seconds. |
| dd-mesher worker | Two | KEDA on queue depth above five. | Liveness process heartbeat at thirty seconds. |
| AI orchestration worker | One | KEDA on queue depth above three. | Liveness process heartbeat at thirty seconds. |
| Redis | One | None at launch. | Liveness redis-cli ping at ten seconds. |
A seven-stage pipeline runs on GitLab CI/CD: lint (go vet, ESLint, Prettier, under two minutes), test (Go tests, Jest, component tests, under five minutes), build (Kaniko container build with no Docker-in-Docker, under three minutes), security (Trivy container scan and dependency audit, under two minutes), deploy to staging (automatic on the main branch, under two minutes), end-to-end test (browser automation against staging, under five minutes), and deploy to production (manual approval, under two minutes). The total target is fifteen to thirty minutes from push to production excluding manual approval. The release strategy uses rolling updates with explicit surge-and-unavailable limits, and automated rollback triggers if the post-deploy error rate exceeds the threshold within a short window.
The launch infrastructure footprint is small: the three Hetzner application servers, the MongoDB Atlas tier, the object storage, and the domain together sit well within the operating budget, and free-tier services cover the content delivery network, the analytics provider, the error tracker, the monitoring frontend, the source repository, and the email provider at launch volumes. As traffic grows past launch, the additional capacity expands incrementally — an extra application server when monthly visitor counts cross a known threshold, MongoDB Atlas usage growth, paid tiers on the analytics, error, and monitoring providers, and additional managed-service line items — and the infrastructure cost remains a small share of revenue across the multi-year projection, well under one percent at scale. Cost-optimisation measures include KEDA scale-to-zero for workers in idle hours, content-delivery-network caching to reduce bandwidth egress, pre-signed object-storage URLs to avoid proxy bandwidth through the API server, MongoDB Atlas auto-scaling, and distroless container images for faster pulls and smaller registry storage.
The build-versus-buy decision criterion is whether the component is a core differentiator (build), a commodity capability (buy), and whether the team has the expertise and the operational appetite for it. Built in-house are the dd-mesher pipeline in Go (core intellectual property, no equivalent product exists for voxelising arbitrary 3D models into interlocking block designs), the API server as a Go modular monolith (the central integration point and the home of custom business logic for the pre-order model, the AI credit system, gallery moderation, and kit bill-of-materials pricing), the AI orchestration worker in Go (custom multi-provider fallback chain with no equivalent orchestration product), the React Native frontend (custom user experience including the 3D assembly viewer, where no off-the-shelf component matches the assembly-guidance, commerce, and gallery combination), and the admin dashboard within the same code base (role-gated routes, simpler than a separate admin tool). Bought or used as a service are Stripe for payment processing (PCI compliance delegation to SAQ A, SetupIntent and PaymentIntent native support, and Financial Conduct Authority-authorised electronic money institution), a multi-provider fallback chain for AI image generation (AI model training is not the team's competence and the fallback ensures resilience), a multi-provider chain for AI 3D model generation (a rapidly evolving field where API access avoids training cost and a provider-abstraction layer keeps the team vendor-agnostic), a European-Union-data-residency analytics provider (feature flags, session recording, funnel analysis), an established error tracker (crash reporting with source-map de-obfuscation), an established transactional-email provider, MongoDB Atlas for database hosting (managed backups, point-in-time recovery, auto-scaling, Vector Search), Cloudflare for CDN and web application firewall (global edge network, distributed-denial-of-service protection), and an open-source load-test framework (Prometheus-exportable results).
The scaling path runs across three phases. The Phase A launch architecture supports a thousand concurrent users, twenty concurrent pipeline jobs, and a couple of hundred long-lived server-sent-event connections; single points of failure are accepted with documented mitigations — a single-node Kubernetes control plane with periodic etcd snapshots, a single Redis instance with workers that reconnect and pipeline state in MongoDB, and a known backend concentration that is being mitigated by documentation and cross-training. The Phase 2 architecture (when kit sales begin) adds a fourth application server once visitor counts cross a known threshold, adds a third-party-logistics integration module to the Go backend when order volume crosses its threshold, auto-scales MongoDB Atlas to a larger tier when CPU utilisation rises, and moves the analytics, error, and monitoring providers to paid plans as free tiers are exceeded. The Phase B architecture for growth at scale expands the cluster to a high-availability configuration with multiple control-plane and worker nodes, replaces single-instance Redis with Redis Sentinel, scales MongoDB Atlas further, and moves Cloudflare to a paid tier; capacity rises to ten thousand concurrent users, a hundred concurrent pipeline jobs, and a couple of thousand long-lived server-sent-event connections, and new capabilities at this stage include distributed tracing, GitOps deployment, native mobile builds for the App Store and Play Store, third-party-logistics integration as a first-class module, high-availability Redis, and high-availability Kubernetes.
The technical risk register lists more than thirty risks, and the top categories for architecture are knowledge concentration (the backend and chief technology officer concentration), General Data Protection Regulation data-breach notification, dependency supply-chain attacks, AI pipeline provider degradation, and AI provider discontinuation; each has an implemented mitigation or a planned one in motion. Infrastructure-specific risks include the Kubernetes control-plane single-node single-point-of-failure, the Redis data-loss window between snapshots, a single-data-centre outage, the age private key for secrets, and a disaster-recovery procedure that must be tested. Third-party dependency risks include payment-provider fee or application programming interface changes, OAuth provider outage, and embedding-model discontinuation, each mitigated by an abstraction layer and a documented alternative. A monthly risk review evaluates the cost trend against the operating plan, a quarterly risk review re-assesses the full register, an annual review covers PCI SAQ A, General Data Protection Regulation, and the value-added-tax threshold position, and every phase transition triggers a re-assessment in the new context.