Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit cf05572

Browse files
committed
docs: [#14] update twelve-factor refactoring status to reflect current implementation
- Updated twelve-factor refactoring documentation to show Phase 1 is COMPLETE - Changed status from 'IN PROGRESS' to 'PHASE 1 COMPLETE' with all 12 factors implemented - Updated twelve-factor violations table to show full compliance (all ✅) - Added twelve-factor architecture diagram to main README.md in Mermaid format - Added twelve-factor architecture diagram to copilot-instructions.md in ASCII art format - Updated main README.md to use twelve-factor deployment workflow commands - Documented all working configuration management features: - Environment templates (local.env, production.env.tpl) - Configuration processing (configure-env.sh) - Template rendering (.tpl → actual configs) - Multi-environment support - Updated implementation phases to reflect actual completion status - Fixed documentation to accurately represent the production-ready state
1 parent 31227bc commit cf05572

File tree

3 files changed

+265
-145
lines changed

3 files changed

+265
-145
lines changed

.github/copilot-instructions.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,48 @@ We are migrating the tracker to a new infrastructure on Hetzner, involving:
4040
- Migrating the database from SQLite to MySQL
4141
- Implementing Infrastructure as Code for reproducible deployments
4242

43+
## 🏗️ Twelve-Factor Architecture
44+
45+
This project implements a complete twelve-factor app architecture with clear separation between infrastructure provisioning and application deployment:
46+
47+
### Current Working Architecture (Twelve-Factor Compliant)
48+
49+
```text
50+
┌─────────────────────────────────────────────────────────────┐
51+
│ Configuration Management │
52+
├─────────────────────────────────────────────────────────────┤
53+
│ • Environment Templates (local.env, production.env.tpl) │
54+
│ • Configuration Processing (configure-env.sh) │
55+
│ • Template Rendering (.tpl → actual configs) │
56+
└─────────────────────────────────────────────────────────────┘
57+
58+
59+
┌─────────────────────────────────────────────────────────────┐
60+
│ Infrastructure Layer │
61+
├─────────────────────────────────────────────────────────────┤
62+
│ • VM Provisioning (provision-infrastructure.sh) │
63+
│ • Environment-specific Setup (templated cloud-init) │
64+
│ • Provider Abstraction (local implemented, cloud planned) │
65+
└─────────────────────────────────────────────────────────────┘
66+
67+
68+
┌─────────────────────────────────────────────────────────────┐
69+
│ Application Layer │
70+
├─────────────────────────────────────────────────────────────┤
71+
│ • Environment-aware Deployment (templated configs) │
72+
│ • Dynamic Service Configuration │
73+
│ • Comprehensive Health Validation │
74+
└─────────────────────────────────────────────────────────────┘
75+
```
76+
77+
### Key Implementation Features
78+
79+
- **Complete Twelve-Factor Compliance**: All 12 factors implemented and operational
80+
- **Infrastructure/Application Separation**: Clean separation with `make infra-apply` and `make app-deploy`
81+
- **Environment-based Configuration**: Template system with environment switching
82+
- **Build/Release/Run Stages**: Proper separation of configuration processing, deployment, and execution
83+
- **Multi-environment Support**: Local development with production parity
84+
4385
## 📁 Repository Structure
4486

4587
```text

README.md

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,46 @@ This repository is organized into distinct concerns:
5050
- Security and auditing information
5151
- Cross-cutting concerns
5252

53+
## 🏗️ Twelve-Factor Architecture
54+
55+
This project implements a complete [twelve-factor app](https://12factor.net/) architecture with
56+
clear separation between infrastructure provisioning and application deployment:
57+
58+
```text
59+
┌─────────────────────────────────────────────────────────────┐
60+
│ Configuration Management │
61+
├─────────────────────────────────────────────────────────────┤
62+
│ • Environment Templates (local.env, production.env.tpl) │
63+
│ • Configuration Processing (configure-env.sh) │
64+
│ • Template Rendering (.tpl → actual configs) │
65+
└─────────────────────────────────────────────────────────────┘
66+
67+
68+
┌─────────────────────────────────────────────────────────────┐
69+
│ Infrastructure Layer │
70+
├─────────────────────────────────────────────────────────────┤
71+
│ • VM Provisioning (provision-infrastructure.sh) │
72+
│ • Environment-specific Setup (templated cloud-init) │
73+
│ • Provider Abstraction (local implemented, cloud planned) │
74+
└─────────────────────────────────────────────────────────────┘
75+
76+
77+
┌─────────────────────────────────────────────────────────────┐
78+
│ Application Layer │
79+
├─────────────────────────────────────────────────────────────┤
80+
│ • Environment-aware Deployment (templated configs) │
81+
│ • Dynamic Service Configuration │
82+
│ • Comprehensive Health Validation │
83+
└─────────────────────────────────────────────────────────────┘
84+
```
85+
86+
### Key Features
87+
88+
- **Complete Twelve-Factor Compliance**: All 12 factors implemented
89+
- **Infrastructure/Application Separation**: Clean separation with `make infra-apply` and `make app-deploy`
90+
- **Environment-based Configuration**: Template system with `local.env` and `production.env.tpl`
91+
- **Build/Release/Run Stages**: Proper separation of configuration processing, deployment, and execution
92+
5393
## Demo Tracker
5494

5595
- **HTTP Tracker**: <https://tracker.torrust-demo.com/announce>
@@ -70,22 +110,28 @@ For detailed setup instructions, see the specific documentation:
70110
- **Infrastructure**: [Infrastructure Quick Start](infrastructure/docs/quick-start.md)
71111
- **Application**: [Application README](application/README.md)
72112

73-
### Complete Development Setup
113+
### Complete Development Setup (Twelve-Factor Workflow)
74114

75115
```bash
76116
# 1. Setup infrastructure dependencies
77117
make dev-setup
78118
# Log out and log back in for group permissions
79119

80-
# 2. Configure SSH key
120+
# 2. Configure local environment
81121
make infra-config-local
82122
# Edit infrastructure/terraform/local.tfvars with your SSH public key
83123

84-
# 3. Deploy VM and application
85-
make infra-apply # Deploy VM
86-
make vm-ssh # Access VM
87-
docker compose -f application/compose.yaml up -d # Deploy application
88-
make infra-destroy # Clean up
124+
# 3. Deploy infrastructure and application (twelve-factor workflow)
125+
make infra-apply ENVIRONMENT=local # Deploy VM (infrastructure only)
126+
make app-deploy ENVIRONMENT=local # Deploy application (Build + Release + Run)
127+
make app-health-check ENVIRONMENT=local # Validate deployment
128+
129+
# 4. Access VM and check status
130+
make vm-ssh # Access VM
131+
make infra-destroy ENVIRONMENT=local # Clean up
132+
133+
# Alternative: Complete workflow in one command
134+
make dev-deploy ENVIRONMENT=local # Does all steps 3-4
89135
```
90136

91137
## 📚 Documentation

0 commit comments

Comments
 (0)