{"id":20011359,"url":"https://github.com/mvillarrealb/poi-api","last_synced_at":"2026-06-08T08:32:11.126Z","repository":{"id":98388548,"uuid":"376418656","full_name":"mvillarrealb/poi-api","owner":"mvillarrealb","description":"Points of Interest api with Go","archived":false,"fork":false,"pushed_at":"2021-06-21T23:26:46.000Z","size":26724,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T20:22:28.537Z","etag":null,"topics":["golang","rest-api","serverless"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mvillarrealb.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":"2021-06-13T02:16:54.000Z","updated_at":"2021-06-28T06:39:52.000Z","dependencies_parsed_at":"2023-03-25T23:17:27.040Z","dependency_job_id":null,"html_url":"https://github.com/mvillarrealb/poi-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mvillarrealb/poi-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvillarrealb%2Fpoi-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvillarrealb%2Fpoi-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvillarrealb%2Fpoi-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvillarrealb%2Fpoi-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvillarrealb","download_url":"https://codeload.github.com/mvillarrealb/poi-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvillarrealb%2Fpoi-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34055249,"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-08T02:00:07.615Z","response_time":111,"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":["golang","rest-api","serverless"],"created_at":"2024-11-13T07:25:33.186Z","updated_at":"2026-06-08T08:32:11.107Z","avatar_url":"https://github.com/mvillarrealb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Points of Interest api with GO\n\nA restful api for creating Points of interest using uber H3 :) and Go\n\n# Exposed Resources\n\nThe following Resources \u0026 Operations are exposed in our Api:\n\nPath|Verb|Description\n---|---|---\n/categories|GET|List all categories\n/categories|POST|Create a category\n/categories/{id}|GET|Get a category by id\n/categories/{id}|PUT| Update a category\n/categories/{id}|DELETE| Delete a Category\n/geo_code|GET|Get the area of a given latitude, longitude\n/poi|GET|List all Points of interest\n/poi|POST|Create a point of interest\n/poi/{id}|GET|Get a single point of interest\n/poi/{id}|DELETE|Delete a point of interest\n\n# Module And dependencies\n\nThe following dependencies were used for the api:\n\n* github.com/go-playground/validator\n* github.com/gorilla/mux\n* gorm.io/driver/postgres\n* github.com/gorilla/handlers\n* gorm.io/gorm\n* github.com/uber/h3-go\n\n# Directory Structure\n\nThis is the directory structure to support our api\n\n```sh\n|\n|-|Dockerfile\n|-|go.mod #Go module file\n|-|main.go #Application entry point\n|-|api # Api related directory\n|---|common #Common functions\n|---|models # GORM models\n|---|routes # Mux routes\n|---|api.go # Main api\n```\n# Api entrypoint\n\nOur api entrypoint will create a new Api reference passing as parameters the following environment variables\n\nEnvironment|Description\n---|---\nDATABASE_PORT|Database instance port\nDATABASE_HOST| Database hostname/ip address\nDATABASE_USERNAME|Database user\nDATABASE_PASSWORD|Database password\n\n```go\n//main.go\npackage main\n\nimport (\n\t\"os\"\n\t\"poi-api/api\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tport, err := strconv.Atoi(os.Getenv(\"DATABASE_PORT\"))\n\tif err != nil {\n\t\tpanic(\"Invalid Database port\")\n\t} else {\n\t\tapp := api.New(\n\t\t\tos.Getenv(\"DATABASE_HOST\"),\n\t\t\tport,\n\t\t\tos.Getenv(\"DATABASE_USERNAME\"),\n\t\t\tos.Getenv(\"DATABASE_PASSWORD\"))\n\t\tapp.Run(\":8080\")\n\t}\n}\n\n```\n\n# Run the go application locally\n\n```sh\n# It's required a a postgresql database instance\n\nDATABASE_PORT=5432 DATABASE_HOST=127.0.0.1 DATABASE_USERNAME=postgres DATABASE_PASSWORD=casa1234 go run main.go \n```\n\n# Load Some data\n\nIn order to use the geocode endpoint and create a referenced point of interest load the [data file](./data/PE-Lima.sql), this includes all divisions on the city of Lima. I've indexed every area of the city with h3 hexagons using 11 as resolution for the index.\n\n\n\n# Build \u0026 Run Docker Image locally\n\n```sh\ndocker build -t poi-api:0.0.1 .\n\ndocker run --name poi-api --network=host -e DATABASE_PASSWORD=casa1234 poi-api:0.0.1\n```\n---\n\n# Run the Project on GCP Cloud Run\n\nTo run the project on Cloud Run [follow the tutorial](./articles/serverless_api.md)\n\n\n# Use the postman collection\n\nUse the [poi-e2e.postman_collection.json](./poi-e2e.postman_collection.json) collection to run some tests and play with the api","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvillarrealb%2Fpoi-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvillarrealb%2Fpoi-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvillarrealb%2Fpoi-api/lists"}