{"id":17681301,"url":"https://github.com/madeindjs/sentryo","last_synced_at":"2025-03-12T14:31:06.867Z","repository":{"id":96109250,"uuid":"180398500","full_name":"madeindjs/sentryo","owner":"madeindjs","description":"A small REST API to test somes Go features","archived":true,"fork":false,"pushed_at":"2019-04-11T13:14:44.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T21:41:43.758Z","etag":null,"topics":["echo","golang","sqlite3"],"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/madeindjs.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":"2019-04-09T15:35:27.000Z","updated_at":"2023-06-29T19:57:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"7735285e-26f2-48e3-849b-ff60aaf42a52","html_url":"https://github.com/madeindjs/sentryo","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/madeindjs%2Fsentryo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindjs%2Fsentryo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindjs%2Fsentryo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madeindjs%2Fsentryo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madeindjs","download_url":"https://codeload.github.com/madeindjs/sentryo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243234460,"owners_count":20258470,"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":["echo","golang","sqlite3"],"created_at":"2024-10-24T09:10:45.069Z","updated_at":"2025-03-12T14:31:06.853Z","avatar_url":"https://github.com/madeindjs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentryo\n\nA small REST web API endpoints to test GO lang. The purpose of this repository is to experiment [Go](https://golang.org/) ecosystem. I intentionally avoid complete Frameworks and ORM to build this app. I use only theses libraries:\n\n- [echo](https://echo.labstack.com/) a small HTTP web server (because using Plain Go HTTP library become ugly when application grow)\n- [go-sqlite3](https://github.com/mattn/go-sqlite3) to communicate with database\n- [glog](https://github.com/golang/glog) to improve logging system\n\nFor the moment, I only implement theses REST endpoints:\n\n- vehicles\n  - GET `/`  to print this readme file\n  - GET `/vehicles/` to list vehicles\n  - GET `/vehicles/:id` to show a vehicle\n- starships\n  - GET `/starships/` to list starships\n  - GET `/starships/:id` to show a starship\n- peoples\n  - GET `/peoples/` to list peoples\n  - GET `/peoples/:id` to show a people\n  - POST `/peoples/` to create a people\n  - PUT `/peoples/:id` to update a people\n  - DELETE `/peoples/:id` to destroy a people\n\nI made choice to adapt my code according to the given database schema (which is no good at all  because there are only `TEXT` fields, no primary/foreigns keys, etc..). Also there are a lack consistency about tables name who mix singular and plural names.\n\n## Usage\n\nTheres some examples using cURL:\n\nCreate a people:\n\n    $ curl -X POST -H 'Content-Type: application/json' \\\n           -d '{\"id\":\"42\",\"name\":\"Toto\",\"gender\":\"Male\"}' \\\n           http://localhost:1323/peoples/\n\nFind a people:\n\n    $ curl http://localhost:1323/peoples/42\n\nUpdate a people:\n\n    $ curl -X PUT -H 'Content-Type: application/json' \\\n           -d '{\"name\":\"tata\",\"gender\":\"male\"}'  \\\n          http://localhost:1323/peoples/42\n\nRemove a people:\n\n    $ curl -X DELETE http://localhost:1323/peoples/42\n\n## Installation\n\nSimply run `go get` \u0026 build project using Go compiler:\n\n    $ go get github.com/madeindjs/sentryo\n    $ cd \"$GOPATH/github.com/madeindjs/sentryo\"\n    $ go build main.go\n    \n\u003e Please note you need to [Install SQlite](https://www.sqlite.org/download.html) on your system\n\n---\n\n### Go further\n\nTo go further I recommend theses actions:\n\n- Use [Dep](https://golang.github.io/dep) package manager\n- Add some unit test to tests CRUD Models methods\n- Correct SQLite database schema to use primary/foreign keys, correct field types, etc..\n- Implement [Thread Safe Singleton](http://marcio.io/2015/07/singleton-pattern-in-go/) for database system\n- Convert Markdown to HTML on the landing page\n- Factorize Starships \u0026 Vehicles (who are basically the same thing)\n- Respect [JSON:API](https://jsonapi.org/) norm\n- Add a caching system\n\n### Links\n\nThere some useful resources I saw during development:\n\n- \u003chttps://thenewstack.io/building-a-web-server-in-go/\u003e\n- \u003chttps://tutorialedge.net/golang/creating-restful-api-with-golang/\u003e\n- [List of HTTP Codes in Go net/http](https://golang.org/src/net/http/status.go)\n- [Singleton in Go](http://marcio.io/2015/07/singleton-pattern-in-go/)\n- [Go Database documentation](http://go-database-sql.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeindjs%2Fsentryo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadeindjs%2Fsentryo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadeindjs%2Fsentryo/lists"}