{"id":24543000,"url":"https://github.com/dockersamples/catalog-service-node","last_synced_at":"2025-04-15T11:39:24.201Z","repository":{"id":261867339,"uuid":"860142295","full_name":"dockersamples/catalog-service-node","owner":"dockersamples","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-12T22:30:46.000Z","size":2146,"stargazers_count":9,"open_issues_count":2,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T05:48:32.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dockersamples.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-09-19T22:40:11.000Z","updated_at":"2025-04-04T04:01:58.000Z","dependencies_parsed_at":"2025-02-05T19:42:06.242Z","dependency_job_id":"d7c72901-0cd3-4915-ac1f-94c67860c485","html_url":"https://github.com/dockersamples/catalog-service-node","commit_stats":null,"previous_names":["mikesir87/container-supported-demo"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcatalog-service-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcatalog-service-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcatalog-service-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcatalog-service-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dockersamples","download_url":"https://codeload.github.com/dockersamples/catalog-service-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249062166,"owners_count":21206631,"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":"2025-01-22T19:30:11.532Z","updated_at":"2025-04-15T11:39:24.143Z","avatar_url":"https://github.com/dockersamples.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Catalog Service - Node\n\nThis repo is a demo project that demonstrates all of Docker's services in a single project. Specifically, it includes the following:\n\n- A containerized development environment (in a few varieties of setup)\n- Integration testing with Testcontainers\n- Building in GitHub Actions with Docker Build Cloud\n\nThis project is also setup to be used for various demos. Learn more about the demo setups by using [the README in the ./demo directory](./demo/README.md).\n\n## Application architecture\n\nThis sample app provides an API that utilizes the following setup:\n\n- Data is stored in a PostgreSQL database\n- Product images are stored in a AWS S3 bucket\n- Inventory data comes from an external inventory service\n- Updates to products are published to a Kafka cluster\n\n![Application architecture](./architecture.png)\n\nDuring development, containers provide the following services:\n\n- PostgreSQL and Kafka runs directly in a container\n- LocalStack is used to run S3 locally\n- WireMock is used to mock the external inventory service\n- pgAdmin and kafbat are added to visualize the PostgreSQL database and Kafka cluster\n\n![Dev environment architecture](./dev-environment-architecture.png)\n\n## Trying it out\n\nThis project is currently configured to run all dependent services in containers and the app natively on the machine (using Node installed on the machine).\n\nTo start the app, follow these steps:\n\n1. Ensure you have [Node 22+](https://nodejs.org) installed on your machine.\n\n2. Start all of the application dependencies\n\n   ```console\n   docker compose up\n   ```\n\n3. Install the app dependencies and start the main app with the following command:\n\n   ```console\n   npm install --omit=optional\n   npm run dev\n   ```\n\n4. Once everything is up and running, you can open the demo client at http://localhost:5173\n\n### Debugging the application\n\nThe project contains configuration for VS Code to enable quick debgging. Once the app is running, you can start a debug session by using the **Debug** task in the \"Run and Debug\" panel. This currently only works when the app is running natively on the machine.\n\n### Running tests\n\nThis project contains a few unit tests and integration tests to demonstrate Testcontainer usage. To run them, follow these steps (assuming you're using VS Code):\n\n1. Download and install the [Jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest#user-interface).\n\n2. Open the \"Testing\" tab in the left-hand navigation (looks like a flask).\n\n3. Press play for the test you'd like to run.\n\nThe \\*.integration.spec.js tests will use Testcontainers to launch Kafka, Postgres, and LocalStack.\n\n#### Running tests via the command line\n\nOr you can run the tests using the command line:\n\n```console\n# Run all tests\n$ npm test\n\n# Run only unit tests\n$ npm run unit-test\n\n# Run only the integration tests\n$ npm run integration-test\n```\n\n## Additional utilities\n\nOnce the development environment is up and running, the following URLs can be leveraged:\n\n- [http://localhost:5173](http://localhost:5173) - a simple React app that provides the ability to interact with the API via a web interface (helpful during demos)\n- [http://localhost:5050](http://localhost:5050) - [pgAdmin](https://www.pgadmin.org/) to visualize the database. Login using the password `postgres` (configured in the Compose file)\n- [http://localhost:8080](http://localhost:8080) - [kafbat](https://github.com/kafbat/kafka-ui) to visualize the Kafka cluster\n\n### Helper scripts\n\nIn the `dev/scripts` directory, there are a few scripts that can be used to interact with the REST API of the application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fcatalog-service-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdockersamples%2Fcatalog-service-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fcatalog-service-node/lists"}