Skip to main content

CODITECT Cloud Infrastructure - Project Structure

Production-Ready Directory Organization

Last Updated: November 23, 2025


πŸ“‚ Directory Structure Overview​

coditect-cloud-infra/
β”œβ”€β”€ .coditect/ # Symlink to distributed intelligence
β”œβ”€β”€ .claude/ # Symlink for Claude Code compatibility
β”œβ”€β”€ .github/ # GitHub Actions workflows
β”‚ β”œβ”€β”€ workflows/
β”‚ β”‚ β”œβ”€β”€ tofu-plan.yml # PR validation
β”‚ β”‚ └── tofu-apply.yml # Deployment automation
β”‚ └── ISSUE_TEMPLATE/
β”œβ”€β”€ docs/ # Comprehensive documentation
β”‚ β”œβ”€β”€ README.md # Documentation index ⭐ START HERE
β”‚ β”œβ”€β”€ architecture/ # C1-C3 architecture diagrams
β”‚ β”‚ β”œβ”€β”€ c1-system-context.md
β”‚ β”‚ └── c2-container-diagram.md
β”‚ β”œβ”€β”€ workflows/ # Sequence diagrams (5 files)
β”‚ β”‚ β”œβ”€β”€ user-registration-flow.md
β”‚ β”‚ β”œβ”€β”€ license-acquisition-workflow.md
β”‚ β”‚ β”œβ”€β”€ heartbeat-mechanism.md
β”‚ β”‚ β”œβ”€β”€ zombie-session-cleanup.md
β”‚ β”‚ └── graceful-license-release.md
β”‚ β”œβ”€β”€ project-management/ # Project planning documents
β”‚ β”‚ └── checkpoints/
β”‚ β”‚ β”œβ”€β”€ P1-T01-COMPLETION-SUMMARY.md
β”‚ β”‚ β”œβ”€β”€ P1-T02-COMPLETION-SUMMARY.md
β”‚ β”‚ └── PHASE-0-COMPLETION-SUMMARY.md
β”‚ β”œβ”€β”€ critical-path-analysis.md # 6-7 day roadmap to MVP
β”‚ β”œβ”€β”€ gap-analysis.md # Current vs target state
β”‚ β”œβ”€β”€ implementation-roadmap.md # 5-phase development plan
β”‚ β”œβ”€β”€ gcp-infrastructure-inventory.md # Deployed resources
β”‚ β”œβ”€β”€ gcp-setup.md # Initial GCP configuration
β”‚ β”œβ”€β”€ security-advisory-2025-11-23.md # Security best practices
β”‚ └── coditect-application-integration.md # End-to-end system docs
β”œβ”€β”€ diagrams/ # Visual diagrams (future)
β”œβ”€β”€ kubernetes/ # Kubernetes manifests
β”‚ β”œβ”€β”€ base/
β”‚ β”œβ”€β”€ overlays/
β”‚ β”‚ β”œβ”€β”€ dev/
β”‚ β”‚ β”œβ”€β”€ staging/
β”‚ β”‚ └── prod/
β”‚ └── helm/
β”œβ”€β”€ opentofu/ # Infrastructure as Code (OpenTofu/OpenTofu)
β”‚ β”œβ”€β”€ modules/ # Reusable OpenTofu modules
β”‚ β”‚ β”œβ”€β”€ networking/
β”‚ β”‚ β”œβ”€β”€ gke/
β”‚ β”‚ β”œβ”€β”€ database/
β”‚ β”‚ └── redis/
β”‚ └── environments/ # Environment configurations
β”‚ β”œβ”€β”€ dev/
β”‚ β”œβ”€β”€ staging/
β”‚ └── prod/
β”œβ”€β”€ research/ # Research documents and planning
β”œβ”€β”€ scripts/ # Utility scripts
β”‚ β”œβ”€β”€ bootstrap.sh
β”‚ β”œβ”€β”€ deploy.sh
β”‚ β”œβ”€β”€ update_tasklist.py
β”‚ └── teardown.sh
β”œβ”€β”€ tests/ # Infrastructure tests (Terratest)
β”œβ”€β”€ .env.example # Environment variable template
β”œβ”€β”€ .gitignore # Git ignore patterns
β”œβ”€β”€ .gitmessage # Git commit message template
β”œβ”€β”€ .pre-commit-config.yaml # Pre-commit hooks
β”œβ”€β”€ CLAUDE.md # AI agent configuration
β”œβ”€β”€ CODE_OF_CONDUCT.md # Community guidelines
β”œβ”€β”€ CODEOWNERS # GitHub code ownership
β”œβ”€β”€ CONTRIBUTING.md # Contribution guidelines
β”œβ”€β”€ docker-compose.yml # Local development environment
β”œβ”€β”€ Dockerfile # Container image definition
β”œβ”€β”€ LICENSE # License file
β”œβ”€β”€ project-plan.md # 59KB comprehensive project plan
β”œβ”€β”€ pyproject.toml # Python project configuration
β”œβ”€β”€ README.md # Project overview
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ requirements-dev.txt # Development dependencies
β”œβ”€β”€ tasklist.md # Simplified task tracking
└── tasklist-with-checkboxes.md # Detailed progress tracking (91KB)

