{"id":29961397,"url":"https://github.com/beemi/geolocation-microservice","last_synced_at":"2025-08-23T06:33:22.980Z","repository":{"id":246536697,"uuid":"821418135","full_name":"beemi/geolocation-microservice","owner":"beemi","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-28T14:33:09.000Z","size":98,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T23:20:23.025Z","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/beemi.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-06-28T13:48:03.000Z","updated_at":"2024-06-28T14:33:12.000Z","dependencies_parsed_at":"2024-06-28T15:14:27.011Z","dependency_job_id":"76fcc46a-f932-4cc7-858e-9d2108aee116","html_url":"https://github.com/beemi/geolocation-microservice","commit_stats":null,"previous_names":["beemi/geolocation-microservice"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/beemi/geolocation-microservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beemi%2Fgeolocation-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beemi%2Fgeolocation-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beemi%2Fgeolocation-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beemi%2Fgeolocation-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beemi","download_url":"https://codeload.github.com/beemi/geolocation-microservice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beemi%2Fgeolocation-microservice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745678,"owners_count":24813521,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"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":"2025-08-03T23:10:43.644Z","updated_at":"2025-08-23T06:33:22.795Z","avatar_url":"https://github.com/beemi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Geolocation Microservice API :earth_africa:\n\nThis project is a Node.js microservice API for geolocation-based services. It allows you to store location data and query for nearby locations based on geographic coordinates.\n\n## Features\n\n- Add new locations with coordinates\n- Find nearby locations within a specified radius\n- MongoDB for data storage\n- Docker support for easy deployment and development\n\n## Prerequisites\n\n- Node.js (v14 or later)\n- Docker and Docker Compose (for containerized setup)\n- MongoDB (if running without Docker)\n\n## Getting Started\n\n### Local Setup\n\n1. Clone the repository:\n\n```\ngit clone https://github.com/yourusername/geolocation-microservice.git\ncd geolocation-microservice\n```\n\n2. Install dependencies:\n\n```\nnpm install\n```\n\n3. Set up environment variables:\n   Create a `.env` file in the root directory with the following content:\n\n```\nMONGODB_URI=your_mongodb_connection_string\nPORT=3000\n```\n\n4. Start the server:\n\n```\nnode app.js\n```\n\n### Docker Setup\n\n1. Make sure Docker and Docker Compose are installed on your system.\n\n2. Build and run the containers:\n\n```\ndocker-compose up --build\n```\n\n## API Endpoints\n\n### Add a New Location\n\n- **URL:** `/api/locations`\n- **Method:** `POST`\n- **Body:**\n\n```json\n{\n  \"name\": \"Location Name\",\n  \"location\": {\n    \"type\": \"Point\",\n    \"coordinates\": [\"longitude\", latitude]\n  }\n}\n```\n\n- **Success Response:**\n  - **Code:** 201\n  - **Content:** `{ \"name\": \"Location Name\", \"location\": { \"type\": \"Point\", \"coordinates\": [longitude, latitude] } }`\n\n### Find Nearby Locations\n\n- **URL:** `/api/locations/nearby`\n- **Method:** `GET`\n- **URL Params:**\n  - `longitude=[number]`\n  - `latitude=[number]`\n  - `maxDistance=[number]` (in meters)\n- **Success Response:**\n  - **Code:** 200\n  - **Content:** Array of location objects\n\n## Project Structure\n\n```angular2html\ngeolocation-microservice/\n│\n├── config/\n│   ├── logger.js         # Logging configuration\n│   └── swagger.js        # Swagger/OpenAPI configuration\n├── models/\n│   └── Location.js       # MongoDB model for locations\n├── routes/\n│   └── locations.js      # API routes for location operations\n├── app.js                # Main application file\n├── Dockerfile            # Dockerfile for containerization\n├── docker-compose.yml    # Docker Compose configuration\n├── .env                  # Environment variables (create this file)\n├── package.json          # Project dependencies and scripts\n└── README.md             # Project documentation\n```\n\n## Environment Variables\n\n- `MONGODB_URI`: MongoDB connection string\n- `PORT`: Port number for the server (default: 3000)\n\n## Development\n\nTo run the application in development mode with live reloading:\n\n1. Install nodemon: `npm install -g nodemon`\n2. Run: `nodemon app.js`\n\n## Testing\n\n(Add information about running tests when you implement them)\n\n## Deployment\n\nThis application can be easily deployed using Docker. Make sure to set the appropriate environment variables for your production environment.\n\n## API Documentation\n\nThis project uses Swagger for API documentation. Once the server is running, you can access the interactive API documentation at:\n\nhttp://localhost:3000/api-docs\n\nThis documentation provides detailed information about each endpoint, including:\n\n- Available routes\n- HTTP methods\n- Request parameters\n- Request body schemas\n- Response schemas\n- Example requests and responses\n\nYou can also test the API directly through the Swagger UI.\n\nCertainly! Here's a section you can add to your README.md file to explain how Git tagging and releases work for this project based on the workflow we've set up:\n\n## Versioning and Releases\n\nThis project uses GitHub Actions for automated versioning, Docker image building, and release management. Here's how it works:\n\n### Automated Builds\n\nOn every push to the `main` branch and for every pull request:\n\n- A Docker image is built and tagged with:\n  - The short SHA of the commit\n  - The branch name (for pushes to `main`)\n  - The PR number (for pull requests)\n- The image is pushed to GitHub Container Registry (ghcr.io)\n- No Git tag or release is created for these automated builds\n\n### Creating a Release\n\nTo create a new release:\n\n1. Go to the \"Actions\" tab in the GitHub repository\n2. Click on the \"Build, Tag, and Release\" workflow\n3. Click \"Run workflow\"\n4. Enter the version number for the new release (e.g., 1.0.0)\n5. Click \"Run workflow\"\n\nThis process will:\n\n1. Create a new Git tag with the specified version (e.g., v1.0.0)\n2. Build a Docker image and tag it with the specified version\n3. Push the Docker image to GitHub Container Registry\n4. Generate a changelog based on commits since the last release\n5. Create a GitHub Release with:\n   - A title including the version number\n   - The generated changelog\n   - Docker image information and pull instructions\n\n### Versioning Scheme\n\n- For manual releases, we use semantic versioning (MAJOR.MINOR.PATCH)\n- For automated builds, we use the format: YYYY.MM.DD-{short_sha}\n\n### Accessing Releases\n\n- All releases can be found in the \"Releases\" section of the GitHub repository\n- Docker images for all builds (including non-release builds) can be found in the project's GitHub Container Registry\n\n### Using Release Docker Images\n\nTo use a specific release version of the Docker image:\n\n```bash\ndocker pull ghcr.io/USERNAME/REPO_NAME:VERSION\n```\n\nReplace `USERNAME`, `REPO_NAME`, and `VERSION` with appropriate values.\n\nFor the latest release:\n\n```bash\ndocker pull ghcr.io/USERNAME/REPO_NAME:latest\n```\n\nRemember to update your deployment scripts or Kubernetes manifests to use these image tags when deploying new versions of the application.\n\nThis section provides a comprehensive overview of how versioning and releases work in your project. It covers:\n\n1. How automated builds work for regular pushes and pull requests\n2. The step-by-step process for creating a new release\n3. What happens during the release process\n4. The versioning scheme used for both manual releases and automated builds\n5. Where to find releases and Docker images\n6. How to use the Docker images from releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeemi%2Fgeolocation-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeemi%2Fgeolocation-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeemi%2Fgeolocation-microservice/lists"}