# Task Manager β€” Cloud Deployment (SK1) A full-stack task management web application deployed to **Microsoft Azure** using Docker Compose. ## πŸ—οΈ Architecture ![Architecture](docs/architecture.png) | Container | Image | Port | Purpose | |-----------|-------|------|---------| | **Caddy** | caddy:2-alpine | 443, 80 | Reverse proxy + automatic HTTPS (Let's Encrypt) | | **Frontend** | nginx:alpine | 80 | Static files + API reverse proxy | | **API** | node:20-alpine | 3000 | Express REST API (CRUD) | | **PostgreSQL** | postgres:16-alpine | 5432 | Persistent relational database | | **Redis** | redis:7-alpine | 6379 | In-memory cache | ## πŸš€ Quick Deploy ```bash # 1. Login to Azure (requires Azure for Students subscription) az login # 2. Clone and configure git clone git@git.kemt.fei.tuke.sk:gs699he/zkt26.git cd zkt26/sk1 cp env.example .env nano .env # Set POSTGRES_PASSWORD, optionally change DNS_LABEL # 3. Deploy (creates VM, installs Docker, starts containers) ./prepare-app.sh # 4. Visit: https://taskmanager-gs699he.westeurope.cloudapp.azure.com ``` ## πŸ—‘οΈ Remove (after exam) ```bash ./remove-app.sh # Deletes entire resource group (VM, IP, disk) ``` ## πŸ’Ύ Backup & Logs ```bash ./backup-db.sh # Download database dump ./view-logs.sh # All container logs ./view-logs.sh --api -f # Follow API logs in real-time ``` ## πŸ“ Project Structure ``` sk1/ β”œβ”€β”€ api/ # Node.js REST API β”‚ β”œβ”€β”€ Dockerfile β”‚ β”œβ”€β”€ server.js # Express + CRUD routes β”‚ β”œβ”€β”€ db.js # PostgreSQL pool β”‚ └── package.json β”œβ”€β”€ frontend/ # Web UI β”‚ β”œβ”€β”€ Dockerfile β”‚ β”œβ”€β”€ nginx.conf β”‚ └── public/ (index.html, style.css, app.js) β”œβ”€β”€ db/init.sql # Database schema β”œβ”€β”€ caddy/Caddyfile # HTTPS proxy config β”œβ”€β”€ docs/ β”‚ β”œβ”€β”€ architecture.png # Architecture diagram β”‚ β”œβ”€β”€ documentation.tex # LaTeX source β”‚ └── documentation.pdf # 9-page PDF report β”œβ”€β”€ docker-compose.yaml # 5-service orchestration β”œβ”€β”€ cloud-init.yaml # VM bootstrap (Docker install) β”œβ”€β”€ prepare-app.sh # Azure deployment script β”œβ”€β”€ remove-app.sh # Azure teardown script β”œβ”€β”€ backup-db.sh # Database backup β”œβ”€β”€ view-logs.sh # Access log viewer β”œβ”€β”€ env.example # Environment template β”œβ”€β”€ .gitignore └── README.md ``` ## βš™οΈ Configuration | Variable | Description | Default | |----------|-------------|---------| | `POSTGRES_PASSWORD` | Database password | *(required)* | | `AZURE_RESOURCE_GROUP` | Azure resource group | taskmanager-rg | | `AZURE_LOCATION` | Azure region | westeurope | | `AZURE_VM_SIZE` | VM size | Standard_B1s | | `AZURE_DNS_LABEL` | DNS label for URL | taskmanager-gs699he | ## πŸ’° Cost (Azure for Students) | Resource | Monthly Cost | |----------|-------------| | VM (Standard_B1s) | ~$7.59 | | Public IP | ~$3.00 | | Disk (30 GB) | ~$1.20 | | TLS (Let's Encrypt) | Free | | **Total** | **~$11.79/mo** | > πŸ’‘ Azure for Students gives $100 free credit β€” enough for ~8 months. ## πŸ”’ Security - HTTPS enforced (Caddy + Let's Encrypt) - Databases on isolated Docker network (`backend-net`) - Secrets via `.env` (gitignored) - Security headers in Nginx - Auto-restart on failure ## πŸ€– AI Declaration - **Google Antigravity (Gemini)**: Scripts, Docker config, LaTeX docs, diagram - All code reviewed and adapted by student --- *Technical University of KoΕ‘ice β€” KEMT FEI β€” Cloud Technologies β€” 2026*