Cloud Networking
Cloud VPC
Provides the private network for the application and PostgreSQL database. Private subnets can be used to prevent direct public access to the database.
Application Compute
Cloud EC2
Runs the Python-based Project Management Application and handles user login, project management, task management, document operations, and reporting.
Database
PostgreSQL 14
Stores tenant information, users, projects, tasks, teams, comments, activities, and document metadata.
Database Storage
Cloud EBS
Provides persistent block storage for PostgreSQL when the database is hosted on EC2.
Tenant Data Isolation
PostgreSQL Row-Level Security (RLS)
Restricts database records based on tenant_id, ensuring that users from one organization cannot access another organization's data.
Database Backup
pgBackRest
Creates PostgreSQL backups and supports database restoration when data needs to be recovered.
Backup Storage
Cloud S3
Stores pgBackRest backup repositories separately from the active PostgreSQL storage.
Infrastructure as Code
OpenTofu
Creates and manages the Cloud infrastructure, including VPC, subnets, EC2, EBS, security groups, and S3.
Configuration Automation
Ansible
Configures the EC2 server, installs PostgreSQL and Python dependencies, and applies application/database configuration.
Monitoring
Prometheus
Collects application, PostgreSQL, and EC2 performance metrics such as CPU, memory, disk usage, database connections, and database performance.
Monitoring Dashboard
Grafana
Displays Prometheus metrics through dashboards for monitoring application and database health.
Network Security
Cloud Security Groups
Controls traffic between the application server, PostgreSQL database, and other Cloud resources. PostgreSQL port 5432 should only be accessible from the application layer.