{"id":18562251,"url":"https://github.com/rstropek/node-mongo-sample","last_synced_at":"2025-05-15T17:35:21.301Z","repository":{"id":44173144,"uuid":"136335264","full_name":"rstropek/node-mongo-sample","owner":"rstropek","description":"A simple RESTful Web API for event- and participant management that I use in Docker and Kubernetes workshops","archived":false,"fork":false,"pushed_at":"2023-01-09T15:23:38.000Z","size":732,"stargazers_count":0,"open_issues_count":12,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T12:45:31.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/rstropek.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}},"created_at":"2018-06-06T13:48:36.000Z","updated_at":"2019-10-15T09:34:43.000Z","dependencies_parsed_at":"2023-02-08T12:31:59.193Z","dependency_job_id":null,"html_url":"https://github.com/rstropek/node-mongo-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstropek%2Fnode-mongo-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstropek%2Fnode-mongo-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstropek%2Fnode-mongo-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstropek%2Fnode-mongo-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstropek","download_url":"https://codeload.github.com/rstropek/node-mongo-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254388320,"owners_count":22063029,"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":"2024-11-06T22:09:09.667Z","updated_at":"2025-05-15T17:35:21.280Z","avatar_url":"https://github.com/rstropek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node + MongoDB Sample\n\n## Introduction\n\nThis sample image implements a simple RESTful Web API for event- and participant management. It is implemented in Node.js and uses MongoDB to store data. I use this image in Docker and Kubernetes trainings.\n\n## Swagger and OpenAPI\n\nThis sample also contains an OpenAPI specification for the Web API. I use it in workshops to speak about Swagger and OpenAPI. Here are the links to the specifications:\n\n* Swagger (v2)\n  * [YAML on GitHub](https://github.com/rstropek/node-mongo-sample/blob/master/api2.yaml)\n  * [JSON on GitHub](https://github.com/rstropek/node-mongo-sample/blob/master/api2.json)\n  * [JSON raw](https://rawgit.com/rstropek/node-mongo-sample/master/api2.json)\n* OpenAPI (v3)\n  * [YAML on GitHub](https://github.com/rstropek/node-mongo-sample/blob/master/api3.yaml)\n  * [JSON on GitHub](https://github.com/rstropek/node-mongo-sample/blob/master/api3.json)\n  * [JSON raw](https://rawgit.com/rstropek/node-mongo-sample/master/api3.json)\n\n## Quickstart\n\n### Step 1\n\nPull the latest image:\n\n```sh\ndocker pull rstropek/node-mongo-sample\n```\n\n### Step 2\n\nThis Web API will need a MongoDB to store data. If you don't have one, you can run it in a container:\n\n```sh\ndocker run --name event-db -d mongo\n```\n\n### Step 2\n\nRun the Web API:\n\n```sh\ndocker run -e MONGO_URL=mongodb://event-db/member-management --link event-db -p 1337:80 -d --name event-api rstropek/node-mongo-sample\n```\n\n### Step 3\n\nTry accessing the Web API. Here are some sample requests you can try:\n\n```txt\nGET http://localhost:1337/api/events?past=true\nAccept: application/json\n\n###\nPOST http://localhost:1337/api/events\nContent-Type: application/json\nAccept: application/json\n\n{\n    \"date\": \"2018-03-21T00:00:00\",\n    \"location\": \"Linz\"\n}\n\n###\nPOST http://localhost:1337/api/events/5ab1f7783907dc5490a62a26/registrations\nContent-Type: application/json\nAccept: application/json\n\n{\n    \"participant\": \n    {\n        \"givenName\": \"John\",\n        \"familyName\": \"Doe\"\n    }\n}\n\n###\nGET http://localhost:1337/api/events/5ab1f7783907dc5490a62a26/registrations\nAccept: application/json\n\n###\nPOST http://localhost:1337/api/participants/5ab1f82465ab325e8356f183/checkin/5ab1f7783907dc5490a62a26\nContent-Type: application/json\nAccept: application/json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstropek%2Fnode-mongo-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstropek%2Fnode-mongo-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstropek%2Fnode-mongo-sample/lists"}