{"id":19356256,"url":"https://github.com/safwen-saafi/multi-service-web-container","last_synced_at":"2026-01-27T00:39:14.730Z","repository":{"id":261587239,"uuid":"884747957","full_name":"Safwen-Saafi/Multi-Service-Web-Container","owner":"Safwen-Saafi","description":"Containerize a web app with two main services, a Node api and a go-lang api","archived":false,"fork":false,"pushed_at":"2024-11-24T00:38:48.000Z","size":303,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T22:51:18.800Z","etag":null,"topics":["docker","docker-compose","golang","node","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Safwen-Saafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-11-07T10:14:36.000Z","updated_at":"2024-12-09T08:06:44.000Z","dependencies_parsed_at":"2024-11-07T11:27:51.103Z","dependency_job_id":"6dfdf135-0d98-40d6-a3dc-75089db0c1cd","html_url":"https://github.com/Safwen-Saafi/Multi-Service-Web-Container","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"64fb39a079f9112545134d8b30836c263692be14"},"previous_names":["safwen-saafi/multi-service-web-container"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Safwen-Saafi%2FMulti-Service-Web-Container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Safwen-Saafi%2FMulti-Service-Web-Container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Safwen-Saafi%2FMulti-Service-Web-Container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Safwen-Saafi%2FMulti-Service-Web-Container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Safwen-Saafi","download_url":"https://codeload.github.com/Safwen-Saafi/Multi-Service-Web-Container/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248671628,"owners_count":21143136,"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":["docker","docker-compose","golang","node","react"],"created_at":"2024-11-10T07:03:44.756Z","updated_at":"2026-01-27T00:39:14.691Z","avatar_url":"https://github.com/Safwen-Saafi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample web application\n\n![](./readme-assets/app-screenshot.png)\n\n## Minimal 3 tier web application\n- **React frontend:** Uses react query to load data from the two apis and display the result\n- **Node JS and Golang APIs:** Both have `/` and `/ping` endpoints. `/` queries the Database for the current time, and `/ping` returns `pong`\n- **Postgres Database:** An empty PostgreSQL database with no tables or data. Used to show how to set up connectivity. The API applications execute `SELECT NOW() as now;` to determine the current time to return.\n\n![](./readme-assets/tech-stack.png)\n\n## Running the Application\n\nThe `Makefile` contains the commands to start each application.\n\n### Postgres\n\nPostgres is run in a container.\n\n`make run-postgres` will start postgres in a container and publish port 5432 from the container to your localhost.\n\n![alt text](./readme-assets/image.png)\n\n### api-node\n\nTo run the node api you will need to run `npm install` to install the dependencies. They are already present in the package.json file so you don't need to specify them, just run the command and you are good to go.\n\nAfter installing the dependencies, `make run-api-node` will run the api in development mode with nodemon for restarting the app when you make source code changes.\n\n![alt text](./readme-assets/image-1.png)\n\n\n### api-golang \n\nTo run the golang api you will need to run `go mod download` to download and install the dependencies.\n\nAfter installing the dependencies, `make run-api-golang` will build and run the api.\n\n![alt text](./readme-assets/image-2.png)\n\n### client-react\n\nLike `api-node`, you will first need to install the dependencies with `npm install`\n\nAfter installing the dependencies, `make run-client-react` will use vite to run the react app in development mode.\n\n![alt text](./readme-assets/image4.png)\n\n\n## What is the goal of this project ?\n\nA very `simple` and `straightforward` web app to `containerize`, with a `Dockerfile` inside each directory.\n\nThe whole point of this project is to containerize the app, include each image in a `Docker-compose` file and run the whole web app as `separate containers`.\n\nIt's truly a great project to follow along if you're new to `Docker` and it's key concepts.\n\n\n## How to use the docker-compose ?\n\nAll of the necessary commands are included in the Makefile.\n\nFirst of all `make compose-build` will execute the command `docker compose build` to build all of the images included in the docker-compose\n\nThen `make compose-up` will start all of the containers ( docker compose up)\n\nIf you want to stop all of the containers, just run `make compose-down` ( docker compose down)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsafwen-saafi%2Fmulti-service-web-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsafwen-saafi%2Fmulti-service-web-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsafwen-saafi%2Fmulti-service-web-container/lists"}