{"id":16996763,"url":"https://github.com/thepatrickniyo/voting-app","last_synced_at":"2025-04-12T05:41:49.468Z","repository":{"id":43030605,"uuid":"501190817","full_name":"thepatrickniyo/voting-app","owner":"thepatrickniyo","description":"Building a full stack voting app challenge. Covering mult-containers with docker, docker-compose, nginx","archived":false,"fork":false,"pushed_at":"2022-09-12T11:13:23.000Z","size":829,"stargazers_count":10,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T00:44:40.607Z","etag":null,"topics":["docker","docker-compose","mongodb","nginx","nodejs","react-vite","swaggiffy"],"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/thepatrickniyo.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}},"created_at":"2022-06-08T09:51:28.000Z","updated_at":"2024-03-30T15:25:29.000Z","dependencies_parsed_at":"2023-01-18T04:45:25.175Z","dependency_job_id":null,"html_url":"https://github.com/thepatrickniyo/voting-app","commit_stats":null,"previous_names":["thepatrickniyo/voting-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepatrickniyo%2Fvoting-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepatrickniyo%2Fvoting-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepatrickniyo%2Fvoting-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thepatrickniyo%2Fvoting-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thepatrickniyo","download_url":"https://codeload.github.com/thepatrickniyo/voting-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525162,"owners_count":21118616,"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","mongodb","nginx","nodejs","react-vite","swaggiffy"],"created_at":"2024-10-14T03:52:30.572Z","updated_at":"2025-04-12T05:41:49.430Z","avatar_url":"https://github.com/thepatrickniyo.png","language":"JavaScript","readme":"## Voting App\n\nMulti Container App for academic challenge.\n\nThe challenge implements a microservice voting app with 3 services **Client**, **API server** \u0026 **Mongodb Service**\n\n## Scope of the challenge\n\nThe challenge is to cover the tools\n\n- Docker\n- Docker Compose\n- Nginx\n- API development with Nodejs\n- Client development with React # Vite\n- API documentation # Swaggify\n\n\n## Running the app with docker compose\n\nDocker compose will build and start all containers \u0026 and allow them to communicate\n\n```sh \n$ docker-compose up\n```\n\n## Client \n\nThe client service is implemented with React Vite\n\nRunning the client service container as an independent container\n\n**Building the image**\n\n```sh\n$ docker build . -t \u003cdocker-id\u003e/\u003cpreferred-image-name\u003e -f Dockerfile.dev\n# docker build . -t patrickniyo/voting-app-client -f Dockerfile.dev\n```\n\n**Running the container**\n```sh\n$ docker run -p \u003chost-port\u003e:\u003cexposed-container-port\u003e \u003cimage-name\u003e\n# docker run 3000:3000 patrickniyo/voting-app-client\n```\n\nRunning the development server\n\n```sh\n$ yarn dev\n# npm run dev\n```\n\n## Server\n\nThe server is built with Nodejs and Express\n\nRunning the server container as an independent container\n\n**Building the image**\n\n```sh\n$ docker build . -t \u003cdocker-id\u003e/\u003cpreferred-image-name\u003e -f Dockerfile.dev\n# docker build . -t patrickniyo/voting-app-server -f Dockerfile.dev\n```\n\n**Running the container**\n```sh\n$ docker run -p \u003chost-port\u003e:\u003cexposed-container-port\u003e \u003cimage-name\u003e\n# docker run 5000:5000 patrickniyo/voting-app-server\n```\n\nRunning the dev server\n\n```sh\n$ yarn start:dev\n```\n\n## Nginx\n\nThe nginx is used to set up a proxy server to benefit from some of it's features like [Load Balancing](https://www.nginx.com/resources/glossary/load-balancing/) .\n\n\n![Image](https://bs-uploads.toptal.io/blackfish-uploads/uploaded_file/file/194520/image-1582751182464-4b9d62e62912bd777a7c647a8309df8b.png)\n\nOur **nginx** service is listening on port **80**  of the host machine.\n\nOur **nginx** server is accessible by **http://localhost** or **http://localhost:80**\n\nThe default requests like **http://localhost** are forwarded to the client service\n\nIt will be forwarding **http://localhost:3000** requests to the client service and **http://localhost:5000** to the backend api service\n\n## API Documentations\n\nThanks to [@divinirakiza](https://github.com/divinirakiza) for a super tool to automate the API documentation with swagger.\n\nThe tool is [Swaggiffy](https://www.npmjs.com/package/swaggiffy). Get it from [npm](https://www.npmjs.com/package/swaggiffy)\n\n[Swaggiffy](https://www.npmjs.com/package/swaggiffy) is a zero config opensource tool for documenting your Node.js Express APIs and is built on top of Swagger. It is designed to be easy to use and simple, with the goal that anyone can read it.\n\nAccessing the documentation\n\n[http://localhost:5000/api-docs](http://localhost:5000/api-docs)\n## Author\n\n[Patrick Niyogitare](https://patrickniyo.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepatrickniyo%2Fvoting-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepatrickniyo%2Fvoting-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepatrickniyo%2Fvoting-app/lists"}