{"id":21770235,"url":"https://github.com/jonathan-foucher/gin-api-example","last_synced_at":"2026-04-18T02:02:26.320Z","repository":{"id":260840784,"uuid":"882492272","full_name":"jonathan-foucher/gin-api-example","owner":"jonathan-foucher","description":"An example of Go API with Gin","archived":false,"fork":false,"pushed_at":"2024-11-06T22:25:26.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T06:15:01.499Z","etag":null,"topics":["gin","go","sqlc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/jonathan-foucher.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-11-02T23:13:54.000Z","updated_at":"2024-11-06T22:38:52.000Z","dependencies_parsed_at":"2025-01-26T03:10:23.670Z","dependency_job_id":"ba63f1a0-e9ff-4c50-bff7-3fcefde67bed","html_url":"https://github.com/jonathan-foucher/gin-api-example","commit_stats":null,"previous_names":["jonathan-foucher/gin-api-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonathan-foucher/gin-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgin-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgin-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgin-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgin-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathan-foucher","download_url":"https://codeload.github.com/jonathan-foucher/gin-api-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fgin-api-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["gin","go","sqlc"],"created_at":"2024-11-26T14:11:47.220Z","updated_at":"2026-04-18T02:02:26.300Z","avatar_url":"https://github.com/jonathan-foucher.png","language":"Go","readme":"## Introduction\nThis project is an example of a Go API using Gin, sqlc and a postgres database.\n\n## Run the project\n### Database\nInstall postgres locally or run it through docker with :\n```\ndocker run -p 5432:5432 -e POSTGRES_DB=my_database -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres\n```\n\nYou will need to run the this request to create the movie table :\n```\ncreate table movie (\n    id              integer         primary key,\n    title           varchar(50)     not null,\n    release_date    date            not null\n);\n```\n\n### Application\nOnce the postgres database is started and the movie table created, you can start the Go project and try it out.\n\nStart the application\n```\ngo run main.go\n```\n\nGet all the movies\n```\ncurl --location 'http://localhost:3000/api/movies'\n```\n\nSave a movie\n```\ncurl --request POST \\\n  --url http://localhost:3000/api/movies \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n\t\"id\": 26,\n\t\"title\": \"Some movie title\",\n\t\"release_date\": \"2022-02-26\"\n}'\n```\n\nDelete a movie\n```\ncurl --request DELETE \\\n  --url http://localhost:3000/api/movies/26\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathan-foucher%2Fgin-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathan-foucher%2Fgin-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathan-foucher%2Fgin-api-example/lists"}