{"id":31554660,"url":"https://github.com/sidge4real/devops_exam_preparation","last_synced_at":"2026-04-11T12:03:07.479Z","repository":{"id":307864107,"uuid":"1030919821","full_name":"Sidge4real/devops_exam_preparation","owner":"Sidge4real","description":"Simple blog app with local HTTP deployment via Docker Compose, using Node.js API, EJS frontend, and Nginx-served admin dashboard routed through Traefik.","archived":false,"fork":false,"pushed_at":"2025-08-02T16:34:30.000Z","size":1148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-02T18:37:40.789Z","etag":null,"topics":["docker","ejs","expressjs","nginx","nodejs","traefik"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sidge4real.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-02T16:04:13.000Z","updated_at":"2025-08-02T16:34:34.000Z","dependencies_parsed_at":"2025-08-02T18:37:47.003Z","dependency_job_id":null,"html_url":"https://github.com/Sidge4real/devops_exam_preparation","commit_stats":null,"previous_names":["sidge4real/devops_exam_preparation"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Sidge4real/devops_exam_preparation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sidge4real%2Fdevops_exam_preparation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sidge4real%2Fdevops_exam_preparation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sidge4real%2Fdevops_exam_preparation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sidge4real%2Fdevops_exam_preparation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sidge4real","download_url":"https://codeload.github.com/Sidge4real/devops_exam_preparation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sidge4real%2Fdevops_exam_preparation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278373518,"owners_count":25976150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","ejs","expressjs","nginx","nodejs","traefik"],"created_at":"2025-10-04T21:12:12.509Z","updated_at":"2025-10-04T21:12:15.143Z","avatar_url":"https://github.com/Sidge4real.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📝 Simple Blog App – DevOps Exam Preparation\n\n[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/) [![Traefik](https://img.shields.io/badge/traefik-%231F93FF.svg?style=for-the-badge\u0026logo=traefik\u0026logoColor=white)](https://traefik.io/) [![Node.js](https://img.shields.io/badge/node.js-%23339933.svg?style=for-the-badge\u0026logo=node.js\u0026logoColor=white)](https://nodejs.org/) [![Nginx](https://img.shields.io/badge/nginx-%23009639.svg?style=for-the-badge\u0026logo=nginx\u0026logoColor=white)](https://nginx.org/) [![PostgreSQL](https://img.shields.io/badge/postgresql-%23316192.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n\nThis is a **practice project** created in preparation for a **DevOps exam**. It demonstrates the deployment of a full-stack blog application using **Docker Compose** and **Traefik**, running locally over **HTTP**.\n\n## 🎯 Features\n\n- 🔄 **Containerized Architecture** with Docker Compose\n- 🌐 **Reverse Proxy** with Traefik\n- 🔒 **Basic Auth** protection for admin dashboard\n- 📊 **PostgreSQL** database with volume persistence\n- 🖥️ **Modern Frontend** using EJS templating\n- 🛡️ **Admin Dashboard** for content management\n\n## 🚀 Tech Stack\n\n| Component | Technology | Description |\n|-----------|------------|-------------|\n| Backend API | Node.js | RESTful API service |\n| Database | PostgreSQL | Data persistence |\n| Frontend | EJS | Server-side rendering |\n| Admin Panel | Nginx | Static file serving |\n| Proxy | Traefik | HTTP routing \u0026 load balancing |\n\n## 📁 Project Structure\n\n```\n.\n├── api/              # Node.js backend (REST API)\n├── frontend/         # EJS-based frontend\n├── admin/            # Nginx static admin dashboard\n├── .env              # Shared environment variables\n├── docker-compose.yml # Container orchestration\n└── etc/\n    └── traefik/     # Traefik configuration\n        └── traefik.yml\n```\n\n## 🛠️ Prerequisites\n\n- Docker Engine (20.10.x or newer)\n- Docker Compose v2.x\n- Git\n- Text editor for configuration\n\n## ⚙️ Configuration\n\n### Base Application Configuration\n\n**Environment Variables (.env)**\n```env\n# Database Configuration\nPOSTGRES_HOST=db\nPOSTGRES_USER=\nPOSTGRES_PASSWORD=\nPOSTGRES_DB=\nDB_PORT=5432\n\n# API Configuration\nAPI_HOST=api\nAPI_PORT=3000\n```\n\n### Traefik Authentication\n\n**Basic Auth Credentials**\n```env\nTRAEFIK_AUTH_USER=\u003cuser\u003e:\u003cpassword\u003e\n```\n\n**Generate New Encrypted Credentials**\n```bash\ndocker run --rm httpd:2.4 htpasswd -nbB \u003cusername\u003e \u003cpassword\u003e\n```\n\n## 🚀 Quick Start\n\n### 1. Repository Setup\n```bash\n# Clone the repository\ngit clone \u003cyour-repo-url\u003e\n\n# Navigate to project directory\ncd \u003cproject-folder\u003e\n```\n\n### 2. Host Configuration\n\n**Add Local Domain Entries**\n```bash\n# For Linux/macOS: Add to /etc/hosts\n# For Windows: Add to C:\\Windows\\System32\\drivers\\etc\\hosts\n127.0.0.1 base-app.localhost traefik.localhost\n```\n\n### 3. Launch Application\n```bash\n# Build and start all services\ndocker compose up --build\n```\n\n## 🌐 Access Points\n\n| Service | URL | Description |\n|---------|-----|-------------|\n| Frontend | http://base-app.localhost | Main blog interface |\n| Admin Dashboard | http://base-app.localhost/admin | Content management |\n| API | http://base-app.localhost/api/ | Backend API |\n| Traefik Dashboard | http://traefik.localhost | Proxy monitoring |\n\n## 🐳 Container Images\n\n| Service | Image | Version |\n|---------|-------|----------|\n| API | node | 23.6 |\n| Frontend | node | 23.6 |\n| Admin | nginx | 1.27 |\n| Database | postgres | 15.10 |\n| Proxy | traefik | 3.3 |\n\n## 🔍 Troubleshooting\n\n### Diagnostic Commands\n\n**View Service Logs**\n```bash\n# View logs for all services\ndocker compose logs\n\n# View logs for specific service\ndocker compose logs [service-name]\n\n# Follow log output\ndocker compose logs -f [service-name]\n```\n\n**Container Shell Access**\n```bash\n# Access container shell\ndocker exec -it \u003ccontainer-name\u003e sh\n\n# Access PostgreSQL container\ndocker exec -it db psql -U user -d mydatabase\n```\n\n### Common Issues\n\n**Port Conflicts**\n```bash\n# Check if ports are in use (Windows)\nnetstat -ano | findstr :80\nnetstat -ano | findstr :5432\n```\n\n**DNS Resolution**\n```bash\n# Test DNS resolution\nping base-app.localhost\nping traefik.localhost\n```\n\n**Database Connection**\n```bash\n# Test database connection from API container\ndocker exec -it api node -e \"const { Client } = require('pg'); const client = new Client(); client.connect()\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidge4real%2Fdevops_exam_preparation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidge4real%2Fdevops_exam_preparation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidge4real%2Fdevops_exam_preparation/lists"}