The .htaccess Geo-Redirection Testing Monorepo follows a modular architecture with clear separation of concerns.
graph TB
subgraph "Applications Layer"
A[Go Monitor App]
B[Python Tester App]
C[Docker Setup App]
end
subgraph "Shared Layer"
D[.htaccess Rules]
E[GeoIP Mock Service]
F[Common Configurations]
end
subgraph "Tools Layer"
G[Test Scripts]
H[Compiled Binaries]
I[Utilities]
end
subgraph "Infrastructure"
J[Apache Server]
K[Docker Environment]
L[File System Watcher]
end
A --> D
A --> L
B --> E
B --> J
C --> J
C --> K
G --> J
H --> D
D --> J
E --> J
apps/)packages/).htaccess - Geo-redirection rulesgeoip-mock.php - Country simulation servicetools/)sequenceDiagram
participant FM as File Monitor
participant FS as File System
participant TR as Test Runner
participant UI as Terminal UI
FS->>FM: .htaccess file changed
FM->>TR: Trigger test run
TR->>TR: Execute HTTP tests
TR->>UI: Update results
UI->>UI: Refresh display
sequenceDiagram
participant TC as Test Client
participant GM as GeoIP Mock
participant AS as Apache Server
participant HR as .htaccess Rules
TC->>GM: Set country code
TC->>AS: HTTP request with country header
AS->>HR: Apply redirection rules
HR->>AS: Return redirect/response
AS->>TC: HTTP response
TC->>TC: Analyze result
sequenceDiagram
participant PT as Python Tester
participant Countries as Country List
participant Server as Test Server
participant Results as Result Store
PT->>Countries: Iterate through countries
loop For each country
PT->>Server: Test with country code
Server->>PT: Return response
PT->>Results: Store test result
end
PT->>Results: Generate JSON report
GEOIP_COUNTRY_CODE=AU # Country simulation
HTTP_TIMEOUT=30 # Request timeout
TEST_DELAY=1.0 # Delay between tests
LOG_LEVEL=INFO # Logging level
.htaccess - Apache rewrite rulesapps/docker-setup/docker-compose.yml - Service configurationapps/*/go.mod - Go module dependenciesapps/*/requirements.txt - Python dependenciesgraph LR
Dev[Developer] --> Local[Local Environment]
Local --> GM[Go Monitor]
Local --> PT[Python Tests]
Local --> Docker[Docker Services]
graph TB
subgraph "Docker Network"
Apache[Apache Container]
GeoIP[GeoIP Mock Service]
Volume[Shared Volume]
end
Host[Host Machine] --> Apache
Apache --> Volume
GeoIP --> Volume
Volume --> Config[.htaccess Config]