{"id":24194368,"url":"https://github.com/moamen-abdelkawy/inventorymanagementapi","last_synced_at":"2026-04-28T16:36:54.629Z","repository":{"id":272250760,"uuid":"915957683","full_name":"Moamen-Abdelkawy/InventoryManagementAPI","owner":"Moamen-Abdelkawy","description":"A minimal inventory management system built with Go, Gin, and GORM, featuring CRUD endpoints with UUIDs, rate limiting, and PostgreSQL integration — complete with pagination, filtering, and sorting.","archived":false,"fork":false,"pushed_at":"2025-01-13T07:55:47.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T08:35:34.744Z","etag":null,"topics":["backend","crud","gin","go","gorm","inventory-management","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Moamen-Abdelkawy.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":"2025-01-13T07:20:31.000Z","updated_at":"2025-01-13T08:01:39.000Z","dependencies_parsed_at":"2025-01-13T08:35:37.446Z","dependency_job_id":"4e4cb65e-4e1b-4b31-9c0e-49db08fcc3b7","html_url":"https://github.com/Moamen-Abdelkawy/InventoryManagementAPI","commit_stats":null,"previous_names":["moamen-abdelkawy/inventorymanagementapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moamen-Abdelkawy%2FInventoryManagementAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moamen-Abdelkawy%2FInventoryManagementAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moamen-Abdelkawy%2FInventoryManagementAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Moamen-Abdelkawy%2FInventoryManagementAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Moamen-Abdelkawy","download_url":"https://codeload.github.com/Moamen-Abdelkawy/InventoryManagementAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241622615,"owners_count":19992504,"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":["backend","crud","gin","go","gorm","inventory-management","postgresql","rest-api"],"created_at":"2025-01-13T18:25:25.661Z","updated_at":"2026-04-28T16:36:54.603Z","avatar_url":"https://github.com/Moamen-Abdelkawy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **InventoryManagementAPI**\r\n\r\nA minimal Go application demonstrating an Inventory Management API with:\r\n- Gin web framework\r\n- PostgreSQL via GORM\r\n- Rate limiting\r\n- Basic CRUD operations\r\n- Pagination, filtering, and sorting\r\n\r\n## Repository Structure\r\n\r\n```plaintext\r\nInventoryManagementAPI/\r\n├── cmd/\r\n│   └── server/\r\n│       └── main.go\r\n├── internal/\r\n│   ├── database/\r\n│   │   └── database.go\r\n│   ├── handlers/\r\n│   │   └── items.go\r\n│   ├── middleware/\r\n│   │   └── ratelimit.go\r\n│   ├── models/\r\n│   │   └── item.go\r\n│   └── router/\r\n│       └── routes.go\r\n├── .gitignore\r\n├── go.mod\r\n├── go.sum\r\n└── README.md\r\n```\r\n\r\n## Running Locally\r\n\r\n1. **Install Go 1.18+** and ensure your `$GOPATH` or modules are set up.\r\n\r\n2. Clone this repo:\r\n\r\n   ```bash\r\n   git clone https://github.com/\u003cYourUsername\u003e/InventoryManagementAPI.git\r\n   cd InventoryManagementAPI\r\n   ```\r\n\r\n3. Initialize dependencies:\r\n\r\n   ```bash\r\n   go mod tidy\r\n   ```\r\n\r\n4. Set your DSN (optional; otherwise a default DSN is used in code):\r\n\r\n   ```bash\r\n   export DSN=\"postgres://postgres:postgres@localhost:5432/inventory?sslmode=disable\"\r\n   ```\r\n\r\n5. Run:\r\n\r\n   ```bash\r\n   go run ./cmd/server/main.go\r\n   ```\r\n\r\n   \u003e **Note**: The server will keep running and listen on `http://localhost:8080` until stopped (e.g., via `Ctrl+C`).\r\n\r\n## Creating a GitHub Codespace\r\n\r\n1. Push this code to a GitHub repository named `InventoryManagementAPI`.\r\n\r\n2. On GitHub, click the green \"Code\" button and select \"Create codespace on main.\"\r\n\r\n3. In the Codespace, open a terminal and run:\r\n\r\n   ```bash\r\n   go mod tidy\r\n   go run ./cmd/server/main.go\r\n   ```\r\n\r\n4. Forward port `8080` in your Codespace to access the running server from your browser.\r\n\r\n## Database Options in a Codespace\r\n\r\n1. **Docker-based Postgres**\r\n\r\n   ```bash\r\n   docker run -d --name postgres -p 5432:5432 \\\r\n     -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres postgres:15\r\n   export DSN=\"postgres://postgres:postgres@127.0.0.1:5432/inventory?sslmode=disable\"\r\n   go run ./cmd/server/main.go\r\n   ```\r\n\r\n2. **Hosted Postgres (e.g., ElephantSQL)**\r\n\r\n   - Sign up for a free ElephantSQL instance.\r\n\r\n   - Copy the connection URL (DSN), then:\r\n\r\n     ```bash\r\n     export DSN=\"\u003cYourElephantSQLConnectionString\u003e\"\r\n     go run ./cmd/server/main.go\r\n     ```\r\n\r\n## Troubleshooting\r\n\r\n- If you see `connection refused` errors, confirm that PostgreSQL is running (in Docker or a hosted provider).\r\n- If `go` commands fail, ensure Go is installed and that you’re in the repo root with `go.mod`.\r\n\r\n## Contact\r\n\r\nThis repository is maintained by **Moamen Abdelkawy**. For questions, suggestions, or collaboration inquiries, please reach out via email at [moamen.abdelkawy@outlook.com](mailto:moamen.abdelkawy@outlook.com).\r\n\r\n## License\r\n\r\nThis project is licensed under the [MIT License](https://chatgpt.com/c/LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoamen-abdelkawy%2Finventorymanagementapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoamen-abdelkawy%2Finventorymanagementapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoamen-abdelkawy%2Finventorymanagementapi/lists"}