{"id":19393132,"url":"https://github.com/ruanbekker/go-devops-demo","last_synced_at":"2026-04-16T04:02:12.640Z","repository":{"id":251662446,"uuid":"838061656","full_name":"ruanbekker/go-devops-demo","owner":"ruanbekker","description":"Go REST API with Prometheus Metrics","archived":false,"fork":false,"pushed_at":"2024-08-05T22:42:55.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T06:31:17.708Z","etag":null,"topics":["devops","docker","golang","kubernetes","prometheus"],"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/ruanbekker.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":"2024-08-04T20:33:51.000Z","updated_at":"2024-08-05T22:42:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"7528ae4c-17b5-45fb-99c5-0fdc297cf835","html_url":"https://github.com/ruanbekker/go-devops-demo","commit_stats":null,"previous_names":["ruanbekker/go-devops-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fgo-devops-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fgo-devops-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fgo-devops-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruanbekker%2Fgo-devops-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruanbekker","download_url":"https://codeload.github.com/ruanbekker/go-devops-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240564605,"owners_count":19821421,"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":["devops","docker","golang","kubernetes","prometheus"],"created_at":"2024-11-10T10:32:32.757Z","updated_at":"2025-11-02T15:05:22.087Z","avatar_url":"https://github.com/ruanbekker.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-devops-demo\n\nThis project is a Go RESTful API application with a PostgreSQL (or Sqlite) backend and Prometheus Metrics, built with a structured and organized approach. \n\n## Project Structure\n\nThe project is organized into the following directories:\n\n```bash\n.\n├── app\n│   ├── cmd\n│   │   └── server\n│   │       └── main.go\n│   ├── config\n│   │   └── config.go\n│   ├── controllers\n│   │   ├── health_controller.go\n│   │   └── user_controller.go\n│   ├── models\n│   │   ├── user_dto.go\n│   │   └── user.go\n│   ├── repositories\n│   │   └── user_repository.go\n│   ├── routers\n│   │   └── router.go\n│   ├── services\n│   │   └── user_service.go\n│   └── tests\n│       └── user_test.go\n├── docker-compose.yaml\n├── Dockerfile\n├── go.mod\n├── go.sum\n├── LICENSE\n└── README.md\n\n11 directories, 17 files\n```\n\n## Folder Structure\n\n- `app/`: Contains the main application code.\n  - `cmd/`: Contains the entry point of the application.\n    - `server/`: Contains the main entry point of the application.\n      - `main.go`: The main file where the application starts.\n  - `config/`: Contains configuration-related code.\n    - `config.go`: Handles the database connection and configuration settings.\n  - `controllers/`: Contains the HTTP handler functions for the API.\n    - `health_controller.go`: Handles health check requests.\n    - `user_controller.go`: Handles user-related HTTP requests.\n  - `middleware/`: Contains middleware functions that add additional functionality.\n    - `metrics.go`: Implements Prometheus metrics collection.\n  - `models/`: Contains the data models.\n    - `user.go`: Defines the User model.\n    - `user_dto.go`: Defines the User data object (only exposes specific fields).\n  - `repositories/`: Contains the code for data access.\n    - `user_repository.go`: Handles CRUD operations for the User model.\n  - `routers/`: Contains the router setup.\n    - `router.go`: Defines the API routes and connects them to the controllers.\n  - `services/`: Contains the business logic.\n    - `user_service.go`: Implements business logic for user operations.\n  - `tests/`: Contains the test files.\n    - `user_test.go`: Implements tests for user-related operations.\n\n## Endpoints\n\nAPI Endpoints:\n\n- **GET /users**: Retrieves a list of all users.\n- **GET /users/:id**: Retrieves a user by their ID.\n- **POST /users**: Creates a new user.\n- **PUT /users/:id**: Updates an existing user by their ID.\n- **DELETE /users/:id**: Deletes a user by their ID.\n\nMetrics Endpoints:\n\n- **GET /metrics** : Prometheus metrics endpoint\n\nHealthcheck Endpoints:\n\n- **GET /-/health/ready** : Health check on the database\n\n## Resources\n\n- [Gin Web Framework](https://github.com/gin-gonic/gin)\n- [GORM](https://gorm.io/)\n- [PostgreSQL](https://www.postgresql.org/)\n- [SQLite](https://www.sqlite.org/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanbekker%2Fgo-devops-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruanbekker%2Fgo-devops-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruanbekker%2Fgo-devops-demo/lists"}