{"id":15322131,"url":"https://github.com/edmartt/locstorager","last_synced_at":"2026-05-05T04:37:20.990Z","repository":{"id":177217001,"uuid":"659068003","full_name":"Edmartt/locstorager","owner":"Edmartt","description":"This microservice helps to storage locations with name, latitude and longitude","archived":false,"fork":false,"pushed_at":"2023-10-17T20:38:59.000Z","size":47,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-01T18:43:33.113Z","etag":null,"topics":["docker","factory-pattern","flask","flask-api","flask-caching","flask-restful","postgresql","psycopg2-binary","redis-cache","solid-principles"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Edmartt.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":"2023-06-27T04:41:08.000Z","updated_at":"2023-06-29T07:39:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"f63db143-09dc-444f-be3a-1c39767de5a4","html_url":"https://github.com/Edmartt/locstorager","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"93fb27f5bffae3b64a8b964fc1a3fca9d640cb27"},"previous_names":["edmartt/locstorager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Flocstorager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Flocstorager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Flocstorager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edmartt%2Flocstorager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edmartt","download_url":"https://codeload.github.com/Edmartt/locstorager/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245864059,"owners_count":20684959,"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":["docker","factory-pattern","flask","flask-api","flask-caching","flask-restful","postgresql","psycopg2-binary","redis-cache","solid-principles"],"created_at":"2024-10-01T09:14:17.837Z","updated_at":"2026-05-05T04:37:15.952Z","avatar_url":"https://github.com/Edmartt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Locstorager\n\nlocstorager is a microservice that has endpoints to store locations with name, latitude and longitude in a SQL database. The purpose is to store these locations so that later the wrapper-piper service with two ids can make a distance calculation using the Euclidean formula.\n\nFor every location saved, we need to return the location id property\n\n\n## Requirements\n\n- Python 3.11\n- Docker\n- Postgres\n\n## Project structure\n\n```\n.\n├── config.py\n├── Dockerfile\n├── envrc.example\n├── README.md\n├── requirements.txt\n├── run.py\n└── src\n    ├── database\n    │   ├── db_interface.py\n    │   ├── __init__.py\n    │   ├── postgres.py\n    │   └── schema.py\n    ├── __init__.py\n    └── locations\n        ├── cache\n        │   ├── cache_redis.py\n        │   └── __init__.py\n        ├── data\n        │   ├── __init__.py\n        │   ├── pg_access_interface.py\n        │   └── pg_data_access.py\n        ├── hooks.py\n        ├── __init__.py\n        ├── locs.py\n        ├── models\n        │   ├── __init__.py\n        │   └── model.py\n        └── routes.py\n```\n\n## Running\n\n1. Clone the repo\n\n```\nhttps://github.com/Edmartt/locstorager.git\n```\n\n2. Browse into the project folder\n\n```\ncd locstorager/\n```\n\n## Running with Flask\n\n1. Create virtual environment\n\n```\npython3 -m venv \u003cvirtual environment name\u003e\n```\n\n\n2. Activate virtual environment\n\n```\nsource env/bin/activate\n```\n\n3. Install dependencies\n\n```\npip3 install -r requirements\n```\n\n4. set the environment variables following the envrc.example\n\n```\nsource .envrc\n```\n\n5. Run\n\n```\nflask run -p \u003cport\u003e\n```\n\n## Running with Docker\n\n1. Pull the image from Dockerhub\n\n```\ndocker pull edmartt/locstorager\n```\n\n2. set .env file following env.example\n\n3. Create container\n\n```\ndocker run --rm -p \u003chost-port:docker-port\u003e --env-file .env edmartt/locstorager\n```\n\n### Note\n\nThis service requires a postgres database, and a redis instance running, so, if we send some requests for saving data in the database we'll get an error. If we try to get all the locations we'll see an erro related to REDIS, this is normal because this service is intended to be attached with docker compose in this project [wrapper-piper](https://github.com/Edmartt/wrapper-piper). You'll find the endpoint docs and the deployment with docker compose in that repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmartt%2Flocstorager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedmartt%2Flocstorager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedmartt%2Flocstorager/lists"}