{"id":21762847,"url":"https://github.com/lccodder/places-api","last_synced_at":"2026-04-08T23:34:56.493Z","repository":{"id":252541987,"uuid":"840362490","full_name":"LCcodder/places-api","owner":"LCcodder","description":"Places API written in Nest.js with Mongodb","archived":false,"fork":false,"pushed_at":"2024-11-25T19:39:01.000Z","size":585,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T17:15:42.048Z","etag":null,"topics":["api","boilerplate","geojson","graphql","nestjs","nodejs","rest"],"latest_commit_sha":null,"homepage":"","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/LCcodder.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,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T14:31:02.000Z","updated_at":"2024-11-25T19:39:04.000Z","dependencies_parsed_at":"2024-11-04T21:37:54.439Z","dependency_job_id":null,"html_url":"https://github.com/LCcodder/places-api","commit_stats":null,"previous_names":["lccodder/places-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LCcodder/places-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2Fplaces-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2Fplaces-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2Fplaces-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2Fplaces-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LCcodder","download_url":"https://codeload.github.com/LCcodder/places-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2Fplaces-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","boilerplate","geojson","graphql","nestjs","nodejs","rest"],"created_at":"2024-11-26T12:13:18.852Z","updated_at":"2026-04-08T23:34:56.476Z","avatar_url":"https://github.com/LCcodder.png","language":"TypeScript","readme":"# Places API written in `Node.js`\r\n\r\n![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)\r\n![NestJS](https://img.shields.io/badge/nestjs-%23E0234E.svg?style=for-the-badge\u0026logo=nestjs\u0026logoColor=white)\r\n![GraphQL](https://img.shields.io/badge/-GraphQL-E10098?style=for-the-badge\u0026logo=graphql\u0026logoColor=white)\r\n![MongoDB](https://img.shields.io/badge/MongoDB-%234ea94b.svg?style=for-the-badge\u0026logo=mongodb\u0026logoColor=white)\r\n![JWT](https://img.shields.io/badge/JWT-black?style=for-the-badge\u0026logo=JSON%20web%20tokens)\r\n![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white)\r\n\r\n### This is places REST API service like `geoapify` or another similar geographic API with querying and finding places in radius.\r\n\r\n+ This API works with *role-based* auth, so if you want to create/update/delete places you must provide one of the *master keys* in `token` querystring\r\n\r\n# Endpoints:\r\n1. `POST:/api/v1/auth` - returns API token with expiration time\r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eBody\u003c/summary\u003e\r\n\r\n    ```JSON\r\n    {\r\n        \"email\": \"mr_robot@ecorp.com\"\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n    \r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eResponse\u003c/summary\u003e\r\n        \r\n    ```JSON\r\n    {\r\n        \"token\": \"\u003cYOUR_TOKEN\u003e\",\r\n        \"expiresIn\": \"24h\"\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n---\r\n2. `POST:/api/v1/places` **(admin route)** - creates place with provided fields and returns created place with generated `_id` and timestamps \r\n    \r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eBody\u003c/summary\u003e\r\n    \r\n    ```JSON\r\n    {\r\n        // required\r\n        \"category\": \"goverment\",\r\n        \r\n        // required\r\n        \"subcategories\": [\"services\", \"police\"],\r\n\r\n        // required\r\n        \"datasources\": [\"OSM\", \"google maps\"],\r\n\r\n        \"geo\": {\r\n            \"coordinates\": [34.312321, 62.12476456],\r\n            \r\n            // required\r\n            \"lat\": 34.312321,\r\n            //required\r\n            \"long\": 62.12476456,\r\n\r\n            // required\r\n            \"country\": \"Russia\",\r\n            \"country_code\": \"RU\",\r\n\r\n            \"city\": \"Moscow\",\r\n            \"region\": \"Khimki\",\r\n\r\n            \"state\": \"SZAO\",\r\n            \"state_code\": \"sz\",\r\n\r\n            \"suburb\": \"Leninski prospect\",\r\n            \"street\": \"Pushkinskaya\",\r\n\r\n            // required\r\n            \"full_address\": \"Moscow, Khimki, Pushkina 12/23\",\r\n\r\n            \"address_line1\": \"string\",\r\n            \"address_line2\": \"string\",\r\n            \"address_line3\": \"string\",\r\n            \"postcode\": 123457,\r\n            \r\n            \"third_party\": {\r\n                \"google_maps_link\": \"\u003cGM link\u003e\",\r\n                \"osm\": \"\u003cosm link\u003e\",\r\n                \"osm_id\": \"asdada1231231\"\r\n            }\r\n        },\r\n\r\n        \"place\": {\r\n            // required\r\n            \"name\": \"Police department of Khimki\",\r\n            \r\n            \"full_name\": \"GU MVD of Khimki, Moscow Oblast\",\r\n            \"old_name\": \"Deputy of Khimki\",\r\n\r\n            \"description\": \"Police department, located near west road\",\r\n\r\n            \"is_heritage\": false,\r\n            \"is_guarded\": true,\r\n            \"authorized_personeel_only\": true,\r\n            \"is_goverment_property\": true,\r\n\r\n            \"founded_by\": \"Department of Justice of Moscow\",\r\n            \"builded_at\": \"2024-08-11T15:48:00.852Z\",\r\n            \"construction_started_at\": \"2024-08-11T15:48:00.852Z\",\r\n            \"builded_by\": \"REDACTED\",\r\n\r\n            \"open_hours\": {\r\n                \"from\": 0,\r\n                \"to\": 24\r\n            },\r\n\r\n            \"is_always_open\": true,\r\n            \"age_from\": 21,\r\n\r\n            \"facilities\": [\"parking\"],\r\n\r\n            \"wikipedia\": \"\u003cwiki link\u003e\",\r\n            \"images\": \"http://images.com/police-department/1\"\r\n        },\r\n\r\n        \"contacts\": {\r\n            \"website\": \"http://khpd.ru\",\r\n            \"websites\": [\"http://khpd.ru\"],\r\n\r\n            \"phone_number\": \"911\",\r\n            \"phone_numbers\": [\"911\"],\r\n\r\n            \"email\": \"khpd@p.ru\",\r\n            \"emails\": [\"khpd@p.ru\"],\r\n\r\n            \"links\": [\"http://khpd.ru\"]\r\n        },\r\n\r\n        \"law\": {\r\n            \"owner\": \"Department Of Justice\",\r\n            \"owner_law_address\": \"ae12424\",\r\n            \"owner_phisycal_address\": \"Kremlyn\",\r\n            \"license\": \"gov12313\",\r\n            \"corp\": \"S.T.A.R.S.\"\r\n        }\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eResponse\u003c/summary\u003e\r\n\r\n    ```JSON\r\n    {\r\n        \"_id\": \"66b744dbde0cb7ff86d627ad\",\r\n        \"category\": ...,\r\n        \r\n        \"subcategories\": ...,\r\n\r\n        \"datasources\": ...,\r\n\r\n        \"geo\": {\r\n            ...\r\n        },\r\n\r\n        \"place\": {\r\n            ...\r\n        },\r\n\r\n        \"contacts\": {\r\n            ...\r\n        },\r\n\r\n        \"law\": {\r\n            ...\r\n        },\r\n        \"createdAt\": \"2024-08-10T10:45:47.522Z\",\r\n        \"updatedAt\": \"2024-08-10T10:45:47.522Z\",\r\n        \"__v\": 0\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n---\r\n3. `PATCH:/api/v1/places` **(admin route)** - updates place with provided fields and returns updated place\r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eBody\u003c/summary\u003e\r\n\r\n    ```JSON\r\n    {\r\n        \"law\": {\r\n            \"owner\": \"Department Of Justice\",\r\n            \"owner_law_address\": \"[REDACTED]\",\r\n            \"owner_phisycal_address\": \"[REDACTED]\",\r\n            \"license\": \"[REDACTED]\",\r\n            \"corp\": \"S.T.A.R.S.\"\r\n        }\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n\r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eResponse\u003c/summary\u003e\r\n\r\n    ```JSON\r\n    {\r\n        \"_id\": \"66b744dbde0cb7ff86d627ad\",\r\n\r\n        \"category\": ...,\r\n        \r\n        \"subcategories\": ...,\r\n\r\n        \"datasources\": ...,\r\n\r\n        \"geo\": {\r\n            ...\r\n        },\r\n\r\n        \"place\": {\r\n            ...\r\n        },\r\n\r\n        \"contacts\": {\r\n            ...\r\n        },\r\n        \"law\": {\r\n            \"owner\": \"Department Of Justice\",\r\n            \"owner_law_address\": \"[REDACTED]\",\r\n            \"owner_phisycal_address\": \"[REDACTED]\",\r\n            \"license\": \"[REDACTED]\",\r\n            \"corp\": \"S.T.A.R.S.\"\r\n        },\r\n        \"createdAt\": \"2024-08-10T10:45:47.522Z\",\r\n        \"updatedAt\": \"2024-08-10T10:45:47.522Z\",\r\n        \"__v\": 0\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n---\r\n4. `DELETE:/api/v1/places/:id`  **(admin route)** - deletes place by `_id`\r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eResponse\u003c/summary\u003e\r\n\r\n    ```JSON\r\n    {\r\n        \"success\": true\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n---\r\n5. `GET:/api/v1/places/:id` **(user route)** - returns found place by `_id`\r\n\r\n+ Supports XML format, if you need given data to be in XML use `Content-Type`header with `application/xml`\r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eResponse\u003c/summary\u003e\r\n\r\n    ```JSON\r\n    {\r\n        \"_id\": \"66b744dbde0cb7ff86d627ad\",\r\n\r\n        \"category\": ...,\r\n        \r\n        \"subcategories\": ...,\r\n\r\n        \"datasources\": ...,\r\n\r\n        \"geo\": {\r\n            ...\r\n        },\r\n\r\n        \"place\": {\r\n            ...\r\n        },\r\n\r\n        \"contacts\": {\r\n            ...\r\n        },\r\n        \"law\": {\r\n            ...\r\n        },\r\n        \"createdAt\": \"2024-08-10T10:45:47.522Z\",\r\n        \"updatedAt\": \"2024-08-10T10:45:47.522Z\",\r\n        \"__v\": 0\r\n    }\r\n    ```\r\n    \u003c/details\u003e\r\n\r\n---\r\n   \r\n\r\n6. `GET:/api/v1/places` **(user route)** - returns places by provided options\r\n\r\n+ Supports XML format, if you need given data to be in XML use `Content-Type`header with `application/xml`\r\n    \r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eOptions\u003c/summary\u003e\r\n    \r\n    | Querystring        | Description                                                      | Example value                |\r\n    |--------------------|------------------------------------------------------------------|------------------------------|\r\n    | **category**       | _Filters place by category_                                      | `shops`                      |\r\n    | **subcategories**  | _Adds additional categories, that can be divided by \".\"_         | `groceries.vegan`            |\r\n    | **city**           | _Filters place by city (case is necessary)_                      | `Moscow`                     |\r\n    | **country**        | _Filters place by country (case is necessary)_                   | `Russia`                     |\r\n    | **state**          | _Filters place by state (case is necessary)_                     | `Arizona`                    |\r\n    | **state_code**     | _Filters place by shortened state_                               | `AZ`                         |\r\n    | **region**         | _Filters place by state region (case is necessary)_              | `Glendale`                   |\r\n    | **postcode**       | _Filters place by postcode (must be number)_                     | `123133`                     |\r\n    | **builded_by**     | _Filters place by creator/builder_                               | `Stanford Professor`         |\r\n    | **open_from**      | _Filters by place opening hours (24h format)_                    | `10`                         |\r\n    | **open_to**        | _Filters by place closing hours (24h format)_                    | `23`                         |\r\n    | **is_always_open** | _Filters only always-open places (1 or 0)_                       | `1`                          |\r\n    | **age_from**       | _Filters by place minimal allowed age to enter (must be number)_ | `18`                         |\r\n    | **facilities**     | _Filters by place facilities such as parking (string array)_     | `parking` `disabled_support` |\r\n    | **owner**          | _Filters by place owner_                                         | `Donald Trump`               |\r\n    | **license**        | _Filters by place license (or any law document)_                 | `gambling_license`           |\r\n    | **corp**           | _Filters place by owning corp_                                   | `Apple`                      |\r\n    | **sort**           | _Sorts places bu build date (1 or -1)_                           | `-1`                         |\r\n    | **limit**          | _Pagination limit_                                               | `1`                          |\r\n    | **offset**         | _Pagination offset_                                              | `2`                          |\r\n\r\n    \u003c/details\u003e\r\n\r\n    \u003cdetails\u003e\r\n    \u003csummary\u003eResponse\u003c/summary\u003e\r\n\r\n    ```JSON\r\n    [\r\n        {\r\n            \"_id\": ...,\r\n\r\n            \"category\": ...,\r\n            \r\n            \"subcategories\": ...,\r\n\r\n            \"datasources\": ...,\r\n\r\n            \"geo\": {\r\n                ...\r\n            },\r\n\r\n            \"place\": {\r\n                ...\r\n            },\r\n\r\n            \"contacts\": {\r\n                ...\r\n            },\r\n            \"law\": {\r\n                ...\r\n            },\r\n            \"createdAt\": ...,\r\n            \"updatedAt\": ...,\r\n            \"__v\": 0\r\n        },\r\n        {\r\n            \"_id\": ...,\r\n\r\n            \"category\": ...,\r\n            \r\n            \"subcategories\": ...,\r\n\r\n            \"datasources\": ...,\r\n\r\n            \"geo\": {\r\n                ...\r\n            },\r\n\r\n            \"place\": {\r\n                ...\r\n            },\r\n\r\n            \"contacts\": {\r\n                ...\r\n            },\r\n            \"law\": {\r\n                ...\r\n            },\r\n            \"createdAt\": ...,\r\n            \"updatedAt\": ...,\r\n            \"__v\": 0\r\n        }\r\n    ]\r\n    ```\r\n    \u003c/details\u003e\r\n\r\n# Graphql\r\n\r\n### API supports Graphql query on finding multiple places or one place by id\r\n+ You can found schema at `/src/api/graphql/schemas/place.graphql`\r\n+ To access Graphql use `/api/v1/graphql` endpoint\r\n+ `places` query supports all options that in http endpoint\r\n+ To provide api token use `token` header, unlike queryparam in http endpoint\r\n\r\n# Launch\r\n\r\n1. Copy this repo\r\n```shell\r\ngit clone https://github.com/LCcodder/places-api\r\n```\r\n2. Install packages\r\n```shell\r\nnpm i\r\n```\r\n3. Configure environment variables in `.env` file\r\n4. Make sure you running `Mongodb`\r\n5. Run app\r\n```shell\r\nnpm start\r\n```\r\n\r\nOR\r\n1. Copy this repo\r\n```shell\r\ngit clone https://github.com/LCcodder/places-api\r\n```\r\n2. Run Docker compose:\r\n```shell\r\ndocker compose up --build\r\n```\r\n\r\n---\r\n### Made by [LCcodder](https://github.com/LCcodder)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flccodder%2Fplaces-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flccodder%2Fplaces-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flccodder%2Fplaces-api/lists"}