{"id":19036524,"url":"https://github.com/shuvro/movies-node-docker-mongodb-microservices","last_synced_at":"2025-07-14T04:06:16.843Z","repository":{"id":43164030,"uuid":"470225865","full_name":"shuvro/movies-node-docker-mongodb-microservices","owner":"shuvro","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-15T18:06:04.000Z","size":3024,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T05:42:14.017Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shuvro.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-03-15T15:41:25.000Z","updated_at":"2022-04-28T09:31:36.000Z","dependencies_parsed_at":"2022-09-12T12:21:16.340Z","dependency_job_id":null,"html_url":"https://github.com/shuvro/movies-node-docker-mongodb-microservices","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/shuvro%2Fmovies-node-docker-mongodb-microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuvro%2Fmovies-node-docker-mongodb-microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuvro%2Fmovies-node-docker-mongodb-microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuvro%2Fmovies-node-docker-mongodb-microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuvro","download_url":"https://codeload.github.com/shuvro/movies-node-docker-mongodb-microservices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240093145,"owners_count":19746776,"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-08T21:54:43.771Z","updated_at":"2025-02-21T21:54:16.438Z","avatar_url":"https://github.com/shuvro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# movies-node-docker-mongodb-microservices\n\n\n## Prerequisites\n\nYou need to have `docker` and `docker-compose` installed on your computer to run the service\n\n## Run locally\n\n1. Clone this repository\n1. Run from root dir\n\n```\ndocker-compose up -d\n```\n\n## Services at PORTS\n\n- auth service will start on port `3000`\n- movie service will start on port `3001`\n- mongodb will start on port `27018`\n\nTo stop the service run\n\n```\ndocker-compose down\n```\n\n## ENV variables\n\nAll the environment variables are set from .env file under following locations\n- auth-service/.env\n- movie-service/.env\n- .env\n\n\n## Users\n\nThe auth service defines two user accounts that you should use\n\n1. `Basic` user\n\n```\n username: 'basic-thomas'\n password: 'sR-_pcoow-27-6PAwCD8'\n```\n\n1. `Premium` user\n\n```\nusername: 'premium-jim'\npassword: 'GBLtTyq3E_UNjFnpo9m6'\n```\n\n## Token payload\n\nDecoding the auth token will give you access to basic information about the\nuser, including its role.\n\n```\n{\n  \"userId\": 123,\n  \"name\": \"Basic Thomas\",\n  \"role\": \"basic\",\n  \"iat\": 1606221838,\n  \"exp\": 1606223638,\n  \"iss\": \"https://www.netguru.com/\",\n  \"sub\": \"123\"\n}\n```\n\n## Example request\n\nTo authorize user call the auth service using for example `curl`. We assume\nthat the auth service is running of the default port `3000`.\n\nRequest\n\n```\ncurl --location --request POST '0.0.0.0:3000/auth' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"username\": \"basic-thomas\",\n    \"password\": \"sR-_pcoow-27-6PAwCD8\"\n}'\n```\n\nResponse\n\n```\n{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEyMywibmFtZSI6IkJhc2ljIFRob21hcyIsInJvbGUiOiJiYXNpYyIsImlhdCI6MTYwNjIyMTgzOCwiZXhwIjoxNjA2MjIzNjM4LCJpc3MiOiJodHRwczovL3d3dy5uZXRndXJ1LmNvbS8iLCJzdWIiOiIxMjMifQ.KjZ3zZM1lZa1SB8U-W65oQApSiC70ePdkQ7LbAhpUQg\"\n}\n```\n\n## Movie Service\n\nBase URL: `http://localhost:3001/`\n\n# POST\nendpoint:  `http://localhost:3001/movies`\nmethod: `POST`\n\npayload: \n\n```\n{\n\t\"title\": \"a beautiful mind\"\n}\n```\n\nheaders:\n```\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n# GET\nendpoint:  `http://localhost:3001/movies`\nmethod: `GET`\n\nheaders:\n```\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuvro%2Fmovies-node-docker-mongodb-microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuvro%2Fmovies-node-docker-mongodb-microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuvro%2Fmovies-node-docker-mongodb-microservices/lists"}