{"id":25371027,"url":"https://github.com/kemalkochekov/coolshop","last_synced_at":"2026-04-28T12:03:31.452Z","repository":{"id":277208782,"uuid":"931683614","full_name":"kemalkochekov/CoolShop","owner":"kemalkochekov","description":"Coolshop API is a **RESTful API** built with **Golang, Gin, PostgreSQL, Redis, and JWT authentication**. ","archived":false,"fork":false,"pushed_at":"2025-02-12T18:02:22.000Z","size":6815,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-17T00:59:48.431Z","etag":null,"topics":["air-live","clean-architecture","docker-compose","dockerfile","gin-gonic","golang","linters","postgresql","swagger","zaplogger"],"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/kemalkochekov.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-02-12T17:26:32.000Z","updated_at":"2025-02-12T19:17:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff15a852-3348-4f21-a016-11bbfa678ced","html_url":"https://github.com/kemalkochekov/CoolShop","commit_stats":null,"previous_names":["kemalkochekov/coolshop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kemalkochekov/CoolShop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalkochekov%2FCoolShop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalkochekov%2FCoolShop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalkochekov%2FCoolShop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalkochekov%2FCoolShop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kemalkochekov","download_url":"https://codeload.github.com/kemalkochekov/CoolShop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemalkochekov%2FCoolShop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32379629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["air-live","clean-architecture","docker-compose","dockerfile","gin-gonic","golang","linters","postgresql","swagger","zaplogger"],"created_at":"2025-02-15T02:21:07.630Z","updated_at":"2026-04-28T12:03:31.447Z","avatar_url":"https://github.com/kemalkochekov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛍️ Coolshop API\n\n[![Go](https://img.shields.io/badge/Go-1.21-blue.svg)](https://golang.org/)\n[![Gin](https://img.shields.io/badge/Gin-Framework-green)](https://github.com/gin-gonic/gin)\n[![PostgreSQL](https://img.shields.io/badge/Database-PostgreSQL-blue)](https://www.postgresql.org/)\n[![Swagger](https://img.shields.io/badge/API-Docs-yellow)](#📁-api-documentation)\n\nCoolshop API is a **RESTful API** built with **Golang, Gin, PostgreSQL, Redis, and JWT authentication**.  \nIt provides **user authentication, session management, and user data operations** for an e-commerce system.\n\n---\n\n## 🚀 Features\n✅ **User Authentication** - Sign up, login, logout, password update  \n✅ **JWT-based Authorization** - Secure API using **access \u0026 refresh tokens**  \n✅ **Role-based Access Control** - Protected API endpoints  \n✅ **Swagger API Documentation** - Interactive API docs  \n✅ **Structured Logging** - Powered by **Uber's `zap`**  \n✅ **Error Handling Middleware** - Centralized error handling  \n✅ **Dockerized Setup** - Easy deployment\n\n---\n\n\n## 🛠️ Installation Guide\n\n### **1️⃣ Install Go**\n\nIf you don't have Go installed, download and install it:\n\n- Go: [Install Go](https://go.dev/doc/install/)\n\nVerify installation:\n\n```sh\n  go version\n```\n\n### **2️⃣ Install Swag for Swagger Documentation**\n\nInstall `swag` globally:\n\n```sh\n  go install github.com/swaggo/swag/cmd/swag@latest\n```\n\nVerify installation:\n\n```sh\n  swag --version\n```\n### **3️⃣ Installation of Docker**\n- Docker: [Install Docker](https://docs.docker.com/get-docker/)\n- Docker Compose: [Install Docker Compose](https://docs.docker.com/compose/install/)\n\n\n## 📁 API Documentation\nCoolshop API provides **interactive API documentation** via **Swagger**.\n\n📌 **Access Swagger Docs** after running the server:  \n📞 **http://localhost:8080/swagger/index.html**\n\nTo regenerate Swagger docs:\n```sh\n  swag init -g cmd/main.go\n```\n\n---\n\n## 🛠️ Installation Guide\n\n### **1️⃣ Clone the Repository**\n```sh\n    git clone https://github.com/kemalkochekov/CoolShop.git\n    cd CoolShop\n```\n\n### **2️⃣ Install Dependencies**\n```sh\n  go mod tidy\n```\n\n### 3️⃣ Run Docker\n```sh\n  docker-compose up\n```\n\n---\n\n## 📂 Project Structure\n\n```\n📦 Coolshop\n ┣ 📂 cmd                     # Main entry point\n ┃ ┗ 📜 main.go               # Starts the API server\n ┣ 📂 internal                \n ┃ ┣ 📂 app                   # App initialization \u0026 routes\n ┃ ┣ 📂 auth                  # JWT authentication \u0026 middleware\n ┃ ┣ 📂 cache                 # Redis caching\n ┃ ┣ 📂 config                # App configuration\n ┃ ┣ 📂 connection            # Database \u0026 Redis connections\n ┃ ┣ 📂 migrations            # Database migrations\n ┃ ┣ 📂 model                 # Data models\n ┃ ┣ 📂 user                  # User business logic (handlers, repository, usecase)\n ┣ 📂 logger                  # Logging with Uber Zap\n ┣ 📂 middleware              # Custom middlewares (logging, error handling)\n ┣ 📂 pkg                     # Utility packages (errors, constants, request validation)\n ┣ 📂 docs                    # Swagger API documentation\n ┣ 📂 tmp                     # Temporary files\n ┣ 📜 docker-compose.yml      # Docker configuration\n ┣ 📜 Makefile                # Task automation\n ┣ 📜 go.mod                  # Go module dependencies\n ┗ 📜 README.md               # Project documentation\n\n\n---\n\n## 🏠 Tech Stack\n- **Language:** [Golang](https://go.dev/)\n- **Framework:** [Gin](https://github.com/gin-gonic/gin)\n- **Database:** [PostgreSQL](https://www.postgresql.org/)\n- **Caching:** [Redis](https://redis.io/)\n- **Authentication:** JWT (JSON Web Token)\n- **Logging:** [Uber Zap](https://github.com/uber-go/zap)\n- **API Docs:** [Swagger](https://swagger.io/)\n\n---\n\n## 🔒 Authentication \u0026 Authorization\n### **🔑 Access Token (JWT)**\n- Used for **authenticated requests**\n- Sent in the `Authorization` header:\n  ```http\n  Authorization: YOUR_ACCESS_TOKEN\n  ```\n\n### **🔄 Refresh Token**\n- Stored in **cookies**\n- Used to **refresh the access token** when it expires.\n\n---\n\n## 🏰 Docker Setup\nRun the project using **Docker**:\n```sh\n  docker-compose up --build\n```\nStops and removes all containers:\n```sh\n  docker-compose down\n```\n\n---\n\n## 🌐 API Endpoints\n\n### **🛠️ Authentication**\n| Method | Endpoint         | Description              | Auth Required |\n|--------|-----------------|--------------------------|--------------|\n| `POST` | `/auth/sign_up`  | User registration       | ❌ No |\n| `POST` | `/auth/login`    | User login (returns JWT) | ❌ No |\n| `POST` | `/auth/refresh`  | Refresh access token    | ✅ Yes |\n\n### **👤 User Management**\n| Method   | Endpoint             | Description           | Auth Required |\n|----------|----------------------|----------------------|--------------|\n| `GET`    | `/user/{id}`          | Get user by ID      | ✅ Yes |\n| `PUT`    | `/user/update_password` | Update password | ✅ Yes |\n| `DELETE` | `/user/`              | Delete user account | ✅ Yes |\n| `POST`   | `/user/logout`        | Logout user         | ✅ Yes |\n\n### **🚀 System Health**\n| Method | Endpoint    | Description          |\n|--------|------------|----------------------|\n| `GET`  | `/health`  | API health check    |\n\n---\n\n## 👨‍💻 Contributing\n🚀 We welcome contributions!  \nTo contribute:\n1. **Fork the repository**.\n2. **Create a new branch**:\n   ```sh\n   git checkout -b feature-new\n   ```\n3. **Make your changes \u0026 commit**:\n   ```sh\n   git commit -m \"Add new feature\"\n   ```\n4. **Push the branch**:\n   ```sh\n   git push origin feature-new\n   ```\n5. **Submit a Pull Request** 🚀\n\n---\n\n\n## ⭐ Support\nIf you find this project useful, **give it a star ⭐ on GitHub!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemalkochekov%2Fcoolshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkemalkochekov%2Fcoolshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemalkochekov%2Fcoolshop/lists"}