{"id":22249439,"url":"https://github.com/zeroidentidad/ecom-api","last_synced_at":"2025-06-25T05:37:43.772Z","repository":{"id":222042190,"uuid":"755533394","full_name":"zeroidentidad/ecom-api","owner":"zeroidentidad","description":"Technical test","archived":false,"fork":false,"pushed_at":"2024-02-11T22:17:25.000Z","size":2998,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T11:11:10.476Z","etag":null,"topics":["go","rest-api","swagger"],"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/zeroidentidad.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}},"created_at":"2024-02-10T14:02:02.000Z","updated_at":"2024-02-11T22:21:08.000Z","dependencies_parsed_at":"2024-02-12T00:28:14.614Z","dependency_job_id":"26c78c14-226a-4a1d-842b-75cf5b25ce68","html_url":"https://github.com/zeroidentidad/ecom-api","commit_stats":null,"previous_names":["zeroidentidad/ecom-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroidentidad%2Fecom-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroidentidad%2Fecom-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroidentidad%2Fecom-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroidentidad%2Fecom-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroidentidad","download_url":"https://codeload.github.com/zeroidentidad/ecom-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458703,"owners_count":20618697,"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":["go","rest-api","swagger"],"created_at":"2024-12-03T06:26:42.739Z","updated_at":"2025-03-25T12:14:42.547Z","avatar_url":"https://github.com/zeroidentidad.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Technical Test: Backend Golang\n\n## Introduction \n\nThis repo contains the codebase for an ecommerce Rest API that supply the requirements defined for the technical test.\n\n**Source structure:**\n\n```\ncmd/\n├─ server/\n│  ├─ main.go\ninternal/\n├─ db/\n│  ├─ database.go\n│  ├─ db_carts.go\n│  ├─ db_products.go\n│  ├─ migrate.go\n├─ ecommerce/\n│  ├─ cart.go\n│  ├─ product.go\n│  ├─ service_errors.go\n│  ├─ service_store.go\n├─ transport/\n│  ├─ http/\n│  │  ├─ handlers_cart.go\n│  │  ├─ handlers_product.go\n│  │  ├─ http_service.go\n│  │  ├─ main.go\n│  │  ├─ middleware.go\nmigrations/\n├─ 000001_create_products_table.down.sql\n├─ 000001_create_products_table.up.sql\n├─ 000002_create_carts_table.down.sql\n├─ 000002_create_carts_table.up.sql\npostman/\n├─ tests-ecom-api.postman.json\nvendor/\n├─ modules.txt\n├─ ...*\n.air.conf\nair.sh\ngo.mod\ngo.sum\nREADME.md\nserve.sh\n```\n\n**Software tools usage:**\n\n- Go version **1.22** ```go.mod```\n- PostgreSQL **12** free remote instance\n- Swagger CLI and http-swagger **v2**\n- Air live reload ```.air.conf``` ```air.sh```\n\nAll software was used under a Linux OS distro\n\n## Usage \n\nNo get dependencies necessary with ```vendor``` included if using same version for local execution. In case of different go sdk version make downgrade to appropriate go module version and recreate vendoring deps with ```go mod tidy \u0026\u0026 go mod vendor```.\n\n### How to execute\n\nAt root directory:\n\n- **Option 1:** Without build, run ```go run ./cmd/server``` or simply use **.sh** script ```./serve.sh```\n\n- **Option 2:** With build, run ```go build -o ./serveapi ./cmd/server```, then run ```./serveapi```\n\n- **Option 3:** With live reload is necessary install [Air](https://github.com/cosmtrek/air) cli, and run ```./air.sh```\n\nExample:\n\n![img1](.imgs/img1.png)\n\nHaving used any of the 3 options on how to run the service binary. The base access URL will be at: http://localhost:8081\n\n## Endpoints documentation\n\n### Swagger\n\nWith the service binary running, the documentation auto-generated by the Swagger cli will be available at the url: http://localhost:8081/swagger/\n\n![img2](.imgs/img2.png)\n\n### Postman\n\nAn exported postman collection is available in the ```postman/``` directory to test endpoints in this way.\n\n![img3](.imgs/img3.png)\n\n## Tutorial\n\nExplanation and demonstration video: https://youtu.be/nvHW8-JyAzY\n\nNot listed on Youtube only by link available in this repo.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroidentidad%2Fecom-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroidentidad%2Fecom-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroidentidad%2Fecom-api/lists"}