{"id":19505579,"url":"https://github.com/bogdaaamn/movies-api-nestjs","last_synced_at":"2026-06-11T13:31:23.161Z","repository":{"id":59251950,"uuid":"455165936","full_name":"bogdaaamn/movies-api-nestjs","owner":"bogdaaamn","description":"A movies API that provides basic information provided by TMDB. Built with Nestjs.","archived":false,"fork":false,"pushed_at":"2022-09-13T14:56:37.000Z","size":864,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T22:15:10.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://quiet-depths-21248.herokuapp.com/docs/","language":"TypeScript","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/bogdaaamn.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-02-03T12:58:53.000Z","updated_at":"2022-09-05T12:35:04.000Z","dependencies_parsed_at":"2022-09-19T10:31:02.175Z","dependency_job_id":null,"html_url":"https://github.com/bogdaaamn/movies-api-nestjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bogdaaamn/movies-api-nestjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fmovies-api-nestjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fmovies-api-nestjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fmovies-api-nestjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fmovies-api-nestjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bogdaaamn","download_url":"https://codeload.github.com/bogdaaamn/movies-api-nestjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fmovies-api-nestjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34201840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10T22:31:54.916Z","updated_at":"2026-06-11T13:31:23.142Z","avatar_url":"https://github.com/bogdaaamn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPT Movies API Nestjs\n\n## Description\n\nA movies API that provides basic information provided by TMDB. Built with [Nestjs](https://github.com/nestjs/nest).\n\n## API References\n\nRead the full documentation and interactive examples at https://quiet-depths-21248.herokuapp.com/docs/. \n\n### `GET /movies/:id`\n\nGet the metadata information about a movie, including the available trailer URL. Gathers data from TMDB's [Get Details](https://developers.themoviedb.org/3/movies/get-movie-details) and [Get Videos](https://developers.themoviedb.org/3/movies/get-movie-videos) public routes.\n\n### Path parameters\n\n- `id`: The ID of the movie as seen in TMDB. **Required**\n\n### Request\n\n```\nGET /movies/500\n```\n\n### Response\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003e200 OK\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n      \"id\": 500,\n      \"title\": \"Reservoir Dogs\",\n      \"tagline\": \"Every dog has his day.\",\n      \"overview\": \"A botched robbery indicates a police informant, and the pressure mounts in the aftermath at a warehouse. Crime begets violence as the survivors -- veteran Mr. White, newcomer Mr. Orange, psychopathic parolee Mr. Blonde, bickering weasel Mr. Pink and Nice Guy Eddie -- unravel.\",\n      \"poster_path\": \"/lsBnfheKZBO3UKU7lVHIeGZLWuF.jpg\",\n      \"release_date\": \"1992-09-02\",\n      \"runtime\": 99,\n      \"trailer\": \"https://www.youtube.com/watch?v=GLPJSmUHZvU\"\n  }\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003e404 Not Found\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n      \"success\": false,\n      \"status_code\": 34,\n      \"status_message\": \"The resource you requested could not be found.\"\n  }\n  ```\n\u003c/details\u003e\n\n### `GET /search`\n\nSearch for movies. Gathers data from TMDB's Search Movies public route.\n\n#### Query parameters\n\n- `query`: The text query to search. **Required**\n- `page`: The page number to query. **Default: 1**\n\n#### Request\n\n```\nGET /search?query=fight\u0026page=1\n```\n\n#### Response\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003e200 OK: Valid query\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n    \"page\": 1,\n    \"results\": [\n        {\n            \"id\": 550,\n            \"vote_average\": 8.4,\n            \"poster_path\": \"/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg\",\n            \"release_date\": \"1999-10-15\",\n            \"title\": \"Fight Club\"\n        },\n        {\n            \"id\": 629017,\n            \"vote_average\": 6.7,\n            \"poster_path\": \"/wlP25H14OvKoFORIwuKomZzioA5.jpg\",\n            \"release_date\": \"2020-09-10\",\n            \"title\": \"Run Hide Fight\"\n        },\n        {\n            \"id\": 345922,\n            \"vote_average\": 6.1,\n            \"poster_path\": \"/huRhv4IZDk2ds0DIDkI6uxdmb6J.jpg\",\n            \"release_date\": \"2017-02-16\",\n            \"title\": \"Fist Fight\"\n        },\n        {\n            \"id\": 682377,\n            \"vote_average\": 5.9,\n            \"poster_path\": \"/4ZocdxnOO6q2UbdKye2wgofLFhB.jpg\",\n            \"release_date\": \"2020-11-13\",\n            \"title\": \"Chick Fight\"\n        },\n        {\n            \"id\": 924987,\n            \"vote_average\": 0,\n            \"poster_path\": \"/2DhlrTgYAENQGvfH8ZNgXgmACfE.jpg\",\n            \"release_date\": \"2022-02-05\",\n            \"title\": \"UFC Fight Night 200: Hermansson vs. Strickland\"\n        },\n        {\n            \"id\": 440777,\n            \"vote_average\": 6.5,\n            \"poster_path\": \"/iI9c8XNdPuwB4RYbHMd62QNhoRK.jpg\",\n            \"release_date\": \"2017-03-16\",\n            \"title\": \"Female Fight Squad\"\n        },\n        {\n            \"id\": 14286,\n            \"vote_average\": 7.6,\n            \"poster_path\": \"/kfOmnlwt1rrhxmxc05X3i9mHSOs.jpg\",\n            \"release_date\": \"2005-01-01\",\n            \"title\": \"Why We Fight\"\n        },\n        {\n            \"id\": 385383,\n            \"vote_average\": 3.6,\n            \"poster_path\": \"/jIPWkzF9srlU8eZTldLM6JYZwkO.jpg\",\n            \"release_date\": \"2016-07-22\",\n            \"title\": \"Fight Valley\"\n        },\n        {\n            \"id\": 559578,\n            \"vote_average\": 4.4,\n            \"poster_path\": \"/y0QXD8zSxpBsyQSKN9mg5diYexV.jpg\",\n            \"release_date\": \"2018-11-06\",\n            \"title\": \"Alone We Fight\"\n        },\n        {\n            \"id\": 325365,\n            \"vote_average\": 6.5,\n            \"poster_path\": \"/thgvd0tjDLJvTVx4BaZjfQAC7yK.jpg\",\n            \"release_date\": \"2015-03-13\",\n            \"title\": \"Dawg Fight\"\n        },\n        {\n            \"id\": 55461,\n            \"vote_average\": 7.2,\n            \"poster_path\": \"/r5TUs76PbO68b6qmHgWjw4Nsz39.jpg\",\n            \"release_date\": \"1942-04-10\",\n            \"title\": \"Donald's Snow Fight\"\n        },\n        {\n            \"id\": 883656,\n            \"vote_average\": 0,\n            \"poster_path\": \"/a9RWdhRLyx3BqCjlwmZJHXyeMkR.jpg\",\n            \"release_date\": \"2021-10-09\",\n            \"title\": \"GCW Fight Club\"\n        },\n        {\n            \"id\": 196355,\n            \"vote_average\": 6.6,\n            \"poster_path\": \"/zbAWQ41NPaWbN0deyMuxF1ustmj.jpg\",\n            \"release_date\": \"2013-10-04\",\n            \"title\": \"Muhammad Ali's Greatest Fight\"\n        },\n        {\n            \"id\": 108251,\n            \"vote_average\": 6.2,\n            \"poster_path\": \"/mie2uVWWI2iNlkSdHaOjk1J3irW.jpg\",\n            \"release_date\": \"2011-10-03\",\n            \"title\": \"Girl Fight\"\n        },\n        {\n            \"id\": 488971,\n            \"vote_average\": 5.5,\n            \"poster_path\": \"/qeceU9AsdHu9H6ZZax4MfeDj7A7.jpg\",\n            \"release_date\": \"2017-11-01\",\n            \"title\": \"You Can't Fight Christmas\"\n        },\n        {\n            \"id\": 148526,\n            \"vote_average\": 4.6,\n            \"poster_path\": \"/qVyOyga4g4QlMTmcyCbmtQC6Et9.jpg\",\n            \"release_date\": \"2011-08-31\",\n            \"title\": \"Forced To Fight\"\n        },\n        {\n            \"id\": 372631,\n            \"vote_average\": 5.9,\n            \"poster_path\": \"/2StM8Vavf7ukvuj9mxg1o7nKxmi.jpg\",\n            \"release_date\": \"2015-12-15\",\n            \"title\": \"Marvel Super Hero Adventures: Frost Fight!\"\n        },\n        {\n            \"id\": 62328,\n            \"vote_average\": 6.4,\n            \"poster_path\": \"/1WcxVQBsXG6EQlNJd8vcF4oFTg4.jpg\",\n            \"release_date\": \"1993-05-05\",\n            \"title\": \"Shootfighter: Fight to the Death\"\n        },\n        {\n            \"id\": 33274,\n            \"vote_average\": 4.1,\n            \"poster_path\": \"/mbSW30poDgsjEVXWQdh9So5k8sf.jpg\",\n            \"release_date\": \"2009-02-03\",\n            \"title\": \"Street Fighter: Round One - FIGHT!\"\n        },\n        {\n            \"id\": 888652,\n            \"vote_average\": 6.6,\n            \"poster_path\": \"/5TNSfR1OdcNHMnJV7QczdqdfaGR.jpg\",\n            \"release_date\": \"2021-11-24\",\n            \"title\": \"'Twas the Fight Before Christmas\"\n        }\n    ],\n    \"total_pages\": 100,\n    \"total_results\": 1982\n  }\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003e200 OK: Empty pagination\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n    \"page\": 1,\n    \"results\": [],\n    \"total_pages\": 0,\n    \"total_results\": 0\n  }\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003e422 Unprocessable Entity: Empty query\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n    \"errors\": [\n      \"query must be provided\"\n    ]\n  }\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cb\u003e422 Unprocessable Entity: Wrong pagination\u003c/b\u003e\u003c/summary\u003e\n  \n  ```json\n  {\n    \"errors\": [\n      \"page must be greater than 0\"\n    ]\n  }\n  ```\n\u003c/details\u003e\n\n\n## Development\n### Installation\n\n```bash\n$ git clone https://github.com/BogDAAAMN/movies-api-nestjs/\n$ cd movies-api-nestjs\n$ npm install\n```\n\n⚠️ Create and edit an `.env` file, as seen in [`.env.example`](/.env.example).\n\nhttps://github.com/BogDAAAMN/movies-api-nestjs/blob/d8b6f7405e9ba5164bd46c2f0eb9b251c47379f5/.env.example#L1-L2\n  \nYou can get your `TMDB_KEY` API key by logging in to your [TMDB account](https://www.themoviedb.org/settings/account) and clicking the [API link](https://www.themoviedb.org/settings/api) of your account page. More details and screenshots on the [TMDB API Docs](https://developers.themoviedb.org/3/getting-started/introduction).\n\n### Development\n\n```bash\n# watch mode\n$ npm run start:dev\n```\n\n### Test\n\n```bash\n# unit tests\n$ npm run test\n\n# e2e tests\n$ npm run test:e2e\n```\n\nThe current unit tests coverage: (generated by [istanbul](https://istanbul.js.org/)) \n\n```\n-----------------------|---------|----------|---------|---------|-\nFile                   | % Stmts | % Branch | % Funcs | % Lines | \n-----------------------|---------|----------|---------|---------|-\n src/movies            |     100 |    57.14 |     100 |     100 | \n  movies.controller.ts |     100 |      100 |     100 |     100 | \n  movies.service.ts    |     100 |    57.14 |     100 |     100 | \n src/search            |     100 |      100 |     100 |     100 | \n  search.controller.ts |     100 |      100 |     100 |     100 | \n  search.service.ts    |     100 |      100 |     100 |     100 | \n src/tmdb              |     100 |      100 |     100 |     100 | \n  tmdb.service.ts      |     100 |      100 |     100 |     100 | \n-----------------------|---------|----------|---------|---------|-\n```\n\n### Cache\n\nThe API uses the Nest built-in in-memory caching system. The data is stored in to the application's memory and it is served before making TMDB API requests (if possible). The current cache configuration is:\n\n- `ttl`: \n  - 86400 for `/movies`\n  - 3600 for `/search`\n- `max`: 100k\n\nLatency benchmark for `/movies` route (generated by [autocannon](https://github.com/mcollina/autocannon)):\n\n```\nRunning 10s test @ http://localhost:3000/movies/550\n10 connections\n┌───────────────────┬────────┬────────┬────────┬────────┬───────────┬──────────┐\n│ Stat              │ 2.5%   │ 50%    │ 97.5%  │ 99%    │ Avg       │ Stdev    │\n├───────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤\n│ Non-cache Latency │ 103 ms │ 119 ms │ 187 ms │ 194 ms │ 124.17 ms │ 22.96 ms │\n├───────────────────┼────────┼────────┼────────┼────────┼───────────┼──────────┤\n│ Cache Latency     │   3 ms │   5 ms │  11 ms │  13 ms │   5.19 ms │  5.38 ms │\n└───────────────────┴────────┴────────┴────────┴────────┴───────────┴──────────┘\n\n- Non-cache: 166 requests in 10.02s,  123 kB read\n- Cache:     18k requests in 10.01s, 13.9 MB read\n```\n\n### Security\n\nThis API uses [Helmet](https://helmetjs.github.io/) to set some of the headers that might be useful for this REST API.\n\n- `helmet.expectCt()` sets the `Expect-CT` header to avoid misused SSL certificates\n- `helmet.frameguard()` sets the `X-Frame-Options` to avoid click-jacking attacks or being misused in harmful embeds like `\u003ciframe\u003e`\n- `helmet.hidePoweredBy()` disables the `X-Powered-By` header to hide from attackers that this API runs on Express, and possibly save some payload size\n- `helmet.hsts()` sets the `Strict-Transport-Security` header to force the use of `HTTPS`\n- `helmet.noSniff()` sets the `X-Content-Type-Options` to prevent the misuse of `Content-Type` headers into MIME type sniffing or similar attacks\n- `helmet.permittedCrossDomainPolicies()` sets the `X-Permitted-Cross-Domain-Policies` header to block weird cross-domain clients (like Adobe)\n\n## Deploy\n\n### CI Workflow\n\nThe GitHub Actions workflow in [.github/workflows/ci.yml](.github/workflows/ci.yml) runs the linter (`npm run lint`), the unit tests (`npm run test`), and the e2e tests (`npm run test:e2e`) for each push on the main branch. \n\n⚠️ In order to allow the tests to run, they need the `TMDB_KEY` and `TMDB_URL` env variables. They are already set in the workflows (as seen below), but you need to make sure you set `TMDB_KEY` as a secret in your repository. See [Creating encrypted secrets for a repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository).\n\nhttps://github.com/BogDAAAMN/movies-api-nestjs/blob/d8b6f7405e9ba5164bd46c2f0eb9b251c47379f5/.github/workflows/ci.yml#L11-L12\n\nTake note that the Heroku deployment will wait until the CI tests are passed. So there will be no un-linted or un-tested code pushed to Heroku. If the tests are failing the deployment is stopped and you'll be notified. \n\n### Heroku\n\nYou can deploy the project by connecting the GitHub project to a fresh new Heroku project, see [Enabling GitHub Integration](https://devcenter.heroku.com/articles/github-integration#enabling-github-integration). \n\n⚠️ You will have to manually setup the `TMDB_KEY` and `TMDB_URL` env variables into Heroku Dashboard (see [Configuration and Config Vars](https://devcenter.heroku.com/articles/config-vars#using-the-heroku-dashboard)) or run the CLI commands: \n\n```bash\n$ heroku config:set TMDB_KEY=key-here\n$ heroku config:set TMDB_URL=https://api.themoviedb.org/3\n```\n\nOr simply use the **Deploy to Heroku** button and complete the missing Config Vars on the screen:\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/BogDAAAMN/movies-api-nestjs/)\n\nCurrently the project is hosted on Heroku under https://quiet-depths-21248.herokuapp.com/docs.\n\n## License\n\n- Nest is [MIT licensed](LICENSE).\n- TMDb offers the API service for free as long as you properly attribute the source of the data and/or images used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdaaamn%2Fmovies-api-nestjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbogdaaamn%2Fmovies-api-nestjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdaaamn%2Fmovies-api-nestjs/lists"}