{"id":26404211,"url":"https://github.com/gabrielnat1/api-golang","last_synced_at":"2025-03-17T16:29:52.785Z","repository":{"id":270764013,"uuid":"911390565","full_name":"GabrielNat1/api-golang","owner":"GabrielNat1","description":"\"A simple API built in Go, designed exclusively for learning and experimentation.\"","archived":false,"fork":false,"pushed_at":"2025-01-23T01:54:52.000Z","size":30,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T02:34:03.736Z","etag":null,"topics":["api-rest","clear-architecture","clear-code","go","golang"],"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/GabrielNat1.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}},"created_at":"2025-01-02T22:51:02.000Z","updated_at":"2025-01-23T01:54:56.000Z","dependencies_parsed_at":"2025-01-02T23:29:20.882Z","dependency_job_id":"12c8fcda-002a-435b-92f2-461cab64195e","html_url":"https://github.com/GabrielNat1/api-golang","commit_stats":null,"previous_names":["gabrielnat1/api-go","gabrielnat1/api-golang"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielNat1%2Fapi-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielNat1%2Fapi-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielNat1%2Fapi-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielNat1%2Fapi-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabrielNat1","download_url":"https://codeload.github.com/GabrielNat1/api-golang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244068613,"owners_count":20392851,"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":["api-rest","clear-architecture","clear-code","go","golang"],"created_at":"2025-03-17T16:29:52.274Z","updated_at":"2025-03-17T16:29:52.764Z","avatar_url":"https://github.com/GabrielNat1.png","language":"Go","readme":"# API-GO: Product Management with JWT Verification\n\nThis project is an API for product management developed in **Go** using the **Gin** framework. The architecture is modular, ensuring better organization and maintainability.\n\n\u003cbr\u003e\n\n---\n\n## 🚀 Project Initialization\n\n\n### Pre-requisites\n\nMake sure you have installed:\n- **Golang**: [Install Golang](https://go.dev/doc/install)\n- **Docker**: [Install Docker](https://www.docker.com/products/docker-desktop)\n\n---\n\n### How to Run\n\n1. Clone the project and navigate to the folder:\n   ```bash\n   git clone https://github.com/usuario/api-go.git\n   cd api-go\n   ```\n\n2. Configure the database connection:\n   Edit the settings in the `db/conn.go` file to reflect your credentials.\n\n3. Start the services with Docker:\n   ```bash\n   docker-compose up\n   ```\n\n4. Access the API at the address:\n   - `http://localhost:8000`\n\n---\n\n## 📚 Project Structure\n\nThe structure is organized as follows:\n\n```plaintext\nAPI-GO/\n├── cmd/\n│   └── main.go               # Main file to start the application\n├── controller/\n│   └── product_controller.go # Controllers responsible for the routes\n├── db/\n│   └── conn.go               # Database configuration and connection\n├── model/\n│   ├── product.go            # Product model\n│   └── response.go           # Response structures for the API\n├── repository/\n│   └── product_repository.go # Layer for interacting with the database\n├── usecase/\n│   └── product_usecase.go    # Business logic and application logic\n├── .gitignore                # Files ignored in version control\n├── docker-compose.yml        # Docker Compose configuration\n├── Dockerfile                # Docker container configuration\n├── go.mod                    # Project dependencies\n├── go.sum                    # Dependency hashes\n└── README.md                 # Project documentation\n```\n\n---\n\n## 📖 Endpoints\n\n### **Ping**\n- **GET `/ping`**\n  - Returns a test message.\n  - **Response**:\n    ```json\n    {\n      \"message\": \"initial tests\"\n    }\n    ```\n\n---\n\n### **Products**\n- **GET `/products`**\n  - Lists all registered products.\n  - **Example Response**:\n    ```json\n    [\n      {\n        \"id\": 1,\n        \"name\": \"Product 1\",\n        \"price\": 100.00\n      },\n      {\n        \"id\": 2,\n        \"name\": \"Product 2\",\n        \"price\": 150.00\n      }\n    ]\n    ```\n\n- **POST `/product`**\n  - Creates a new product.\n  - **Body**:\n    ```json\n    {\n      \"name\": \"Sample Product\",\n      \"price\": 100.00\n    }\n    ```\n  - **Example Response**:\n    ```json\n    {\n      \"id\": 1,\n      \"name\": \"Sample Product\",\n      \"price\": 100.00\n    }\n    ```\n\n- **GET `/product/:productId`**\n  - Returns a specific product based on the ID.\n  - **Example Response**:\n    ```json\n    {\n      \"id\": 1,\n      \"name\": \"Sample Product\",\n      \"price\": 100.00\n    }\n    ```\n\n- **PUT `/product`**\n  - Updates an existing product.\n  - **Body**:\n    ```json\n    {\n      \"id\": 1,\n      \"name\": \"Updated Product\",\n      \"price\": 150.00\n    }\n    ```\n  - **Example Response**:\n    ``` json\n    {\n      \"id\": 1,\n      \"name\": \"Updated Product\",\n      \"price\": 150.00\n    }\n    ```\n\n- **DELETE `/product/:productId`**\n  - Removes a product based on the ID.\n  - **Example Response**:\n    ``` json\n    {\n      \"message\": \"Product successfully removed\"\n    }\n    ```\n\n---\n\n## 🛠️ Technologies Used\n\n- **Golang**: Main programming language.\n- **Gin**: Lightweight and fast framework for API development.\n- **Docker**: For container creation and management.\n- **PostgreSQL** (or another relational database): Configured in the `db` module.\n\n\u003cbr\u003e\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielnat1%2Fapi-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielnat1%2Fapi-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielnat1%2Fapi-golang/lists"}