{"id":29946407,"url":"https://github.com/isogram/go-api-blueprint","last_synced_at":"2026-04-19T03:04:40.392Z","repository":{"id":57599774,"uuid":"82097745","full_name":"isogram/go-api-blueprint","owner":"isogram","description":"This project demonstrates how to structure and build an API using the Go language without a framework.","archived":false,"fork":false,"pushed_at":"2017-02-15T19:28:03.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-03T05:22:52.080Z","etag":null,"topics":["api","blueprint","go","golang","mgo","mongodb","rest-api"],"latest_commit_sha":null,"homepage":null,"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/isogram.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}},"created_at":"2017-02-15T19:25:22.000Z","updated_at":"2020-08-24T07:29:30.000Z","dependencies_parsed_at":"2022-09-18T09:21:06.286Z","dependency_job_id":null,"html_url":"https://github.com/isogram/go-api-blueprint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/isogram/go-api-blueprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isogram%2Fgo-api-blueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isogram%2Fgo-api-blueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isogram%2Fgo-api-blueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isogram%2Fgo-api-blueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isogram","download_url":"https://codeload.github.com/isogram/go-api-blueprint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isogram%2Fgo-api-blueprint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31992822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["api","blueprint","go","golang","mgo","mongodb","rest-api"],"created_at":"2025-08-03T05:14:17.736Z","updated_at":"2026-04-19T03:04:40.342Z","avatar_url":"https://github.com/isogram.png","language":"Go","readme":"# Go API Blueprint\n\nThis project demonstrates how to structure and build an API using the Go language without a framework.\n\n## Prerequisites\n\n- Go \u003e= v1.5.x (**BUT Go v.1.7.x more recommended**)\n- MySQL\n- MongoDB\n\nIf you are on Go 1.5, you need to set GOVENDOREXPERIMENT to 1.\nIf you are on Go 1.4 or earlier, the code will not work because it uses the vendor folder.\n\n## Structure\n\nThe majority of the code is in the **vendor/app** folder. There were a lot of users trying to use the code on their own, but had to change all the imports path for it to work properly.\nThe only downside is godoc does not work with the vendor folder method. Luckily, all the code can be moved out of the vendor folder and then a quick find and replace will get it working again if you want.\n\nBy dafault we are using MongoDB with authentication, you need to update DSN in **vendor/app/commons/mongodb/mongodb.go** if your MongoDB server does not have authentication.\n\n## Rules for Consistency\n\nRules for mapping HTTP methods to CRUD:\n\n```\nPOST   - Create (add record into database)\nGET    - Read (get record from the database)\nPUT    - Update (edit record in the database)\nDELETE - Delete (remove record from the database)\n```\n\nRules for status codes:\n\n```\n* Create something - 201 (Created)\n* Read something - 200 (OK)\n* Update something - 200 (OK)\n* Delete something - 200 (OK)\n* Create but missing info - 400 (Bad Request)\n* Any other error - 500 (Internal Server Error)\n```\n\nRules for messages:\n\n```\n* 201 - item created\n* 200 - item found; no items to find; items deleted; no items to delete; etc\n* 400 - [field] is missing; [field] needs to be type: [type]\n* 500 - an error occurred, please try again later (should also log error because it's a programming or server issue)\n```\n\n## Goals for this project\n\nIntegrate security similar to Parse: http://blog.parse.com/learn/secure-your-app-one-class-at-a-time/\n\nCode generation for the following:\n* Controllers with routes\n* Models\n* Endpoint tests\n* Swagger spec\n\n## Thanks for the awesome project\n\n- [josephspurrier/gowebapi](https://github.com/josephspurrier/gowebapi)\n- [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter)\n- [gorilla/context](https://github.com/gorilla/context)\n- [spf13/viper](https://github.com/spf13/viper)\n- [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)\n- [jmoiron/sqlx](https://github.com/jmoiron/sqlx)\n- [justinas/alice](https://github.com/justinas/alice)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisogram%2Fgo-api-blueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisogram%2Fgo-api-blueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisogram%2Fgo-api-blueprint/lists"}