{"id":25470455,"url":"https://github.com/alvinmdj/mygram-api","last_synced_at":"2026-04-28T23:38:01.161Z","repository":{"id":154224254,"uuid":"625970171","full_name":"alvinmdj/mygram-api","owner":"alvinmdj","description":"MyGram (Go REST API)","archived":false,"fork":false,"pushed_at":"2023-11-30T05:34:21.000Z","size":412,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T16:46:06.260Z","etag":null,"topics":["cloudinary","docker","gin","golang","gorm","jwt","postgresql","rest-api","swagger","test-automation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alvinmdj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-04-10T14:14:41.000Z","updated_at":"2023-09-20T08:49:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fbbdfbf-8a93-4372-a0a1-1d2d7e1e7e2d","html_url":"https://github.com/alvinmdj/mygram-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alvinmdj/mygram-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinmdj%2Fmygram-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinmdj%2Fmygram-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinmdj%2Fmygram-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinmdj%2Fmygram-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alvinmdj","download_url":"https://codeload.github.com/alvinmdj/mygram-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alvinmdj%2Fmygram-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32404340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: 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":["cloudinary","docker","gin","golang","gorm","jwt","postgresql","rest-api","swagger","test-automation"],"created_at":"2025-02-18T08:34:35.959Z","updated_at":"2026-04-28T23:38:01.131Z","avatar_url":"https://github.com/alvinmdj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MyGram REST API\n\nHacktiv8 Scalable Web Service with Go - Final Project\n\n- [Postman](https://documenter.getpostman.com/view/16534190/2s93XwzjHg)\n\nTechs:\n\n- Gin Framework\n- JWT Authentication \u0026 Authorization\n- PostgreSQL \u0026 GORM\n- govalidation\n- Swagger docs\n- Cloudinary file upload\n- testing \u0026 httptest \u0026 testify\n\n## Swagger\n\n![Swagger docs](https://raw.githubusercontent.com/alvinmdj/mygram-api/main/assets/swagger-screenshot.png \"Swagger docs\")\n\n## Endpoints\n\n| Category     | Method | Endpoint                             | Middleware                     | Description               |\n|--------------|--------|--------------------------------------|--------------------------------|---------------------------|\n| User         | POST   | /api/v1/users/register               | -                              | User registration         |\n| User         | POST   | /api/v1/users/login                  | -                              | User login                |\n| Photo        | GET    | /api/v1/photos                       | Authentication                 | Get all photos            |\n| Photo        | GET    | /api/v1/photos/:id                   | Authentication                 | Get photo by ID           |\n| Photo        | POST   | /api/v1/photos                       | Authentication                 | Create new photo          |\n| Photo        | PUT    | /api/v1/photos/:id                   | Authentication \u0026 Authorization | Update photo by ID        |\n| Photo        | DELETE | /api/v1/photos/:id                   | Authentication \u0026 Authorization | Delete photo by ID        |\n| Comment      | GET    | /api/v1/photos/:photoId/comments     | Authentication                 | Get all comments          |\n| Comment      | GET    | /api/v1/photos/:photoId/comments/:id | Authentication                 | Get comment by ID         |\n| Comment      | POST   | /api/v1/photos/:photoId/comments     | Authentication                 | Create new comment        |\n| Comment      | PUT    | /api/v1/photos/:photoId/comments/:id | Authentication \u0026 Authorization | Update comment by ID      |\n| Comment      | DELETE | /api/v1/photos/:photoId/comments/:id | Authentication \u0026 Authorization | Delete comment by ID      |\n| Social Media | GET    | /api/v1/social-medias                | Authentication                 | Get all social medias     |\n| Social Media | GET    | /api/v1/social-medias/:id            | Authentication                 | Get social media by ID    |\n| Social Media | POST   | /api/v1/social-medias                | Authentication                 | Create new social media   |\n| Social Media | PUT    | /api/v1/social-medias/:id            | Authentication \u0026 Authorization | Update social media by ID |\n| Social Media | DELETE | /api/v1/social-medias/:id            | Authentication \u0026 Authorization | Delete social media by ID |\n\n## Links\n\n- [gorm](https://gorm.io/)\n- [govalidator](https://github.com/asaskevich/govalidator)\n- [swaggo](https://github.com/swaggo/swag)\n- [gin upload file](https://gin-gonic.com/docs/examples/upload-file/single-file/)\n- [cloudinary go upload file](https://cloudinary.com/documentation/go_image_and_video_upload)\n- [cloudinary go example](https://cloudinary.com/documentation/go_integration#complete_sdk_example)\n- [cloudinary destroy file](https://cloudinary.com/documentation/image_upload_api_reference#destroy_method)\n- [go live reload (air)](https://github.com/cosmtrek/air)\n- [example docker setup with go](https://levelup.gitconnected.com/dockerized-crud-restful-api-with-go-gorm-jwt-postgresql-mysql-and-testing-61d731430bd8)\n- [Makefile .PHONY](https://stackoverflow.com/questions/2145590/what-is-the-purpose-of-phony-in-a-makefile)\n\n## Dependencies\n\n- `go get github.com/asaskevich/govalidator`\n- `go get github.com/golang-jwt/jwt/v5`\n- `go get github.com/gin-gonic/gin`\n- `go get golang.org/x/crypto`\n- `go get gorm.io/driver/postgres`\n- `go get gorm.io/gorm`\n- `go get github.com/joho/godotenv`\n- `go get github.com/swaggo/swag/cmd/swag`\n- `go get github.com/swaggo/gin-swagger`\n- `go get github.com/swaggo/files`\n- `go get github.com/google/uuid`\n- `go get github.com/cloudinary/cloudinary-go/v2`\n- `go get github.com/cloudinary/cloudinary-go/v2/api/uploader`\n- `go get github.com/stretchr/testify`\n\n## Setup DB (Postgres)\n\n- Login psql: `psql -U postgres`\n- Show databases: `\\list` or `\\l`\n- Create database: `CREATE DATABASE db_mygram_api;` \u0026 `CREATE DATABASE db_mygram_api_test;`\n- Select database: `\\c db_mygram_api`\n- Show tables: `dt`\n\n## Setup env\n\n- Copy `cp .env.example .env`\n- Setup environment variables\n\n## Init swagger docs\n\n- using Makefile: `make swagger`\n\nDuring local development, swagger docs available at: `http://localhost:8080/swagger/index.html`\n\n## Run test\n\n- using Makefile: `make test`\n\n## Run app\n\n- local development: `make start` or `air` for live reload\n- or using Docker: `docker compose up`\n\n## Build app\n\n- using Makefile: `make build`\n\nBuild result at `/bin/mygram-api.exe`\n\n## Create random string\n\n`openssl rand -base64 32`\n\n## DB Schema\n\n![DB schema](https://raw.githubusercontent.com/alvinmdj/mygram-api/main/assets/db-schema.png \"DB schema\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinmdj%2Fmygram-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falvinmdj%2Fmygram-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falvinmdj%2Fmygram-api/lists"}