{"id":50530706,"url":"https://github.com/eariasvalor/products-api-go","last_synced_at":"2026-06-03T13:02:11.108Z","repository":{"id":359195635,"uuid":"1244863495","full_name":"eariasvalor/products-api-go","owner":"eariasvalor","description":"REST API for product management built with Go and hexagonal architecture","archived":false,"fork":false,"pushed_at":"2026-05-20T20:40:00.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-21T01:18:45.271Z","etag":null,"topics":["clean-architecture","crud","gin","go","golang","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/eariasvalor.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-20T17:12:30.000Z","updated_at":"2026-05-20T20:39:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eariasvalor/products-api-go","commit_stats":null,"previous_names":["eariasvalor/products-api-go"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/eariasvalor/products-api-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eariasvalor%2Fproducts-api-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eariasvalor%2Fproducts-api-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eariasvalor%2Fproducts-api-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eariasvalor%2Fproducts-api-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eariasvalor","download_url":"https://codeload.github.com/eariasvalor/products-api-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eariasvalor%2Fproducts-api-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33865655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clean-architecture","crud","gin","go","golang","postgresql","rest-api"],"created_at":"2026-06-03T13:02:10.108Z","updated_at":"2026-06-03T13:02:11.101Z","avatar_url":"https://github.com/eariasvalor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# products-api-go\n\nREST API for product management built with Go and hexagonal architecture.\n\n## Tech Stack\n\n- **Go** — main language\n- **Gin** — HTTP framework\n- **PostgreSQL** — database\n- **pgx** — PostgreSQL driver\n\n## Architecture\n\nThis project follows **hexagonal architecture** (Ports \u0026 Adapters), keeping the business logic decoupled from external dependencies.\n\n```\ninternal/\n├── domain/         # Core entities and business rules\n├── ports/\n│   ├── input/      # Interfaces exposed to the outside (use cases)\n│   └── output/     # Interfaces for external dependencies (DB, etc.)\n├── application/    # Use case implementations\n└── adapters/\n    ├── http/       # HTTP handlers and router (Gin)\n    └── postgres/   # PostgreSQL repository implementation\n```\n\n## Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/products` | List all products |\n| GET | `/products/:id` | Get a product by ID |\n| POST | `/products` | Create a product |\n| PUT | `/products/:id` | Update a product |\n| DELETE | `/products/:id` | Delete a product |\n\n## Getting Started\n\n### Prerequisites\n\n- Go 1.21+\n- PostgreSQL 18+\n\n### Database setup\n\n```sql\nCREATE DATABASE productos_db;\n\n\\c productos_db\n\nCREATE TABLE products (\n    id          SERIAL PRIMARY KEY,\n    name        VARCHAR(100) NOT NULL,\n    description TEXT,\n    price       NUMERIC(10,2) NOT NULL,\n    stock       INTEGER NOT NULL DEFAULT 0\n);\n```\n\n### Environment variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `DB_HOST` | `localhost` | Database host |\n| `DB_PORT` | `5432` | Database port |\n| `DB_USER` | `postgres` | Database user |\n| `DB_PASSWORD` | `` | Database password |\n| `DB_NAME` | `productos_db` | Database name |\n| `SERVER_PORT` | `8080` | HTTP server port |\n\n### Run\n\n```bash\ngo run main.go\n```\n\nThe server will start on `http://localhost:8080`.\n\n## Example Request\n\n```bash\ncurl -X POST http://localhost:8080/products \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Chair\",\"description\":\"Office chair\",\"price\":99.99,\"stock\":10}'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feariasvalor%2Fproducts-api-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feariasvalor%2Fproducts-api-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feariasvalor%2Fproducts-api-go/lists"}