{"id":15095843,"url":"https://github.com/rashidkalwar/go-crud","last_synced_at":"2026-01-25T01:02:58.767Z","repository":{"id":254964802,"uuid":"847802874","full_name":"rashidkalwar/go-crud","owner":"rashidkalwar","description":"Simple Todo Rest API written in Golang","archived":false,"fork":false,"pushed_at":"2024-08-30T12:10:12.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T22:11:21.561Z","etag":null,"topics":["dock","docker-compose","gin","go","gorm","postgre","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/rashidkalwar.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,"zenodo":null}},"created_at":"2024-08-26T15:18:29.000Z","updated_at":"2024-12-23T22:49:18.000Z","dependencies_parsed_at":"2025-04-14T22:20:19.499Z","dependency_job_id":null,"html_url":"https://github.com/rashidkalwar/go-crud","commit_stats":null,"previous_names":["rashidkalwar/go-crud"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rashidkalwar/go-crud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rashidkalwar%2Fgo-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rashidkalwar%2Fgo-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rashidkalwar%2Fgo-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rashidkalwar%2Fgo-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rashidkalwar","download_url":"https://codeload.github.com/rashidkalwar/go-crud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rashidkalwar%2Fgo-crud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28740399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dock","docker-compose","gin","go","gorm","postgre","rest-api"],"created_at":"2024-09-25T15:42:31.992Z","updated_at":"2026-01-25T01:02:58.749Z","avatar_url":"https://github.com/rashidkalwar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic CRUD API written in Golang using Gin, GORM, and PostgreSQL\n\nHi my name is Rashid Ali, I recently started learning about Golang and I have decided to document it so that it can be helpful for other people who are getting started as well.\n\n## Features\n\n- RESTful API with CRUD operations.\n- Database migrations using GORM.\n- Dockerized environments.\n- Environment variable support for configuration.\n\n## Prerequisites\n\nBefore you start, make sure you have the following installed:\n\n- [Git](https://git-scm.com/)\n- [Golang](https://go.dev/)\n- [Docker](https://docs.docker.com/get-docker/) (Optional)\n- [Docker Compose](https://docs.docker.com/compose/install/) (Optional)\n\n## Setup Instructions\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/rashidkalwar/go-crud.git\ncd go-crud\n```\n\n### 2. Setup environment variables\n\n- Create a .env file in the root directory of the repository and define two variables.\n- First is the port the server will listen to eg. `PORT=8080`\n- Second is the Database URL eg. `DB_URL=\"postgres://\u003cusername\u003e:\u003cpassword\u003e@\u003cIpAddress\u003e:\u003cPORT\u003e\"`.\n\n\u003e **Note:** If you have PostgreSQL installed on your system you can use that **OR** use Docker to spin up a PostgreSQL database **OR** use a free online PostgreSQL database. I would suggest [Supabase](https://supabase.com/) it has a generous free tier and a ton of other features. Here is a [Youtube](https://www.youtube.com/watch?v=9T6tjTQ4Zo4) video showing you how to do that.\n\n### 3. Download the dependencies\n\nEnsure that you have Go installed. Download the necessary dependencies using the following command:\n\n```bash\ngo mod tidy\n```\n\n### 4. Make database migrations\n\nBefore running the API, Make sure to make all the migrations to the database by running the following command:\n\n```bash\ngo run migrate/migrate.go\n```\n\n### 5. Run the application\n\nTo start the application locally, run the following command,\nOnce the application is running, you can access the API at `http://localhost:8080`\n\n```bash\ngo run cmd/main.go\n```\n\n#### Run using docker container:\n\nTo run the application using docker container, first create an image using following command:\n\n```bash\ndocker build -t image-name .\n```\n\nAfter creating an image, spin up docker a container using this image, make sure to pass in the Environment variables:\n\n```bash\ndocker run --name container-name -p 8080:8080 -e PORT=8080 -e DB_URL=\"postgres://\u003cusername\u003e:\u003cpassword\u003e@\u003cIpAddress\u003e:\u003cPORT\u003e\" image-name\n```\n\n#### Run using docker-compose:\n\nIf you have docker and docker-compose installed you don't need to do much inorder to run the application, just run the following command and it will start the application.\n\n```bash\ndocker-compose up --build\n```\n\n### 6. Testing the API\n\nYou can use tools like [Postman](https://www.postman.com) or [cURL](https://curl.se/) to test the API endpoints. Below is an example using \"cURL\":\n\n```bash\ncurl -X GET http://localhost:8080/todos\n```\n\n### Contact\n\nIf you have any questions or feedback, feel free to reach out:\n\n- GitHub: [rashidkalwar](https://github.com/rashidkalwar)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frashidkalwar%2Fgo-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frashidkalwar%2Fgo-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frashidkalwar%2Fgo-crud/lists"}