Multi-module layout

Projects with multiple independent runtimes use a modules/ directory at the root. Every module lives inside modules/ — never directly at the project root.

Layout

trgclub/ ├── modules/ │ ├── backend/ # Rails API (trgclub-api) │ │ ├── .module/ │ │ │ └── make/main.mk │ │ ├── .infra/ │ │ │ ├── build-args │ │ │ ├── k8s/ │ │ │ └── terraform/ │ │ └── Makefile │ └── frontend/ # Next.js (trgclub-web) │ ├── .module/ │ │ └── make/main.mk │ ├── .infra/ │ │ ├── build-args │ │ ├── k8s/ │ │ └── terraform/ │ └── Makefile ├── .project/ │ ├── docker/compose/services.yml │ └── docs/ ├── .commons -> ... ├── Makefile ├── compose.yml ├── .env.example └── .gitignore

Modules

Module Stack Source repo Port
backend Rails API trgclub-api 4005
frontend Next.js trgclub-web 3005

DNS

Environment Module Endpoint (beta) Endpoint (definitivo)
staging backend beta.staging.api.trgclub.com api.trgclub.com
staging frontend beta.staging.trgclub.com trgclub.com
production backend beta.api.trgclub.com api.trgclub.com
production frontend beta.trgclub.com trgclub.com

Rules

  • Every module lives inside modules/ — never at the project root.
  • Each module is self-contained: its own manifest, tooling config, and .infra/.
  • No cross-module source imports at the language level.
  • Docs and specs always go in .project/docs/ — never in .module/.
  • Infrastructure lives in .infra/ inside each module — never at the project root.