{"id":26926567,"url":"https://github.com/danieldev219/test-for-mynth","last_synced_at":"2025-04-02T03:33:26.632Z","repository":{"id":283497522,"uuid":"951963073","full_name":"danieldev219/Test-for-Mynth","owner":"danieldev219","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-20T14:42:38.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T15:31:37.290Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/danieldev219.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-03-20T14:14:41.000Z","updated_at":"2025-03-20T14:42:41.000Z","dependencies_parsed_at":"2025-03-21T15:02:40.046Z","dependency_job_id":null,"html_url":"https://github.com/danieldev219/Test-for-Mynth","commit_stats":null,"previous_names":["danieldev219/test-for-mynth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2FTest-for-Mynth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2FTest-for-Mynth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2FTest-for-Mynth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieldev219%2FTest-for-Mynth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danieldev219","download_url":"https://codeload.github.com/danieldev219/Test-for-Mynth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246752135,"owners_count":20827981,"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":[],"created_at":"2025-04-02T03:33:26.216Z","updated_at":"2025-04-02T03:33:26.623Z","avatar_url":"https://github.com/danieldev219.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microservices Assignment\n\n## Overview\nThis project consists of two microservices:\n- **Service A**: Sends messages to Service B and receives messages from Service B.\n- **Service B**: Sends messages to Service A and receives messages from Service A.\n\n---\n\n## Prerequisites\n- [Node.js](https://nodejs.org/) (v16 or higher)\n- [Docker](https://www.docker.com/) (for running RabbitMQ)\n\n---\n\n## Setup\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/danieldev219/Test-for-Mynth.git\ncd Test-for-Mynth\n```\n### 2. Install Dependencies\nInstall dependencies for both services:\n```bash\ncd service-a \u0026\u0026 npm install\ncd ../service-b \u0026\u0026 npm install\n```\n### 3. Start RabbitMQ\nStart RabbitMQ using Docker:\n```bash\ndocker run -d --hostname my-rabbit --name some-rabbitmq -p 5672:5672 rabbitmq:3\n```\n\n### 4. Running the Services\n#### Run Service A\nStart Service A on port 3000:\n#### Run Service B\nStart Service B on port 4000:\n```bash\ncd serviceA \u0026\u0026 npm start\ncd ../serviceB \u0026\u0026 npm start\n```\n\n---\n\n## Testing the Services\n### 1. Send a message from Service A to Service B:\n```bash\ncurl -X POST http://localhost:3000/send-to-b -H \"Content-Type: application/json\" -d '{\"message\": \"Hello from A\"}'\n```\n\n### 2. Send a message from Service B to Service A:\n```bash\ncurl -X POST http://localhost:4000/send-to-a -H \"Content-Type: application/json\" -d '{\"message\": \"Hello from B\"}'\n```\n\n---\n## API Endpoints\n### Service A\n\u003ch4\u003ePOST /send-to-b: Send a message to Service B.\u003c/h4\u003e\n\u003ch4\u003eRequest Body:\u003c/h4\u003e\n\n```bash\n{\n  \"message\": \"Your message here\"\n}\n```\n\n### Service B\n\u003ch4\u003ePOST /send-to-a: Send a message to Service A.\u003c/h4\u003e\n\u003ch4\u003eRequest Body:\u003c/h4\u003e\n\n```bash\n{\n  \"message\": \"Your message here\"\n}\n```\n\n---\n\n## **Folder Structure**\n```\nTest-for-Mynth/\n  ├── serviceA/\n  │   ├── src/\n  │   │   ├── server.ts\n  │   │   ├── rabbitmq.ts\n  │   ├── package.json\n  │   ├── tsconfig.json\n  ├── serviceB/\n  │   ├── src/\n  │   │   ├── server.ts\n  │   │   ├── rabbitmq.ts\n  │   ├── package.json\n  │   ├── tsconfig.json\n  ├── docker-compose.yml\n  ├── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldev219%2Ftest-for-mynth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieldev219%2Ftest-for-mynth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieldev219%2Ftest-for-mynth/lists"}