πŸ“‹ File Categories​

Root Configuration Files​

FilePurposeUpdate Frequency
.env.exampleEnvironment variable templateAs needed
.gitignoreGit ignore patternsRarely
.gitmessageCommit message templateRarely
.pre-commit-config.yamlPre-commit hooks configurationMonthly
docker-compose.ymlLocal development stackAs needed
DockerfileContainer image buildAs needed
pyproject.tomlPython project metadataAs needed
requirements.txtProduction dependenciesWeekly
requirements-dev.txtDevelopment dependenciesWeekly

Project Management Files​

FilePurposeSizeUpdate Frequency
project-plan.mdComplete project plan & roadmap59KBWeekly
tasklist.mdSimplified task list9KBDaily
tasklist-with-checkboxes.mdDetailed progress tracking91KBDaily
README.mdProject overview9KBAs needed

Documentation Files​

Located in docs/ directory (see below)

FilePurpose
LICENSESoftware license
CODE_OF_CONDUCT.mdCommunity guidelines
CONTRIBUTING.mdContribution process
CODEOWNERSGitHub code ownership

πŸ“– Documentation Structure​

Primary Entry Point​

docs/README.md - Complete documentation index

  • Quick status overview
  • Documentation navigation
  • Getting started guides
  • Cross-reference table

Architecture Documentation​

Level 1: System Context

  • docs/architecture/c1-system-context.md - System boundaries and actors

Level 2: Container Architecture

  • docs/architecture/c2-container-diagram.md - All containers and technology stack

Level 3: Component Diagrams (Planned)

  • License API components
  • Admin dashboard components
  • Database schema

Workflow Documentation​

Complete end-to-end flows with code examples:

  1. user-registration-flow.md

    • Google/GitHub OAuth integration
    • Tenant and license creation
    • Email verification
  2. license-acquisition-workflow.md

    • Check-on-start pattern
    • Hardware fingerprinting
    • License signing (Cloud KMS)
  3. heartbeat-mechanism.md

    • Background thread implementation
    • TTL management (5min/6min)
    • Offline mode with grace period
  4. zombie-session-cleanup.md

    • Redis keyspace notifications
    • Automatic seat reclamation
    • Cleanup worker implementation
  5. graceful-license-release.md

    • Signal handlers (SIGINT, SIGTERM)
    • Shutdown sequence
    • Immediate seat reclaim

Planning Documents​

DocumentPurposeSize
critical-path-analysis.md6-7 day roadmap to MVPComprehensive
gap-analysis.mdCurrent vs target stateDetailed
implementation-roadmap.md5-phase development planDetailed

Infrastructure Documents​

DocumentPurpose
gcp-infrastructure-inventory.mdAll deployed GCP resources
gcp-setup.mdInitial GCP project setup
security-advisory-2025-11-23.mdSecurity best practices

Integration Documents​

DocumentPurpose
coditect-application-integration.mdComplete end-to-end system architecture

πŸ—οΈ Infrastructure as Code Structure​

OpenTofu/OpenTofu Modules​

