{"id":31618090,"url":"https://github.com/szabodorka/mern-docker-project","last_synced_at":"2026-05-04T13:34:40.114Z","repository":{"id":316752055,"uuid":"1058758051","full_name":"szabodorka/mern-docker-project","owner":"szabodorka","description":"Full-stack MERN crypto portfolio tracker, containerized with Docker and deployed to AWS using Terraform and GitHub Actions CI/CD.","archived":false,"fork":false,"pushed_at":"2025-09-26T12:39:21.000Z","size":5629,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-26T14:39:22.392Z","etag":null,"topics":["ci-cd","docker","docker-compose","mern-stack","terraform"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/szabodorka.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T14:06:03.000Z","updated_at":"2025-09-26T12:39:25.000Z","dependencies_parsed_at":"2025-09-26T14:39:27.944Z","dependency_job_id":null,"html_url":"https://github.com/szabodorka/mern-docker-project","commit_stats":null,"previous_names":["szabodorka/mern-docker-project"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/szabodorka/mern-docker-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szabodorka%2Fmern-docker-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szabodorka%2Fmern-docker-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szabodorka%2Fmern-docker-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szabodorka%2Fmern-docker-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szabodorka","download_url":"https://codeload.github.com/szabodorka/mern-docker-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szabodorka%2Fmern-docker-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278621843,"owners_count":26017253,"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-06T02:00:05.630Z","response_time":65,"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":["ci-cd","docker","docker-compose","mern-stack","terraform"],"created_at":"2025-10-06T13:45:30.992Z","updated_at":"2026-05-04T13:34:40.106Z","avatar_url":"https://github.com/szabodorka.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./frontend/images/logo.png\" alt=\"Project Logo\" width=\"275\" height=\"200\"\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cp align=\"center\"\u003e\n    Full-stack crypto portfolio tracker built with the \u003cstrong\u003eMERN\u003c/strong\u003e stack, containerized with \u003cstrong\u003eDocker\u003c/strong\u003e and deployed on \u003cstrong\u003eAWS\u003c/strong\u003e via \u003cstrong\u003eTerraform\u003c/strong\u003e and \u003cstrong\u003eGitHub Actions CI/CD\u003c/strong\u003e.\n    \u003cbr /\u003e\n    \u003ca href=\"#about-the-project\"\u003e\u003cstrong\u003eExplore the documentation »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"#architecture-overview\"\u003eView Architecture\u003c/a\u003e\n    ·\n    \u003ca href=\"#setup-instructions\"\u003eSetup Guide\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/szabodorka/mern-docker-project/issues\"\u003eReport Issue\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n## Table of Contents\n\n- [About the Project](#about-the-project)\n- [Tech Stack](#tech-stack)\n- [Architecture Overview](#architecture-overview)\n- [Setup Instructions](#setup-instructions)\n  - [1. Prerequisites](#1-prerequisites)\n  - [2. Terraform Infrastructure](#2-terraform-infrastructure)\n  - [3. GitHub Secrets](#3-github-secrets)\n  - [4. CI/CD Workflow](#4-cicd-workflow)\n- [Usage](#usage)\n- [Limitations \u0026 Notes](#limitations--notes)\n\n---\n\n## About the Project\n\nThis crypto portfolio tracker was originally developed as a **team project** during a full-stack developer course.  \nThe original frontend and backend codebases were built collaboratively and the build process is included in the commit history.\n\nIn this repository, the focus has been on **optimizing and extending the existing application** by adding:\n\n- **Docker containerization** of backend and frontend\n- A minimal **Terraform infrastructure** for AWS provisioning (EC2, Security Groups, IAM, OIDC)\n- A complete **GitHub Actions CI/CD pipeline** using OIDC authentication\n\n---\n\n## Tech Stack\n\n### **Backend**\n\n[![Node.js](https://img.shields.io/badge/Node.js-43853D?logo=node.js\u0026logoColor=white)](https://nodejs.org/)\n[![Express.js](https://img.shields.io/badge/Express.js-000000?logo=express\u0026logoColor=white)](https://expressjs.com/)\n[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?logo=mongodb\u0026logoColor=white)](https://www.mongodb.com/atlas/database)\n[![Mongoose](https://img.shields.io/badge/Mongoose-880000?logo=mongoose\u0026logoColor=white)](https://mongoosejs.com/)\n\n### **Frontend**\n\n[![React](https://img.shields.io/badge/React-20232A?logo=react\u0026logoColor=61DAFB)](https://react.dev/)\n[![Vite](https://img.shields.io/badge/Vite-646CFF?logo=vite\u0026logoColor=white)](https://vitejs.dev/)\n[![JavaScript](https://img.shields.io/badge/JavaScript-323330?logo=javascript\u0026logoColor=F7DF1E)](https://developer.mozilla.org/docs/Web/JavaScript)\n\n### **Infrastructure**\n\n[![AWS](https://img.shields.io/badge/AWS-232F3E?logo=amazon-aws\u0026logoColor=FF9900)](https://aws.amazon.com/)\n[![Terraform](https://img.shields.io/badge/Terraform-7B42BC?logo=terraform\u0026logoColor=white)](https://www.terraform.io/)\n[![Docker](https://img.shields.io/badge/Docker-2496ED?logo=docker\u0026logoColor=white)](https://www.docker.com/)\n[![GitHub Actions](https://img.shields.io/badge/GitHub_Actions-2088FF?logo=github-actions\u0026logoColor=white)](https://docs.github.com/actions)\n\n---\n\n## Architecture Overview\n\n- **Frontend (React + Nginx)** → served on an AWS EC2 instance, load-balanced via AWS NLB\n- **Backend (Express API)** → runs as a Docker container on the same host, available under `/api`\n- **Database (MongoDB Atlas)** → secure managed service, IP-whitelisted for EC2\n- **Infrastructure** → provisioned with Terraform (EC2, SGs, NLB, IAM, OIDC provider)\n- **CI/CD** → GitHub Actions builds Docker images → pushes to ECR → deploys via SSM command\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n---\n\n## Setup Instructions\n\n### 1. Prerequisites\n\n- AWS account with permissions to create:\n  - ECR repositories\n  - IAM roles \u0026 OIDC provider\n  - EC2, Security Groups and NLB\n- Default VPC in your region or in the default region `eu-central-1`\n- Backend \u0026 Frontend ECR repository in the same region\n- Terraform `\u003e= 1.5`\n- GitHub repository for this project\n- MongoDB Atlas cluster (with `MONGO_URI` and whitelisted EC2 Public IP)\n- Coingecko API Key (`COINGECKO_KEY`)\n\n---\n\n### 2. Terraform Infrastructure\n\n1. Clone the repo and switch to the terraform folder:\n\n```bash\ngit clone https://github.com/\u003cyour-username\u003e/\u003cyour-repo\u003e.git\ncd \u003cyour-repo\u003e/terraform\n```\n\nCreate terraform.tfvars file to define sensitive variables:\n\n```hcl\necr_repo_frontend = \"mern-docker-frontend\"\necr_repo_backend = \"mern-docker-backend\"\nmongo_uri = \"your-mongodb-uri\"\ncoingecko_key = \"your-coingecko-key\"\ngithub_owner = \"your-github-username\"\ngithub_repo = \"your-github-repo-name\"\n```\n\nInitialize and apply:\n\n```bash\nterraform init\nterraform apply\n```\n\nThis will create:\n\n- EC2 instance (Ubuntu 24.04, with Docker, AWS CLI, SSM Agent installed) \u003e Add EC2 public IP to the whitelist of your MongoDB cluster\n- IAM role for GitHub OIDC\n- Security Groups \u0026 Network Load Balancer\n\n\u003cstrong\u003eNote: ECR repositories must exist beforehand\u003c/strong\u003e\n\n---\n\n### 3. GitHub Secrets\n\nAdd the following repository secret from Terraform outputs under Git repository Settings \u003e Secrets and variables \u003e Actions:\n\nAWS_ROLE_ARN - The ARN of the OIDC role created by Terraform (e.g., arn:aws:iam::\u003caccount_id\u003e:role/gh-actions-mern-docker)\n\n---\n\n### 4. CI/CD Workflow\n\nOn push to main, GitHub Actions will:\n\n- Assume the OIDC role in AWS\n- Build backend \u0026 frontend Docker images\n- Push them to ECR\n- Trigger SSM command on EC2 \u003e docker compose pull \u0026\u0026 docker compose up -d\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n---\n\n## Usage\n\nAccess the application via the NLB DNS name printed in Terraform outputs.\nAPI base path is /api.\n\n## Limitations \u0026 Notes\n\n- Requires existing ECR repositories\n- MongoDB Atlas must have EC2 IP whitelisted\n- Single EC2 host – no auto-scaling yet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszabodorka%2Fmern-docker-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszabodorka%2Fmern-docker-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszabodorka%2Fmern-docker-project/lists"}