{"id":48386637,"url":"https://github.com/codisim/ecommerce","last_synced_at":"2026-06-30T23:32:26.201Z","repository":{"id":315685270,"uuid":"1059064885","full_name":"codisim/ecommerce","owner":"codisim","description":"A fully functional e-commerce backend built with Golang, PostgreSQL, and JWT authentication.","archived":false,"fork":false,"pushed_at":"2026-04-14T08:44:37.000Z","size":141,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T10:26:50.279Z","etag":null,"topics":["golang","jwt-authentication","postgresql"],"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/codisim.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":"2025-09-18T00:25:07.000Z","updated_at":"2026-04-14T08:44:41.000Z","dependencies_parsed_at":"2025-09-20T04:20:32.370Z","dependency_job_id":"c0f244a7-2d1f-4efb-86a1-43f36b11363e","html_url":"https://github.com/codisim/ecommerce","commit_stats":null,"previous_names":["gowaliullah/ecommerce","tswaliullah/ecommerce"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codisim/ecommerce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codisim%2Fecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codisim%2Fecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codisim%2Fecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codisim%2Fecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codisim","download_url":"https://codeload.github.com/codisim/ecommerce/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codisim%2Fecommerce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34987610,"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-30T02:00:05.919Z","response_time":92,"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":["golang","jwt-authentication","postgresql"],"created_at":"2026-04-05T22:15:42.187Z","updated_at":"2026-06-30T23:32:26.193Z","avatar_url":"https://github.com/codisim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛍️ GoCommerce — E-commerce Backend API (Go + PostgreSQL)\n\nA fully functional **e-commerce backend** built with **Golang**, **PostgreSQL**, and **JWT authentication**.  \nThis project is designed to power a modern e-commerce platform with features like product management, user authentication, and order handling.\n\n---\n\n## 🚀 Tech Stack\n\n- **Language:** Go (Golang)\n- **Database:** PostgreSQL\n- **Query:** `database/sql` + `pgx` driver \n- **Authentication:** JWT (JSON Web Token)\n- **Password Hashing:** bcrypt\n- **API Format:** RESTful JSON\n- **Architecture:** Domain-driven design\n- **Environment Management:** `.env` file\n- **Dependency Management:** Go Modules\n\n---\n\n## 🗂️ Project Structure\n\n\n---\n\n## 🔗 API Endpoints\n\n### 👤 **Auth Routes**\n| Method | Endpoint | Description |\n|--------|-----------|-------------|\n| `POST` | `/api/auth/register` | Register a new user |\n| `POST` | `/api/auth/login` | Login user and receive JWT token |\n\n---\n\n### 🛒 **Product Routes**\n| Method | Endpoint | Description | Access |\n|--------|-----------|-------------|--------|\n| `GET` | `/api/products` | Get all products | Public |\n| `GET` | `/api/products/:id` | Get product by ID | Public |\n| `POST` | `/api/products` | Create product | Admin |\n| `PUT` | `/api/products/:id` | Update product | Admin |\n| `DELETE` | `/api/products/:id` | Delete product | Admin |\n\n---\n\n### 📦 **Order Routes**\n| Method | Endpoint | Description | Access |\n|--------|-----------|-------------|--------|\n| `GET` | `/api/orders` | Get all orders (Admin) | Admin |\n| `POST` | `/api/orders` | Create a new order | Authenticated User |\n| `GET` | `/api/orders/:id` | Get order details | Authenticated User |\n| `PUT` | `/api/orders/:id` | Update order status | Admin |\n\n---\n\n### 🧑‍💼 **Admin Routes**\n| Method | Endpoint | Description | Access |\n|--------|-----------|-------------|--------|\n| `GET` | `/api/admin/dashboard` | Get summary stats (users, sales, orders) | Admin |\n| `GET` | `/api/admin/users` | Get all registered users | Admin |\n| `PUT` | `/api/admin/users/:id/role` | Update user role | Admin |\n\n---\n\n## ⚙️ Environment Variables\n\nCreate a `.env` file in your root directory:\n\n```bash\n# PostgreSQL\nDB_HOST=localhost\nDB_PORT=5432\nDB_USER=postgres\nDB_PASSWORD=yourpassword\nDB_NAME=gocommerce\n\n# JWT\nJWT_SECRET=your_jwt_secret_key\nJWT_EXPIRE_HOURS=24\n\n# Server\nPORT=8080\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodisim%2Fecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodisim%2Fecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodisim%2Fecommerce/lists"}