qvest-task/ROADMAP.md
aviyadeveloper e5069332e5 feat: AWS infrastructure setup with Terraform
Infrastructure components:
- VPC with single public subnet (10.0.0.0/16)
- Security group (SSH/HTTP/HTTPS from anywhere)
- EC2 instance (t3.medium, Ubuntu 24.04, 30GB encrypted gp3)
- S3 bucket for backups (versioned, encrypted)
- IAM role with S3FullAccess for EC2
- Route 53 DNS (gitea.poll-streams.com → EC2)
- Ed25519 SSH key generation via Terraform
2026-06-08 17:37:45 +02:00

314 lines
9.7 KiB
Markdown

# Roadmap
This is the implementation road map for the project. It outlines the key milestones and features in incremental steps, allowing for a structured approach to development and deployment.
## Phase 1: Conceptualization and Planning
This phase will be achieved through discussion and research and will include the following steps (no code should be implemented in this phase):
### 1.1 Requirements Analysis
- Define the scope and requirements of the project
- Identify constraints and non-functional requirements
- Determine host environment (cloud provider, VPS, or local)
### 1.2 Technology Selection ✅
**Decisions documented in [ADR.md](ADR.md)**
- **Cloud**: AWS
- **Infrastructure as Code**: Terraform
- **Configuration Management**: Ansible (kept minimal)
- **Application Deployment**: Docker + Docker Compose
- **Database**: PostgreSQL (self-hosted in Docker)
- **Reverse Proxy**: Nginx
- **SSL**: Let's Encrypt with certbot
- **Update Automation**: Watchtower
- **Monitoring**: Prometheus + Grafana (later phase)
- **Logging**: Loki + Promtail (later phase)
- **Backup**: Custom scripts + S3 (later phase)
### 1.3 Architecture Design ✅
- ✅ Overall system architecture designed
- ✅ Network topology planned (VPC, subnets, security groups)
- ✅ Three architecture diagrams created in docs/diagrams/
### 1.4 Project Structure ✅
- Directory structure planned (will create incrementally per phase)
- Documentation structure in place (`docs/diagrams/`)
- Naming conventions: lowercase, hyphens for files, descriptive names
### Goals:
- ✅ A clear full Roadmap for the project available in this file
- ✅ Technology stack documented with rationale (see ADR.md)
- ✅ Architecture diagrams created (3 diagrams in docs/diagrams/)
- ✅ Project structure planned
**Phase 1 Complete!** Ready to begin Phase 2 (Infrastructure Setup).
---
## Phase 2: Infrastructure Setup
This phase provisions the AWS infrastructure using Terraform.
### 2.1 Terraform Backend Setup ✅
- Configure AWS CLI and credentials locally
- Set up Terraform backend (S3 bucket for state storage)
- Initialize Terraform working directory
### 2.2 Core Infrastructure ✅
- ✅ Create VPC with single public subnet
- ✅ Set up Internet Gateway
- ✅ Configure Security Group for EC2 (ports 22, 80, 443)
- ✅ Provision EC2 instance (t3.medium, Ubuntu 24.04) with IAM role
- ✅ Create S3 bucket for backups (with versioning & encryption)
- ✅ Configure Route 53 DNS records (A record: gitea.poll-streams.com → EC2)
- ✅ Use official Terraform AWS modules (VPC, Security Group)
- ✅ Refactored into separate files: main.tf, vpc.tf, security.tf, compute.tf, storage.tf, iam.tf, dns.tf, outputs.tf
### 2.3 Security Configuration ✅
- ✅ Configure SSH key-based authentication (Ed25519, generated via Terraform)
- ✅ SSH access from anywhere (0.0.0.0/0) - security via key-based auth
- ✅ Apply IAM policies (AmazonS3FullAccess for EC2 backups)
- ✅ Security group follows least access (only 22, 80, 443 inbound; all outbound)
- ✅ Encrypted EBS root volume (30GB gp3)
### Goals: ✅
- ✅ AWS infrastructure fully defined in Terraform code
- ✅ EC2 instance provisioned and accessible via SSH
- ✅ S3 backup bucket created
- ✅ Domain DNS configured and resolving
- ✅ Infrastructure can be destroyed and recreated with `terraform apply`
**Phase 2 Complete!** Ready to begin Phase 3 (Automated Gitea Deployment).
---
## Phase 3: Automated Gitea Deployment
This phase implements the automated, reproducible Gitea installation.
### 3.1 Database Setup
- Automate database installation (PostgreSQL/MariaDB/MySQL)
- Create Gitea database and user
- Configure database for production use
- Secure database access
### 3.2 Gitea Installation
- Create automation scripts/playbooks for Gitea installation
- Configure Gitea application settings
- Set up file storage and data directories
- Configure Gitea to use database
### 3.3 Reverse Proxy Configuration
- Install and configure reverse proxy (nginx/Apache)
- Generate/configure SSL certificates
- Configure proxy to forward to Gitea
- Ensure Gitea UI is only accessible via proxy
- Set up HTTP to HTTPS redirect
### 3.4 Testing
- Test Gitea accessibility via HTTPS
- Verify direct access to Gitea is blocked
- Test Gitea functionality (create user, repo, etc.)
- Validate automation by destroying and recreating environment
### Goals:
- Gitea running and accessible via HTTPS through reverse proxy
- Installation fully automated and reproducible
- Documentation of deployment process
---
## Phase 4: Update Automation
This phase implements automated update mechanisms for Gitea and related components.
### 4.1 Update Strategy Design
- Define update schedule (when to check/apply updates)
- Define rollback strategy
- Plan pre-update backup automation
### 4.2 Update Automation Implementation
- Implement automated update mechanism
- Configure pre-update health checks
- Configure post-update validation
- Set up update notifications
- Test update process
### Goals:
- Automated update system operational
- Update process tested and validated
- Rollback procedure documented
---
## Phase 5: Backup Strategy Implementation
This phase implements comprehensive backup solutions.
### 5.1 Backup Concept Document
- Document backup strategy (3-2-1 rule)
- Define backup scope (database, repos, config, etc.)
- Define retention policy
- Define RTO and RPO targets
### 5.2 Backup Implementation
- Automate database backups
- Automate Gitea data directory backups
- Automate configuration backups
- Set up backup storage (local + remote)
- Implement backup rotation and cleanup
- Schedule automated backups
### 5.3 Recovery Testing
- Document restore procedures
- Test database restore
- Test full system restore
- Document recovery time
### Goals:
- Automated backup system operational
- Restore procedures tested and documented
- Backup strategy document completed
---
## Phase 6: Monitoring Implementation
This phase implements monitoring for system health and performance.
### 6.1 Monitoring Concept Document
- Define key metrics to monitor
- Define alerting thresholds
- Define alert channels (email, Slack, etc.)
### 6.2 Monitoring Setup
- Deploy monitoring solution
- Configure system metrics collection (CPU, RAM, disk, network)
- Configure Gitea-specific metrics
- Configure database metrics
- Set up monitoring dashboards
- Configure alerting rules
### 6.3 Testing
- Simulate failure scenarios
- Verify alerts trigger correctly
- Validate dashboard accuracy
### Goals:
- Monitoring system operational with dashboards
- Alerting configured and tested
- Monitoring concept document completed
---
## Phase 7: Logging Implementation
This phase implements centralized logging for all components.
### 7.1 Logging Concept Document
- Define logging architecture
- Define log retention policy
- Define log analysis requirements
### 7.2 Logging Setup
- Deploy centralized logging solution
- Configure Gitea application logging
- Configure reverse proxy access logs
- Configure database logs
- Configure system logs collection
- Set up log parsing and indexing
- Create log search and visualization dashboards
### 7.3 Testing
- Verify logs are being collected
- Test log search functionality
- Test log-based alerts (if applicable)
### Goals:
- Centralized logging operational
- All components sending logs to central system
- Logging concept document completed
---
## Phase 8: Redundancy and High Availability
This phase implements fail-safe operations and redundancy.
### 8.1 Redundancy Concept Document
- Document SPOF (Single Points of Failure) analysis
- Design HA architecture
- Define failover strategy
- Define acceptable downtime
### 8.2 Redundancy Implementation (Optional/Simplified)
- Implement database redundancy (replication/clustering) OR document approach
- Implement application redundancy (multiple Gitea instances) OR document approach
- Implement load balancing OR document approach
- Document manual failover procedures
### Goals:
- Redundancy concept document completed
- PoC or detailed plan for HA implementation
- Failover procedures documented
---
## Phase 9: Documentation and Final Testing
This phase consolidates all documentation and performs end-to-end testing.
### 9.1 Documentation
- Create comprehensive README
- Document architecture with diagrams
- Document all procedures (deployment, updates, backup/restore, failover)
- Create runbooks for common scenarios
- Document interview discussion points
### 9.2 Final Testing
- Perform end-to-end deployment test
- Test all automated processes
- Verify all documentation is accurate
- Test system under load (optional)
### 9.3 Repository Organization
- Store all code and docs in Gitea repository
- Ensure repository is well-organized
- Add proper README and documentation
### Goals:
- Complete documentation package
- All automation tested and validated
- Ready for interview presentation
---
## Phase 10: Interview Preparation
This phase prepares for the interview discussion.
### 10.1 Preparation
- Review all concept documents
- Prepare to explain technology choices
- Prepare architecture diagrams for presentation
- Prepare to demonstrate the system
- List lessons learned and trade-offs made
- Prepare improvement suggestions
### Goals:
- Ready to discuss all aspects of the implementation
- Demo environment functional and accessible
- Confident in technology choices and concepts
---
## Success Criteria
- ✅ Gitea accessible via HTTPS through reverse proxy
- ✅ Installation fully automated and reproducible
- ✅ Automated updates configured and tested
- ✅ Comprehensive concept documents for: Backup, Monitoring, Logging, Redundancy
- ✅ At least one PoC implementation (optional but recommended)
- ✅ All code and documentation in Git repository
- ✅ System accessible to interviewer over internet