{"id":41315383,"url":"https://github.com/checkaayush/sampark","last_synced_at":"2026-01-23T05:30:39.926Z","repository":{"id":84791523,"uuid":"204028948","full_name":"checkaayush/sampark","owner":"checkaayush","description":":card_index: Contact Book REST API in Golang","archived":false,"fork":false,"pushed_at":"2023-12-18T21:41:15.000Z","size":2758,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-02T02:25:53.326Z","etag":null,"topics":["contact-book","docker","golang","mongodb","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/checkaayush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-08-23T15:52:43.000Z","updated_at":"2022-06-07T08:33:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf86dd25-44fb-41b0-9593-e4214bf1d288","html_url":"https://github.com/checkaayush/sampark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/checkaayush/sampark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkaayush%2Fsampark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkaayush%2Fsampark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkaayush%2Fsampark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkaayush%2Fsampark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/checkaayush","download_url":"https://codeload.github.com/checkaayush/sampark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkaayush%2Fsampark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28680720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T04:33:33.518Z","status":"ssl_error","status_checked_at":"2026-01-23T04:33:30.433Z","response_time":59,"last_error":"SSL_read: 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":["contact-book","docker","golang","mongodb","rest-api"],"created_at":"2026-01-23T05:30:39.390Z","updated_at":"2026-01-23T05:30:39.918Z","avatar_url":"https://github.com/checkaayush.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/4137581/63674200-a3cba480-c803-11e9-9f47-b90669bef337.png\" height=\"130px\"/\u003e\n  \u003c/p\u003e\n  \n  \u003ch1\u003eSampark\u003c/h1\u003e\n  \n  \u003cimg src=\"https://github.com/checkaayush/sampark/workflows/build/badge.svg?branch=master\"/\u003e\n\n  \u003ca href=\"https://goreportcard.com/report/github.com/checkaayush/sampark\"\u003e\n    \u003cimg src=\"https://goreportcard.com/badge/github.com/checkaayush/sampark\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Introduction\n\nSampark is a contact book REST API written in Golang. It uses MongoDB as the primary data store and is built using [SOLID](https://en.wikipedia.org/wiki/SOLID) design priciples and [12-Factor App](https://12factor.net/) methodology in mind.\n\n### API Specification\n\n- GET `/v1/health` Health check to indicate API health\n- POST `/v1/contacts` Creates a contact\n- GET `/v1/contacts` Lists and searches contacts\n- GET `/v1/contacts/{id}` Fetches contact by ID\n- PATCH `/v1/contacts/{id}` Updates a contact\n- DELETE `/v1/contacts/{id}` Deletes contact by ID\n\n### API Remarks\n\n- API has been hosted on Heroku (https://sampark.herokuapp.com)\n- API supports CRUD operations on `Contact` entity\n- Each contact has a unique email address, which is ensured by having a unique index on the `email` field\n- Allows searching by name and email address. GET `/v1/contacts?name=\u003cNAME\u003e\u0026email=\u003cEMAIL\u003e` lets you search via name and/or email\n- Search supports pagination and returns 10 items by default per invocation. Example: GET `/v1/contacts?page=1\u0026limit=5`.\n- Added tests for each functionality\n- Basic authentication has been added using environment variables\n- Some preliminary load tests will ensure that the code can scale-out for millions of contacts\n\n### Error Codes\n\n| Code Range | Description                                                                                                                             |\n| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| 2xx        | This range of response code indicates that request was fulfilled successfully and no error was encountered.                             |\n| 400        | This return code indicates that there was an error in fulfilling the request because the supplied parameters are invalid or inadequate. |\n| 401        | This return code means that we are not able to authenticate your request. Please re-check your username and password.                   |\n| 5xx        | This response code indicates that there was an internal server error while processing the request.                                      |\n\n## Development\n\n\u003e Pre-requisites: Install latest stable versions of Docker and Docker Compose.\n\n1. Clone the repository locally.\n2. Add .env file in the repository root by modifying the .env.template file as needed.\n3. From repository root, run:\n```bash\nmake start\n```\n4. API will be up and running at http://localhost:5000.\n\n## Testing\n\nFrom repository root, run:\n```bash\nmake test\n```\n\n### Dependency Management\n\n`Sampark` uses Go modules with semantic versioning and is tested with Go 1.12+.\n\n* Update all direct and indirect dependencies using `go get -u`.\n* Remove unused dependencies using `go mod tidy`.\n* Add a new dependency using `go get \u003cpath-to-dependency\u003e`.\n\n#### Dependencies\n\n* [echo](https://echo.labstack.com/) - Web framework\n* [realize](https://github.com/oxequa/realize) - Live reloading\n* [mgo.v2](https://gopkg.in/mgo.v2) - MongoDB driver\n* [testify](https://github.com/stretchr/testify) - Assertions library\n\n## References\n\n* [Go Modules](https://github.com/golang/go/wiki/Modules)\n\u003c!-- * [Using MongoDB Go Driver](https://vkt.sh/go-mongodb-driver-cookbook/) --\u003e\n\n## Acknowledgements\n\n\u003e Logo credit goes to [Freepik](https://www.flaticon.com/authors/freepik) from [Flaticon](https://www.flaticon.com) and is licensed under [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckaayush%2Fsampark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheckaayush%2Fsampark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckaayush%2Fsampark/lists"}