Skip to content

Commit 7224b55

Browse files
committed
Refactor code and enhance maintainability.
1 parent dc771c9 commit 7224b55

31 files changed

Lines changed: 1976 additions & 1372 deletions

code/backend/monitoring/prometheus.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ global:
22
scrape_interval: 15s
33
evaluation_interval: 15s
44
external_labels:
5-
monitor: 'chainfinity'
5+
monitor: "chainfinity"
66

77
alerting:
88
alertmanagers:
@@ -12,22 +12,22 @@ alerting:
1212
rule_files: []
1313

1414
scrape_configs:
15-
- job_name: 'prometheus'
15+
- job_name: "prometheus"
1616
static_configs:
17-
- targets: ['localhost:9090']
17+
- targets: ["localhost:9090"]
1818

19-
- job_name: 'chainfinity_api'
19+
- job_name: "chainfinity_api"
2020
static_configs:
21-
- targets: ['api:8001']
22-
metrics_path: '/metrics'
21+
- targets: ["api:8001"]
22+
metrics_path: "/metrics"
2323
scrape_interval: 10s
2424

25-
- job_name: 'postgres'
25+
- job_name: "postgres"
2626
static_configs:
27-
- targets: ['postgres:5432']
27+
- targets: ["postgres:5432"]
2828
scrape_interval: 30s
2929

30-
- job_name: 'redis'
30+
- job_name: "redis"
3131
static_configs:
32-
- targets: ['redis:6379']
32+
- targets: ["redis:6379"]
3333
scrape_interval: 30s

infrastructure/.env.example

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ChainFinity Environment Variables
2+
# Copy to .env and fill in values - NEVER commit .env to version control
3+
4+
# Database
5+
POSTGRES_DB=chainfinity
6+
POSTGRES_USER=chainfinity
7+
POSTGRES_PASSWORD=CHANGE_ME_STRONG_PASSWORD_HERE
8+
9+
# Redis
10+
REDIS_PASSWORD=CHANGE_ME_STRONG_REDIS_PASSWORD
11+
12+
# Application Secrets
13+
JWT_SECRET=CHANGE_ME_MIN_32_CHARS_RANDOM_STRING
14+
ENCRYPTION_KEY=CHANGE_ME_EXACTLY_32_CHARS_KEY__
15+
16+
# Grafana
17+
GRAFANA_ADMIN_USER=admin
18+
GRAFANA_ADMIN_PASSWORD=CHANGE_ME_STRONG_GRAFANA_PASSWORD
19+
20+
# AWS (for production)
21+
# AWS_ACCESS_KEY_ID=
22+
# AWS_SECRET_ACCESS_KEY=
23+
# AWS_DEFAULT_REGION=us-west-2

infrastructure/.gitignore

Lines changed: 44 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,191 +1,58 @@
1-
# ===============================================================
2-
# ChainFinity Infrastructure .gitignore
3-
# ===============================================================
1+
# Environment & Secrets - NEVER COMMIT
2+
.env
3+
.env.*
4+
!.env.example
5+
*.pem
6+
*.key
7+
*.crt
8+
*.p12
9+
*.pfx
10+
*secret*
11+
*password*
12+
*credentials*
13+
unseal-keys*
14+
root-token*
415