opentofu/
β”œβ”€β”€ modules/ # Reusable modules
β”‚ β”œβ”€β”€ networking/
β”‚ β”‚ β”œβ”€β”€ main.tf # VPC, subnets, firewall
β”‚ β”‚ β”œβ”€β”€ variables.tf # Input variables
β”‚ β”‚ └── outputs.tf # Output values
β”‚ β”œβ”€β”€ gke/
β”‚ β”‚ β”œβ”€β”€ main.tf # GKE cluster configuration
β”‚ β”‚ β”œβ”€β”€ node_pools.tf # Node pool definitions
β”‚ β”‚ └── addons.tf # GKE addons
β”‚ β”œβ”€β”€ database/
β”‚ β”‚ β”œβ”€β”€ main.tf # Cloud SQL instance
β”‚ β”‚ └── users.tf # Database users
β”‚ └── redis/
β”‚ └── main.tf # Memorystore Redis
└── environments/ # Environment-specific configs
β”œβ”€β”€ dev/
β”‚ β”œβ”€β”€ main.tf # Dev environment
β”‚ β”œβ”€β”€ backend.tf # State backend config
β”‚ └── tofu.tfvars # Variable values
β”œβ”€β”€ staging/
└── prod/

Kubernetes Manifests​

kubernetes/
β”œβ”€β”€ base/ # Base configurations
β”‚ β”œβ”€β”€ deployment.yaml
β”‚ β”œβ”€β”€ service.yaml
β”‚ β”œβ”€β”€ ingress.yaml
β”‚ └── configmap.yaml
β”œβ”€β”€ overlays/ # Kustomize overlays
β”‚ β”œβ”€β”€ dev/
β”‚ β”‚ └── kustomization.yaml
β”‚ β”œβ”€β”€ staging/
β”‚ └── prod/
└── helm/ # Helm chart values
β”œβ”€β”€ values-dev.yaml
β”œβ”€β”€ values-staging.yaml
└── values-prod.yaml

πŸ”§ Scripts Directory​

ScriptPurpose
bootstrap.shInitial project setup
deploy.shDeployment automation
teardown.shInfrastructure cleanup
update_tasklist.pyTask list synchronization

πŸ§ͺ Tests Directory​

Infrastructure testing (Terratest):

tests/
β”œβ”€β”€ networking_test.go
β”œβ”€β”€ gke_test.go
β”œβ”€β”€ database_test.go
└── redis_test.go

πŸ“Š Project Status​

Current Completion​

ComponentStatusCompletion
Infrastructureβœ… Deployed100%
Documentationβœ… Complete95%
Backend Application❌ Pending0%
Deployment❌ Pending0%
Client SDK❌ Pending0%
OverallπŸ”„ In Progress35%

Next Milestones​

  1. This Week: Cloud KMS + Identity Platform (2-3 days)
  2. Next Week: Backend development (5-7 days)
  3. Week After: Deployment to GKE (2-3 days)
  4. Target MVP: December 6, 2025

🎯 Directory Organization Guidelines​

Keeping the Root Clean​

Files that MUST stay in root:

  • Configuration files (.env.example, pyproject.toml, docker-compose.yml)
  • Documentation entry points (README.md, project-plan.md, tasklist.md)
  • License and community files (LICENSE, CODE_OF_CONDUCT.md, CONTRIBUTING.md)

Files that should be in subdirectories:

  • Architecture diagrams β†’ docs/architecture/
  • Workflow diagrams β†’ docs/workflows/
  • Planning documents β†’ docs/project-management/
  • Completion summaries β†’ docs/project-management/checkpoints/
  • Utility scripts β†’ scripts/
  • Infrastructure code β†’ opentofu/ or kubernetes/
  • Tests β†’ tests/

Naming Conventions​

Files:

  • Use UPPERCASE-WITH-DASHES.md for top-level documents
  • Use lowercase-with-dashes.md for subdirectory documents
  • Use descriptive names (not generic like doc1.md)

Directories:

  • Use lowercase with dashes or underscores
  • Be specific: project-management not docs/misc
  • Group related files logically

πŸ“ž Support​

Questions? See docs/README.md for complete documentation index

Contributing? Read CONTRIBUTING.md for guidelines


Last Updated: November 23, 2025 Status: Production-Ready Organization Owner: AZ1.AI INC