{"id":20702919,"url":"https://github.com/Frnn4268/Dockerized_3-tier_webapp","last_synced_at":"2025-05-10T20:30:40.095Z","repository":{"id":262748014,"uuid":"888228390","full_name":"Frnn4268/Dockerized_3-tier_webapp","owner":"Frnn4268","description":"This project is a 3-tier web app using Docker, Vite, Node.js, Go, and PostgreSQL. The frontend (Vite) connects to a backend API built with Go and Node.js, which handles business logic and real-time functions. PostgreSQL serves as the database. Docker containers each component, allowing for easy deployment and scalability.","archived":false,"fork":false,"pushed_at":"2024-11-27T15:38:30.000Z","size":8398,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T17:17:40.141Z","etag":null,"topics":["docker","docker-swarm","golang","makefile","nginx","nodejs","postgresql","reactjs","sequelize","shipyard","vitejs"],"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/Frnn4268.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}},"created_at":"2024-11-14T03:07:56.000Z","updated_at":"2024-11-28T21:53:02.000Z","dependencies_parsed_at":"2024-11-27T16:50:56.440Z","dependency_job_id":null,"html_url":"https://github.com/Frnn4268/Dockerized_3-tier_webapp","commit_stats":null,"previous_names":["frnn4268/minimal_3-tier_webapp","frnn4268/dockerized_3-tier_webapp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frnn4268%2FDockerized_3-tier_webapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frnn4268%2FDockerized_3-tier_webapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frnn4268%2FDockerized_3-tier_webapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frnn4268%2FDockerized_3-tier_webapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frnn4268","download_url":"https://codeload.github.com/Frnn4268/Dockerized_3-tier_webapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253480197,"owners_count":21915245,"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-swarm","golang","makefile","nginx","nodejs","postgresql","reactjs","sequelize","shipyard","vitejs"],"created_at":"2024-11-17T01:05:29.449Z","updated_at":"2025-05-10T20:30:40.061Z","avatar_url":"https://github.com/Frnn4268.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dockerized Minimal 3-Tier Web Application\n\nThis project is a minimal implementation of a three-tier web application architecture, designed to demonstrate the use of various modern technologies and deployment techniques. It comprises a Node.js service, a Go API, a PostgreSQL database, and a React (Vite) frontend.\n\n- **React frontend (using Vite.js):** 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- **PostgreSQL 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## Technologies Used\n\n- Frontend: Built with React using Vite for streamlined development and build processes.\n- Backend: Services implemented using Node.js and Go, offering robust APIs.\n- Database: PostgreSQL for reliable and scalable data storage.\n- Containerization: Docker is used for containerizing applications to ensure consistent environments across development and production.\n- CI/CD: GitHub Actions for continuous integration and deployment, including automated vulnerability scanning.\n- Docker Swarm: Deployed with Docker Swarm for managing services at scale.\n\n## Running the Application\n\nThe `Makefile` contains the commands to start each application.\n\n### PostgreSQL\n\n- It's way more convenient to run postgres in a container, like we do in this project.\n\n- `make run-postgres` will start postgres in a container and publish port 5432 from the container to your localhost.\n\n### api-node - Node.js\n\n- To run the node api you will need to run `npm install` to install the dependencies (I used node `v18.19.1` and npm `v9.2.0`).\n\n- After 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### api-golang - Golang\n\n- To run the golang api you will need to run `go mod download` to download and install the dependencies (I used `go1.22.2`)\n\n- After installing the dependencies, `make run-api-golang` will build and run the api.\n\n### client-react - Vite.js\n\n- Like `api-node` and `api-data-processing-node`, you will first need to install the dependencies with `npm install` (again, I used node `v18.19.1` and npm `v9.2.0`)\n\n- After installing the dependencies, `make run-client-react` will use vite to run the react app in development mode.\n\n## Running the Application with docker-compose.yml\n\nTo run the complete application with the compose, you will need to run:\n\n```bash\ndocker-compose up --build -d\n```\n\nYou can also run the main `Makefile` commands using a specific docker-compose.yml.\n\n## Problem Solved\n\nThis architecture serves as a blueprint for developing scalable web applications by efficiently separating concerns across a client, server, and data storage with a focus on maintainability, scalability, and efficient deployment workflows. Through containerization and orchestration practices, the project showcases the deployment versatility and ease of scaling in a microservices-driven environment.\n\n## Deployment\n\nThe application supports development and production environments with Docker Compose and Docker Swarm, ensuring smooth transitions between local development and cloud deployment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFrnn4268%2FDockerized_3-tier_webapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFrnn4268%2FDockerized_3-tier_webapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFrnn4268%2FDockerized_3-tier_webapp/lists"}