5-
# =========================
616
# Terraform
7-
# =========================
8-
9-
# Local .terraform directories
10-
**/.terraform/*
11-
**/.terraform.lock.hcl
12-
13-
# .tfstate files
1417
*.tfstate
1518
*.tfstate.*
16-
17-
# Crash log files
18-
crash.log
19-
crash.*.log
20-
21-
# Variable files that may contain secrets
19+
*.tfstate.backup
20+
**/.terraform/
21+
.terraform.lock.hcl
2222
terraform.tfvars
23-
*.auto.tfvars
24-
*.auto.tfvars.json
25-
26-
# Plans
27-
*.tfplan
28-
tfplan
29-
30-
# Override files
31-
override.tf
32-
override.tf.json
33-
*_override.tf
34-
*_override.tf.json
35-
36-
# CLI configuration files
37-
.terraformrc
38-
terraform.rc
39-
40-
# =========================
41-
# Ansible
42-
# =========================
43-
44-
# Inventory files with real IPs/hostnames
45-
ansible/inventory/hosts.yml
46-
ansible/inventory/*.yml
47-
!ansible/inventory/hosts.example.yml
48-
49-
# Vault files
50-
ansible/group_vars/*/vault.yml
51-
ansible/host_vars/*/vault.yml
52-
!**/*.example.yml
53-
54-
# Ansible cache
55-
ansible/.ansible/
56-
ansible/**.retry
57-
ansible/**/*.retry
58-
59-
# Ansible facts cache
60-
/tmp/ansible_facts/
61-
62-
# =========================
63-
# Kubernetes
64-
# =========================
65-
66-
# Real secrets (not examples)
67-
kubernetes/base/app-secrets.yaml
68-
kubernetes/*/secrets.yaml
69-
kubernetes/*/*-secrets.yaml
70-
!kubernetes/**/*.example.yaml
71-
72-
# Kustomize build output
73-
kubernetes/build/
23+
!terraform.tfvars.example
24+
plan.out
25+
*.plan
26+
27+
# Python
28+
__pycache__/
29+
*.py[cod]
30+
*.egg-info/
31+
.venv/
32+
venv/
33+
dist/
34+
build/
35+
36+
# Node
37+
node_modules/
38+
.next/
39+
dist/
40+
build/
41+
*.log
7442

75-
# =========================
76-
# General
77-
# =========================
43+
# OS
44+
.DS_Store
45+
Thumbs.db
7846

7947
# IDE
8048
.vscode/
8149
.idea/
8250
*.swp
8351
*.swo
84-
*~
85-
86-
# OS
87-
.DS_Store
88-
Thumbs.db
89-
90-
# Logs
91-
*.log
92-
logs/
93-
94-
# Temporary files
95-
tmp/
96-
temp/
97-
*.tmp
98-
99-
# Backup files
100-
*.backup
101-
*.bak
102-
*~
103-
104-
# Environment files
105-
.env
106-
.env.local
107-
.env.*.local
108-
109-
# SSH Keys
110-
*.pem
111-
*.key
112-
id_rsa*
113-
!*.pub
114-
115-
# Certificates
116-
*.crt
117-
*.cert
118-
*.ca-bundle
119-
!ca.example.crt
120-
121-
# =========================
122-
# CI/CD
123-
# =========================
124-
125-
# GitHub Actions
126-
.github/workflows/*.log
127-
128-
# =========================
129-
# Monitoring/Logging
130-
# =========================
131-
132-
# Prometheus data
133-
monitoring/prometheus/data/
134-
135-
# Grafana data
136-
monitoring/grafana/data/
137-
138-
# Elasticsearch data
139-
monitoring/elasticsearch/data/
140-
141-
# =========================
142-
# Backup
143-
# =========================
144-
145-
# Database dumps
146-
backup-recovery/database-backup/*.sql
147-
backup-recovery/database-backup/*.dump
148-
backup-recovery/**/*.gz
149-
backup-recovery/**/*.tar
150-
151-
# Velero backups
152-
backup-recovery/kubernetes-backup/backups/
153-
154-
# =========================
155-
# Security
156-
# =========================
157-
158-
# AWS credentials
159-
.aws/
160-
credentials
161-
config
162-
163-
# Vault tokens
164-
.vault-token
165-
166-
# Private keys and certificates
167-
security/**/private.key
168-
security/**/*.pem
169-
security/**/*.p12
170-
security/**/*.pfx
171-
172-
# =========================
173-
# Validation/Testing
174-
# =========================
175-
176-
# Test output
177-
validation_logs/*.txt
178-
test-results/
179-
coverage/
180-
181-
# Compliance reports
182-
compliance-reports/
183-
audit-reports/
18452

185-
# =========================
186-
# Scripts
187-
# =========================
53+
# Docker
54+
.docker/
18855

189-
# Script outputs
190-
*.output
191-
run_*.log
56+
# Vault
57+
vault-data/
58+
vault-logs/

0 commit comments

Comments
 (0)