{"id":49544148,"url":"https://github.com/ninjadiego/go-rest-api","last_synced_at":"2026-05-02T17:06:18.563Z","repository":{"id":352702981,"uuid":"1216266812","full_name":"ninjadiego/go-rest-api","owner":"ninjadiego","description":"🚀 RESTful API built with Go, Gin, JWT authentication and MySQL — clean architecture, ready for production","archived":false,"fork":false,"pushed_at":"2026-04-20T18:39:40.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T20:32:49.536Z","etag":null,"topics":["gin","golang","jwt","mysql","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ninjadiego.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T18:28:46.000Z","updated_at":"2026-04-20T18:41:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ninjadiego/go-rest-api","commit_stats":null,"previous_names":["ninjadiego/go-rest-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ninjadiego/go-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjadiego%2Fgo-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjadiego%2Fgo-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjadiego%2Fgo-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjadiego%2Fgo-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ninjadiego","download_url":"https://codeload.github.com/ninjadiego/go-rest-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjadiego%2Fgo-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32542232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"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":["gin","golang","jwt","mysql","rest-api"],"created_at":"2026-05-02T17:06:17.852Z","updated_at":"2026-05-02T17:06:18.556Z","avatar_url":"https://github.com/ninjadiego.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 go-rest-api\n\nA production-ready RESTful API built with **Go**, **Gin**, **JWT authentication**, and **MySQL**. Follows clean architecture principles with a clear separation of concerns.\n\n## 🛠️ Tech Stack\n\n![Go](https://img.shields.io/badge/Go-00ADD8?style=flat\u0026logo=go\u0026logoColor=white)\n![Gin](https://img.shields.io/badge/Gin-00ADD8?style=flat\u0026logo=go\u0026logoColor=white)\n![MySQL](https://img.shields.io/badge/MySQL-4479A1?style=flat\u0026logo=mysql\u0026logoColor=white)\n![JWT](https://img.shields.io/badge/JWT-000000?style=flat\u0026logo=jsonwebtokens\u0026logoColor=white)\n![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat\u0026logo=docker\u0026logoColor=white)\n\n## ✨ Features\n\n- ✅ User registration and login\n- - ✅ JWT-based authentication \u0026 authorization\n  - - ✅ CRUD operations for resources\n    - - ✅ MySQL database with GORM ORM\n      - - ✅ Middleware for route protection\n        - - ✅ Environment-based configuration\n          - - ✅ Clean Architecture (handlers, services, repositories)\n            - - ✅ Docker \u0026 Docker Compose support\n             \n              - ## 📁 Project Structure\n             \n              - ```\n                go-rest-api/\n                ├── cmd/\n                │   └── main.go              # Entry point\n                ├── internal/\n                │   ├── handlers/            # HTTP handlers\n                │   ├── middleware/          # JWT middleware\n                │   ├── models/              # Data models\n                │   ├── repository/          # Database layer\n                │   └── services/            # Business logic\n                ├── config/\n                │   └── config.go            # App configuration\n                ├── docker-compose.yml\n                ├── .env.example\n                ├── go.mod\n                └── README.md\n                ```\n\n                ## 🔌 API Endpoints\n\n                ### Auth\n                | Method | Endpoint | Description |\n                |--------|----------|-------------|\n                | POST | `/api/v1/auth/register` | Register a new user |\n                | POST | `/api/v1/auth/login` | Login and get JWT token |\n\n                ### Users (Protected)\n                | Method | Endpoint | Description |\n                |--------|----------|-------------|\n                | GET | `/api/v1/users` | Get all users |\n                | GET | `/api/v1/users/:id` | Get user by ID |\n                | PUT | `/api/v1/users/:id` | Update user |\n                | DELETE | `/api/v1/users/:id` | Delete user |\n\n                ## 🚀 Getting Started\n\n                ### Prerequisites\n                - Go 1.21+\n                - - MySQL 8.0+\n                  - - Docker (optional)\n                   \n                    - ### Run with Docker\n                   \n                    - ```bash\n                      git clone https://github.com/ninjadiego/go-rest-api.git\n                      cd go-rest-api\n                      cp .env.example .env\n                      docker-compose up --build\n                      ```\n\n                      ### Run locally\n\n                      ```bash\n                      git clone https://github.com/ninjadiego/go-rest-api.git\n                      cd go-rest-api\n                      cp .env.example .env\n                      # Edit .env with your database credentials\n                      go mod tidy\n                      go run cmd/main.go\n                      ```\n\n                      ## 🔧 Environment Variables\n\n                      ```env\n                      DB_HOST=localhost\n                      DB_PORT=3306\n                      DB_USER=root\n                      DB_PASSWORD=yourpassword\n                      DB_NAME=go_rest_api\n                      JWT_SECRET=your_jwt_secret_key\n                      PORT=8080\n                      ```\n\n                      ## 📄 License\n\n                      This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.\n\n                      ---\n\n                      Made with ❤️ by [ninjadiego](https://github.com/ninjadiego)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninjadiego%2Fgo-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninjadiego%2Fgo-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninjadiego%2Fgo-rest-api/lists"}