{"id":31161343,"url":"https://github.com/lokie-codes/go-ecommerce-api","last_synced_at":"2025-09-19T03:37:30.986Z","repository":{"id":304995252,"uuid":"1021567808","full_name":"Lokie-codes/go-ecommerce-api","owner":"Lokie-codes","description":"A scalable and production-ready RESTful API for modern e-commerce applications, powered by Go.","archived":false,"fork":false,"pushed_at":"2025-07-17T15:50:43.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T18:04:32.041Z","etag":null,"topics":["backend","go"],"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/Lokie-codes.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,"zenodo":null}},"created_at":"2025-07-17T15:40:13.000Z","updated_at":"2025-07-17T15:52:18.000Z","dependencies_parsed_at":"2025-07-17T21:15:02.311Z","dependency_job_id":"a8b2ec86-301f-45fa-92c9-7fce55ba0b49","html_url":"https://github.com/Lokie-codes/go-ecommerce-api","commit_stats":null,"previous_names":["lokie-codes/go-ecommerce-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Lokie-codes/go-ecommerce-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lokie-codes%2Fgo-ecommerce-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lokie-codes%2Fgo-ecommerce-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lokie-codes%2Fgo-ecommerce-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lokie-codes%2Fgo-ecommerce-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lokie-codes","download_url":"https://codeload.github.com/Lokie-codes/go-ecommerce-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lokie-codes%2Fgo-ecommerce-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275875255,"owners_count":25544188,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"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":["backend","go"],"created_at":"2025-09-19T03:37:26.379Z","updated_at":"2025-09-19T03:37:30.936Z","avatar_url":"https://github.com/Lokie-codes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go E-Commerce API\n\nA robust and scalable backend API for a modern e-commerce platform, built entirely in Go. This project provides the core functionalities for managing users, products, shopping carts, and orders.\n\n## ✨ Features\n\n  - **User Authentication**: Secure user registration and login using JWT (JSON Web Tokens).\n  - **Product Management**: Full CRUD (Create, Read, Update, Delete) operations for products.\n  - **Shopping Cart**: Add, view, update, and remove items from the user's cart.\n  - **Order Processing**: Create orders from the shopping cart and view order history.\n  - **RESTful Architecture**: Clean, predictable, and resource-oriented API endpoints.\n  - **Scalable Design**: Built with a modular structure for easy extension and maintenance.\n\n## 🛠️ Tech Stack\n\n  - **Language**: [Go](https://golang.org/) (Golang)\n  - **Web Framework**: [Gin](https://gin-gonic.com/)\n  - **Database**: [PostgreSQL](https://www.postgresql.org/)\n  - **ORM**: [GORM](https://gorm.io/)\n  - **Authentication**: [golang-jwt/jwt](https://github.com/golang-jwt/jwt)\n  - **Environment Variables**: [go-dotenv](https://github.com/joho/godotenv)\n  - **Containerization**: [Docker](https://www.docker.com/) \u0026 Docker Compose\n\n## 🚀 Getting Started\n\nFollow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.\n\n### Prerequisites\n\nYou need to have the following software installed on your machine:\n\n  - [Go](https://golang.org/doc/install) (version 1.21 or later)\n  - [Docker](https://docs.docker.com/get-docker/)\n  - [Docker Compose](https://docs.docker.com/compose/install/)\n\n### Installation\n\n1.  **Clone the repository:**\n\n    ```sh\n    git clone https://github.com/your-username/go-ecommerce-api.git\n    cd go-ecommerce-api\n    ```\n\n2.  **Create an environment file:**\n    Copy the example environment file and update it with your configuration.\n\n    ```sh\n    cp .env.example .env\n    ```\n\n3.  **Run the application with Docker Compose:**\n    This is the recommended way to run the project locally. It will start the Go API server and a PostgreSQL database container.\n\n    ```sh\n    docker-compose up --build\n    ```\n\nThe API server will be running on `http://localhost:8080`.\n\n## ⚙️ Environment Variables\n\nTo run this project, you will need to add the following environment variables to your `.env` file:\n\n```ini\n# Server Configuration\nAPI_PORT=8080\n\n# Database Configuration\nDB_HOST=db\nDB_USER=yourusername\nDB_PASSWORD=yourstrongpassword\nDB_NAME=ecommerce_db\nDB_PORT=5432\n\n# JWT Configuration\nJWT_SECRET_KEY=your-super-secret-key\n```\n\n## Endpoints API\n\nHere are the main API endpoints available.\n\n| Method | Endpoint                    | Description                       | Protected |\n|--------|-----------------------------|-----------------------------------|-----------|\n| `POST` | `/api/v1/register`          | Register a new user               | No        |\n| `POST` | `/api/v1/login`             | Log in a user and get a JWT token | No        |\n|        |                             |                                   |           |\n| `GET`  | `/api/v1/products`          | Get a list of all products        | No        |\n| `GET`  | `/api/v1/products/{id}`     | Get a single product by ID        | No        |\n| `POST` | `/api/v1/products`          | Create a new product              | Yes (Admin) |\n| `PUT`  | `/api/v1/products/{id}`     | Update a product                  | Yes (Admin) |\n| `DELETE`| `/api/v1/products/{id}`     | Delete a product                  | Yes (Admin) |\n|        |                             |                                   |           |\n| `GET`  | `/api/v1/cart`              | Get the user's shopping cart      | Yes       |\n| `POST` | `/api/v1/cart/add`          | Add an item to the cart           | Yes       |\n| `DELETE`| `/api/v1/cart/remove/{itemId}` | Remove an item from the cart   | Yes       |\n|        |                             |                                   |           |\n| `POST` | `/api/v1/orders`            | Create an order from the cart     | Yes       |\n| `GET`  | `/api/v1/orders`            | Get the user's order history      | Yes       |\n| `GET`  | `/api/v1/orders/{id}`       | Get details of a specific order   | Yes       |\n\n## 🧪 Running Tests\n\nTo run the test suite for the application, use the following command:\n\n```sh\ngo test ./... -v\n```\n\n## 🤝 Contributing\n\nContributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1.  Fork the Project\n2.  Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3.  Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4.  Push to the Branch (`git push origin feature/AmazingFeature`)\n5.  Open a Pull Request\n\n## 📜 License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flokie-codes%2Fgo-ecommerce-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flokie-codes%2Fgo-ecommerce-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flokie-codes%2Fgo-ecommerce-api/lists"}