{"id":18981890,"url":"https://github.com/nodeshift/mern-workshop","last_synced_at":"2025-04-19T20:03:16.267Z","repository":{"id":39670284,"uuid":"155695735","full_name":"nodeshift/mern-workshop","owner":"nodeshift","description":"MERN example code to be deployed into Docker and Kubernetes","archived":false,"fork":false,"pushed_at":"2024-04-05T22:05:13.000Z","size":1987,"stargazers_count":10,"open_issues_count":0,"forks_count":15,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-04-14T07:51:38.856Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.cloudnativejs.io","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/nodeshift.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}},"created_at":"2018-11-01T10:02:45.000Z","updated_at":"2023-12-17T10:00:36.000Z","dependencies_parsed_at":"2024-01-03T12:30:37.804Z","dependency_job_id":"885474ee-ed6d-44dd-9c16-2888f6fe67fa","html_url":"https://github.com/nodeshift/mern-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeshift%2Fmern-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeshift%2Fmern-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeshift%2Fmern-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeshift%2Fmern-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodeshift","download_url":"https://codeload.github.com/nodeshift/mern-workshop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223713577,"owners_count":17190498,"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","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":[],"created_at":"2024-11-08T16:11:37.305Z","updated_at":"2024-11-08T16:11:37.738Z","avatar_url":"https://github.com/nodeshift.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mern-workshop\n\nInstructions and code to deploy MongoDB, a backend Node.js microservice that connects to it, and a frontend that connects to the backend.\n\nThe frontend uses React and is served with nginx.\n\nThe backend uses Express and features a `/api/todos` endpoint with CRUD operations enabled.\n\nMongoDB is deployed with persistence and replicas: this is where todo items are stored.\n\nTested using the Kubernetes service provided by [Docker for Desktop on Mac](https://docs.docker.com/docker-for-mac/kubernetes/).\n\n## Quickstart for local development\n\n- Start a containerized MongoDB\n\n```sh\n  podman  run --name mongodb -d -p 27017:27017  mongo:7\n```\n\n- Start the backend service\n\n```sh\n  cd backend\n  npm install\n  npm start\n```\n\n- Start the frontend service\n\n```sh\n  cd ../frontend\n  npm install\n  npm start\n```\n\n## Quickstart for Podman\n\n- `podman build -f frontend/Dockerfile -t frontend:v1.0.0 frontend`\n- `podman build -f backend/Dockerfile  -t backend:v1.0.0 backend`\n- `podman pull mongo:7`\n- `podman network create mern-workshop`\n- `podman run -d --net mern-workshop --name mern-mongo mongo:7`\n- `podman run -d -p 30555:30555 --net mern-workshop -e MONGO_URL=mern-mongo --name mern-backend backend:v1.0.0`\n- `podman run -p 3001:80 frontend:v1.0.0`\n\nVisit the application on `localhost:3001`\n\n## Quickstart for Podman-Compose\n\nYou can use podman-compose to quickly deploy multiple services at once.\n\n- Install podman compose https://github.com/containers/podman-compose#installation\n\n- Create a file called `docker-compose.yaml` at the root of the project and copy copy/paste the following yaml:\n\n```\nversion: '3'\nservices:\n  frontend:\n    build: ./frontend\n    ports:\n      - 3001:80\n    links:\n      - backend\n  backend:\n    build: ./backend\n    ports:\n      - 30555:30555\n    environment:\n      - MONGO_URL=mongo\n    links:\n      - mongo\n  mongo:\n    image: mongo\n    restart: always\n    ports:\n      - 27017:27017\n```\n\n- Run `podman-compose up` to deploy the services.\n\n## Quickstart for Kubernetes\n\nRequires building the images first, see the quickstart for Docker section.\n\n- Set your Kubernetes context so you're pointing to a Kubernetes environment.\n- `helm repo add bitnami https://charts.bitnami.com/bitnami`\n- `helm install mongo --set auth.enabled=false,replicaSet.enabled=true,service.type=LoadBalancer,replicaSet.replicas.secondary=3 bitnami/mongodb`\n- `helm install backend backend/chart/backend`\n- `helm install frontend frontend/chart/frontend`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodeshift%2Fmern-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodeshift%2Fmern-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodeshift%2Fmern-workshop/lists"}