{"id":19313646,"url":"https://github.com/mingrammer/go-todo-rest-api-example","last_synced_at":"2025-04-09T10:04:27.344Z","repository":{"id":37735805,"uuid":"87929780","full_name":"mingrammer/go-todo-rest-api-example","owner":"mingrammer","description":":books: A RESTful API example for simple todo application with Go","archived":false,"fork":false,"pushed_at":"2024-02-21T13:02:16.000Z","size":15,"stargazers_count":558,"open_issues_count":8,"forks_count":243,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-02T08:16:33.032Z","etag":null,"topics":["example","practice-golang","rest-api","tutorial"],"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/mingrammer.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":"2017-04-11T12:10:35.000Z","updated_at":"2025-03-25T21:29:45.000Z","dependencies_parsed_at":"2024-06-18T17:03:37.447Z","dependency_job_id":"9cbf182c-95cf-441e-8ee9-043c49cf2f70","html_url":"https://github.com/mingrammer/go-todo-rest-api-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fgo-todo-rest-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fgo-todo-rest-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fgo-todo-rest-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingrammer%2Fgo-todo-rest-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mingrammer","download_url":"https://codeload.github.com/mingrammer/go-todo-rest-api-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018060,"owners_count":21034048,"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":["example","practice-golang","rest-api","tutorial"],"created_at":"2024-11-10T00:40:34.136Z","updated_at":"2025-04-09T10:04:27.324Z","avatar_url":"https://github.com/mingrammer.png","language":"Go","readme":"# Go Todo REST API Example\nA RESTful API example for simple todo application with Go\n\nIt is a just simple tutorial or example for making simple RESTful API with Go using **gorilla/mux** (A nice mux library) and **gorm** (An ORM for Go)\n\n## Installation \u0026 Run\n```bash\n# Download this project\ngo get github.com/mingrammer/go-todo-rest-api-example\n```\n\nBefore running API server, you should set the database config with yours or set the your database config with my values on [config.go](https://github.com/mingrammer/go-todo-rest-api-example/blob/master/config/config.go)\n```go\nfunc GetConfig() *Config {\n\treturn \u0026Config{\n\t\tDB: \u0026DBConfig{\n\t\t\tDialect:  \"mysql\",\n\t\t\tUsername: \"guest\",\n\t\t\tPassword: \"Guest0000!\",\n\t\t\tName:     \"todoapp\",\n\t\t\tCharset:  \"utf8\",\n\t\t},\n\t}\n}\n```\n\n```bash\n# Build and Run\ncd go-todo-rest-api-example\ngo build\n./go-todo-rest-api-example\n\n# API Endpoint : http://127.0.0.1:3000\n```\n\n## Structure\n```\n├── app\n│   ├── app.go\n│   ├── handler          // Our API core handlers\n│   │   ├── common.go    // Common response functions\n│   │   ├── projects.go  // APIs for Project model\n│   │   └── tasks.go     // APIs for Task model\n│   └── model\n│       └── model.go     // Models for our application\n├── config\n│   └── config.go        // Configuration\n└── main.go\n```\n\n## API\n\n#### /projects\n* `GET` : Get all projects\n* `POST` : Create a new project\n\n#### /projects/:title\n* `GET` : Get a project\n* `PUT` : Update a project\n* `DELETE` : Delete a project\n\n#### /projects/:title/archive\n* `PUT` : Archive a project\n* `DELETE` : Restore a project \n\n#### /projects/:title/tasks\n* `GET` : Get all tasks of a project\n* `POST` : Create a new task in a project\n\n#### /projects/:title/tasks/:id\n* `GET` : Get a task of a project\n* `PUT` : Update a task of a project\n* `DELETE` : Delete a task of a project\n\n#### /projects/:title/tasks/:id/complete\n* `PUT` : Complete a task of a project\n* `DELETE` : Undo a task of a project\n\n## Todo\n\n- [x] Support basic REST APIs.\n- [ ] Support Authentication with user for securing the APIs.\n- [ ] Make convenient wrappers for creating API handlers.\n- [ ] Write the tests for all APIs.\n- [x] Organize the code with packages\n- [ ] Make docs with GoDoc\n- [ ] Building a deployment process \n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingrammer%2Fgo-todo-rest-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingrammer%2Fgo-todo-rest-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingrammer%2Fgo-todo-rest-api-example/lists"}