{"id":15074393,"url":"https://github.com/pansani/order-list-api-go-graphql-grpc","last_synced_at":"2026-02-07T18:03:49.053Z","repository":{"id":250961026,"uuid":"835949306","full_name":"pansani/order-list-api-go-graphql-grpc","owner":"pansani","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-07T17:00:15.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T19:02:07.090Z","etag":null,"topics":["docker","golang","graphql","grpc"],"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/pansani.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":"2024-07-30T21:12:05.000Z","updated_at":"2024-08-07T17:00:18.000Z","dependencies_parsed_at":"2024-08-07T00:19:44.478Z","dependency_job_id":"cead4caf-ab16-4019-a17b-ed9d43df47bf","html_url":"https://github.com/pansani/order-list-api-go-graphql-grpc","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.2142857142857143,"last_synced_commit":"17a6ed97a09b2acc2c15159d235a03aeafcffa23"},"previous_names":["pansani/order-list-api-go-graphql-grpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pansani/order-list-api-go-graphql-grpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansani%2Forder-list-api-go-graphql-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansani%2Forder-list-api-go-graphql-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansani%2Forder-list-api-go-graphql-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansani%2Forder-list-api-go-graphql-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pansani","download_url":"https://codeload.github.com/pansani/order-list-api-go-graphql-grpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pansani%2Forder-list-api-go-graphql-grpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29203025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T17:44:10.191Z","status":"ssl_error","status_checked_at":"2026-02-07T17:44:07.936Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["docker","golang","graphql","grpc"],"created_at":"2024-09-25T03:32:46.904Z","updated_at":"2026-02-07T18:03:49.033Z","avatar_url":"https://github.com/pansani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Order Listing Service\n\nThis project is an implementation of a simple order listing service using gRPC, GraphQL, and REST API. It demonstrates how to create a multi-service application with a shared PostgreSQL database using Docker Compose.\n\n## Table of Contents\n\n1. [Prerequisites](#prerequisites)\n2. [Create .env file](#create-env-file)\n3. [Run the Application](#run-the-application)\n4. [Run Migrations](#run-migrations)\n5. [Insert Sample Data](#insert-sample-data)\n6. [Testing the Services](#testing-the-services)\n   - [REST API](#rest-api)\n   - [GraphQL](#graphql)\n   - [gRPC](#grpc)\n7. [Clean Up](#clean-up)\n\n## 1. Prerequisites\n\n- [Docker](https://www.docker.com/get-started)\n- [Docker Compose](https://docs.docker.com/compose/install/)\n- [Go](https://golang.org/doc/install)\n- [grpcurl](https://github.com/fullstorydev/grpcurl#installation) (for testing gRPC services)\n\n## 2. Create .env file\n\nCreate a `.env` file in the root directory of the project with the following content:\n\n```ini\nDB_USER=user\nDB_PASSWORD=password\nDB_NAME=orders_db\nDB_HOST=db\nDB_PORT=5432\n```\n\n## 3. Run the Application\n\nFirst, make sure Docker is running, then execute the following commands:\n\n```bash\ndocker-compose build\ndocker-compose up -d\n```\n\nThis will build the application and start all the services defined in the `docker-compose.yml` file.\n\n## 4. Run Migrations\n\nMigrations will be automatically run by the migrate service defined in docker-compose.yml.\n\n## 5. Testing the Services\n\n### REST API\n\nYou can test the REST API using `curl` or any API testing tool like Postman. The REST API will be available at `http://localhost:8080`.\n\n```bash \ncurl -X POST -H \"Content-Type: application/json\" -d '{\"user_id\": 1, \"product_id\": 101, \"quantity\": 2, \"status\": \"pending\"}' http://localhost:8080/order\n```\n\n```bash\ncurl http://localhost:8080/order\n```\n\n### GraphQL\n\nYou can test the GraphQL API using the GraphQL Playground available at `http://localhost:8081/playground`.\n\nCreate Order:\n\n```bash\nmutation {\n  createOrder(user_id: 1, product_id: 101, quantity: 3, status: \"pending\") {\n    id\n    user_id\n    product_id\n    quantity\n    status\n    created_at\n    updated_at\n  }\n}\n```\n\nList Orders:\n\n```bash\nquery {\n  listOrders {\n    id\n    user_id\n    product_id\n    quantity\n    status\n    created_at\n    updated_at\n  }\n}\n```\n\n### gRPC\n\nYou can test the gRPC service using `grpcurl`. The gRPC service will be available at `localhost:50051`.\n\n```bash\ngrpcurl -plaintext localhost:50051 list\n```\n\n#### Create Order\n\n```bash\ngrpcurl -plaintext -d '{\n  \"user_id\": 1,\n  \"product_id\": 101,\n  \"quantity\": 3,\n  \"status\": \"pending\"\n}' localhost:50051 order.OrderService/CreateOrder\n```\n\n#### List Orders\n\n```bash\ngrpcurl -plaintext -d '{}' localhost:50051 order.OrderService/ListOrders\n```\n\n## 6. Clean Up\n\nTo stop and remove all the containers, network, and volumes, run the following command:\n\n```bash\ndocker-compose down -v\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpansani%2Forder-list-api-go-graphql-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpansani%2Forder-list-api-go-graphql-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpansani%2Forder-list-api-go-graphql-grpc/lists"}