{"id":18550534,"url":"https://github.com/ayaanqui/go-rest","last_synced_at":"2026-04-30T10:01:56.128Z","repository":{"id":43346859,"uuid":"439508280","full_name":"ayaanqui/go-rest","owner":"ayaanqui","description":"Simple Go REST API server template","archived":false,"fork":false,"pushed_at":"2022-04-07T02:45:20.000Z","size":246,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-02-17T10:26:03.346Z","etag":null,"topics":["go","golang","jwt","postgresql","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayaanqui.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-18T02:17:01.000Z","updated_at":"2022-02-20T20:28:51.000Z","dependencies_parsed_at":"2022-08-20T04:01:23.299Z","dependency_job_id":null,"html_url":"https://github.com/ayaanqui/go-rest","commit_stats":null,"previous_names":["ayaanqui/go-rest-server"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayaanqui%2Fgo-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayaanqui%2Fgo-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayaanqui%2Fgo-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayaanqui%2Fgo-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayaanqui","download_url":"https://codeload.github.com/ayaanqui/go-rest/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319720,"owners_count":22051075,"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":["go","golang","jwt","postgresql","rest-api"],"created_at":"2024-11-06T21:05:06.278Z","updated_at":"2026-04-30T10:01:51.070Z","avatar_url":"https://github.com/ayaanqui.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🖥 Go REST API\n\nA simple REST API made using the standard Go library [`net/http`](https://pkg.go.dev/net/http) and PostgreSQL as the database. \n\n## Tech stack\n- [PostgreSQL](https://www.postgresql.org/) - Primary database\n- [GORM](https://gorm.io) - ORM to interact with the database programmatically\n- [Postgres for GORM](https://github.com/go-gorm/postgres) - Postgres Driver for GORM\n- [Google UUID](https://pkg.go.dev/github.com/google/uuid@v1.3.0) - Generates UUID before inserts\n- [gorilla/mux](https://github.com/gorilla/mux) - Router built using the standard Go `http.Handler` interface\n- [Goth](https://github.com/markbates/goth) - OAuth support for multiple platforms\n\n## Instructions\n\n### Set up config files\n\n#### `db_config.json`\nThis project also uses a PostgreSQL database in order to run. To start, create a file called `db_config.json` in the project root and place the following in the file, replacing all content within the `[]` with the correct database values:\n\n```json\n{\n    \"host\": \"localhost\",\n    \"db_name\": \"[database name]\",\n    \"username\": \"[database username]\",\n    \"password\": \"[database password]\",\n    \"port\": \"5432\"\n}\n```\n\n#### `tokens.json`\n\nIn addition to the `db_config.json`, you will also need to create a `tokens.json` file which will hold the JWT secret, note that this token should be a randomly generated value and must not be made public. The `token.json` file should contain the following:\n```json\n{\n    \"jwt_key\": \"[YOUR_SECRET_TOKEN]\",\n    \"twitter\": {\n        \"api_key\": \"[Twitter OAuth 1.0 API Key]\",\n        \"api_key_secret\": \"[Twitter OAuth 1.0 API Secret]\",\n        \"bearer_token\": \"[Twitter OAuth Bearer Token]\"\n    }\n}\n```\n\n### Generate Binary\n\n```\n$ make build\n```\n\nor \n\n```\n$ go build src/main.go\n```\n\nCreates an executable binary file called `main`. To run this file call `./main`, like so:\n\n```\n$ ./main\n```\n\nThis should start the server on port `3001`.\n\n### Run without Binary\n\nAnother way to run the server is by using the `make run` command.\n\n```\n$ make run\n```\n\nRunning the command should also start the server on port `3001`. This command is equivalent to running `go run src/main.go`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayaanqui%2Fgo-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayaanqui%2Fgo-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayaanqui%2Fgo-rest/lists"}