{"id":21766403,"url":"https://github.com/rtasalem/hapi-pg-docker","last_synced_at":"2026-04-11T03:04:43.715Z","repository":{"id":223654770,"uuid":"761136624","full_name":"rtasalem/hapi-pg-docker","owner":"rtasalem","description":"Practice repo used to Dockerise a simple Hapi.js server and a PostgreSQL database, and to play about with Azure.","archived":false,"fork":false,"pushed_at":"2024-04-04T22:46:37.000Z","size":150,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T02:18:33.446Z","etag":null,"topics":["docker","docker-compose","hapijs","javascript","node-postgres","nodejs","postgresql"],"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/rtasalem.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":"2024-02-21T10:01:45.000Z","updated_at":"2024-04-01T12:43:43.000Z","dependencies_parsed_at":"2024-02-26T23:32:57.311Z","dependency_job_id":"64f2b1ba-d9f8-4ea7-8a77-7eb61603243c","html_url":"https://github.com/rtasalem/hapi-pg-docker","commit_stats":null,"previous_names":["rtasalem/hapi-pg-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fhapi-pg-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fhapi-pg-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fhapi-pg-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtasalem%2Fhapi-pg-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtasalem","download_url":"https://codeload.github.com/rtasalem/hapi-pg-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244742010,"owners_count":20502393,"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","hapijs","javascript","node-postgres","nodejs","postgresql"],"created_at":"2024-11-26T13:17:13.223Z","updated_at":"2025-12-30T20:54:09.397Z","avatar_url":"https://github.com/rtasalem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hapi.js + PostgreSQL + Docker\n## Background\nThis repo was initially created as practice for learning to Dockerise both a Hapi.js server \u0026 PostgreSQL database. The server was set up to allow for communication with the database and enable read/write functionality. Now this project is used for implementing different technologies and methods used at work.\n## Libraries \u0026 Technologies\n- [Docker](https://docs.docker.com/) \u0026 [Docker Compose](https://docs.docker.com/compose/)\n- [Node.js](https://nodejs.org/en)\n- [Hapi.js](https://hapi.dev/)\n- [PostgreSQL](https://www.postgresql.org/) ([pgAdmin 4](https://www.pgadmin.org/) for database management)\n- [Azure Service Bus](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview)\n## Documentation\n[In-depth documentation](https://github.com/rtasalem/hapi-pg-docker/blob/main/DOCS.md) has been completed in the form of a comprehensive write-up.\n## Learning Milestones\n- Setting up a simple server using [Hapi.js](https://hapi.dev/tutorials/gettingstarted/?lang=en_US).\n- [Configuring a Dockerfile](https://www.docker.com/blog/getting-started-with-docker-using-node-jspart-i/) for a Node.js environment.\n- Defining a Hapi.js server \u0026 PostgreSQL database using Docker Compose.\n- Establishing a connection to a PostgreSQL database using the [node-postgres NPM package](https://www.npmjs.com/package/pg).\n- Saving messages sent through a node application to a Service Bus queue and topic.\n- Saving messages sent via Service Bus queue to a postgres database.\n## Getting Started\n- Run `docker compose up --build`.\n- Confirm the server is running on `localhost:3001` and the message `Hello World!` is visible. Alternatively check Docker Desktop to ensure the container is running.\n- To ensure connection to the database is successful, navigate into the `app` directory and run `node database`. Note if an empty array is returned, the connection was successful, there is just no existing data to be returned. Use the queries to insert, update, and delete data.\n- Once set up locally, `docker compose down` and `docker compose up` can be used to stop and start the container respectively.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtasalem%2Fhapi-pg-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtasalem%2Fhapi-pg-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtasalem%2Fhapi-pg-docker/lists"}