Skip to main content

Core Architecture & Strategy

This section outlines the strategic monorepo architecture, catalog configurations, and logical multi-tenant isolation goals for the tupynambalucas.dev project.

Current Development Focus: "Single-Instance Mastery"

CRITICAL STRATEGY: Our immediate and absolute priority is to deliver a complete, 100% functional, and polished single-instance application (@tupynambalucas-hub/*).

While we have a long-term vision of becoming a multi-tenant SaaS platform, SaaS architectural complexities must not be implemented at this stage. All current development (codebase, database schemas, UI/UX) must remain focused on producing the best possible version of a standalone system for an ecovillage. The transition to a full SaaS model (Phase 6 of the Master Plan) will only be considered after the single-instance application is stable and fully operational.


Completed Milestones

Monorepo Architecture & Workspace Setup

  • Monorepo Workspace Segregation: Structured workspace layers via PNPM Workspaces v11 and Turborepo, segregating hub/, cortex/, studio/, tools/, renderer/, platform/, and docs/ domains.
  • High-Performance Task Orchestration: Integrated Turborepo to orchestrate pipelines, enabling smart target caching and parallel execution of scripts.
  • Unified Configuration Inheritances: Configured root-level tsconfig.base.json and eslint.config.ts extendable by workspace packages via TSConfig extends and ESLint config array definitions.
  • Node 22 & TypeScript ESM Configuration: Converted all packages to use ECMAScript Modules ("type": "module") and compiled with target ESNext for modern syntax support.

Bounded Contexts & Domain Security

  • Strict Bounded Context Isolation: Configured custom ESLint import restrictions (no-restricted-imports) in eslint.config.ts preventing cross-workspace dependencies to guarantee clean, decoupled business logic.
  • Domain-Core Pattern Integration: Established packages/core in hub/ as the Single Source of Truth (SSOT) for data models and schema validators.
  • Unified Dependency Management via Catalogs: Integrated PNPM v11 Catalogs feature in pnpm-workspace.yaml to govern third-party tool versions (e.g., Fastify 5, React 19, TSX, ESLint) across the entire monorepo.

Planned Focus

  • Logical Multi-Tenant Isolation: Ensure instances and portal run completely isolated execution domains.
  • SaaS Platform Evolution: Transition from single-instance deployments to a centralized multi-tenant marketplace model, utilizing a centralized Traefik Edge Router as a single point of entry to dynamically route requests to isolated backend environments.