{"id":15489277,"url":"https://github.com/pintoter/mts-test","last_synced_at":"2026-05-11T03:21:13.077Z","repository":{"id":213763245,"uuid":"734641332","full_name":"pintoter/mts-test","owner":"pintoter","description":"Order\u0026store -  Microservices written in Go including gRPC server, Kafka messaging, PostgreSQL database","archived":false,"fork":false,"pushed_at":"2023-12-25T09:39:25.000Z","size":7025,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T16:34:59.853Z","etag":null,"topics":["go","grpc","kafka","postgresql"],"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/pintoter.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":"2023-12-22T08:04:24.000Z","updated_at":"2023-12-31T11:35:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2e0b1f2-bbd4-46be-987f-cdd68367346d","html_url":"https://github.com/pintoter/mts-test","commit_stats":null,"previous_names":["pintoter/mts-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintoter%2Fmts-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintoter%2Fmts-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintoter%2Fmts-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintoter%2Fmts-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pintoter","download_url":"https://codeload.github.com/pintoter/mts-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246059336,"owners_count":20717085,"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","grpc","kafka","postgresql"],"created_at":"2024-10-02T07:04:46.176Z","updated_at":"2026-05-11T03:21:08.015Z","avatar_url":"https://github.com/pintoter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# order-store\n\n## Examples\n\n[![Golang](https://img.shields.io/badge/Go-v1.21-EEEEEE?logo=go\u0026logoColor=white\u0026labelColor=00ADD8)](https://go.dev/)\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003eOrder \u0026 Store\u003c/h1\u003e\n    \u003ch5\u003e\n        Microservices written in Go as test task\n    \u003c/h5\u003e\n\u003c/div\u003e\n\n## Navigation\n* **[Task](#task)**\n* **[Installation](#installation)**\n* **[Getting started](#getting)**\n\n---\n\n## Task\n\n1. Implement 2 services: `order-service` \u0026 `store-service`\n2. The first service `order-service` should receive a request via **[gRPC](https://grpc.io)** and send data to **[Kafka](https://kafka.apache.org)**\n\n```proto\nmessage CreateOrderRequest{\n int64 user_id = 1;\n int64 item_id = 2;\n}\n\nmessage CreateOrderResponse{\n  string message = 1;\n}\n```\n\n3. The second service `store-service` should reviece a message from **[Kafka](https://kafka.apache.org)** and write it to **[PostgreSQL](https://www.postgresql.org)**\n\n```sql\nCREATE TABLE IF NOT EXISTS store (\n  id SERIAL PRIMARY KEY,\n  user_id BIGINT NOT NULL,\n  item_id BIGINT NOT NULL,\n  created_at DATE DEFAULT CURRENT_DATE\n);\n```\n\n---\n\n## Installation\n```shell\ngit clone https://github.com/pintoter/mts-test.git\n```\n\n---\n\n## Getting started\n\n1. **Create .env file with filename \".env\" in the project root and setting up environment your own variables:**\n```dotenv\n  DB_USER = postgres\n  DB_PASSWORD = 123qweASD\n  DB_PORT = 5432\n  DB_NAME = store\n```\n\n2. **Create .env file with filename \".env\" in the `store-service` root and setting up environment your own variables:**\n```dotenv\n  # Database\n  DB_USER = username\n  DB_PASSWORD = password\n  DB_HOST = \"localhost\" \n  DB_PORT = 5432\n  DB_NAME = \"store\"\n  DB_SSLMODE = \"disable\"\n```\n\u003e **Hint:**\nif you are running the project using Docker, set `DB_HOST` to \"**store-service-postgres**\" (as the service name of Postgres in the docker-compose).\n\n3. **Compile and run the project:**\nFor starting:\n```shell\nmake version=prod\n```\n\n4. **To test functionality, you can open `Postman` and create request to order-service: `0.0.0.0:8001`\n  Access to Kafka-UI: http://localhost:8080/ .**\n\n* Example request in Postman:\n```json\n{\n    \"item_id\": \"1\",\n    \"user_id\": \"10\"\n}\n```\n\n* Example response in Postman:\n```json\n{\n    \"message\": \"Your order has been successfully created!\"\n}\n```\n\n* Example record in PostgreSQL:\n```sql\n| id | user_id | item_id | created_at |\n| -- | ------- | ------- | ---------- |\n| 1  | 10      | 1       | 2023-12-24 |\n```\n\n**For run UNIT-tests:**\n```shell\nmake test\n```\n\u003e **Hint:**\nCover only repository with `sqlmock` and service layer with `gomock`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpintoter%2Fmts-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpintoter%2Fmts-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpintoter%2Fmts-test/lists"}