{"id":19025277,"url":"https://github.com/dz1kill/working_with_microservices","last_synced_at":"2025-02-21T19:14:21.968Z","repository":{"id":183505435,"uuid":"670067516","full_name":"dz1kill/working_with_microservices","owner":"dz1kill","description":"API for generating invoices on microservice architecture.","archived":false,"fork":false,"pushed_at":"2023-07-25T10:06:26.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T02:14:38.806Z","etag":null,"topics":["bunyan","express","microservices","nodejs","postgresql","queue","rebbitmq","remoteprocedurecall","typescript"],"latest_commit_sha":null,"homepage":"","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/dz1kill.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-07-24T08:15:51.000Z","updated_at":"2023-07-25T10:06:31.000Z","dependencies_parsed_at":"2024-11-12T06:16:57.369Z","dependency_job_id":null,"html_url":"https://github.com/dz1kill/working_with_microservices","commit_stats":null,"previous_names":["dz1ki/microservices","dz1kill/working_with_microservices"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dz1kill%2Fworking_with_microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dz1kill%2Fworking_with_microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dz1kill%2Fworking_with_microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dz1kill%2Fworking_with_microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dz1kill","download_url":"https://codeload.github.com/dz1kill/working_with_microservices/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240072132,"owners_count":19743526,"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":["bunyan","express","microservices","nodejs","postgresql","queue","rebbitmq","remoteprocedurecall","typescript"],"created_at":"2024-11-08T20:43:04.548Z","updated_at":"2025-02-21T19:14:21.943Z","avatar_url":"https://github.com/dz1kill.png","language":"TypeScript","readme":"## Description\n\nA small service for receiving invoices for payment.\n\nStack:  \n The platform for creating a service is Node.js.  \n Framework - Express.  \n ORM - Sequelize-typescript.  \n PostgreSQL as a database.  \n Message Broker: RebbitMQ.  \n Swagger documentation.  \n Docker-compose is used to organize work with RebbitMQ and PostgreSQL.  \n Logging: Bunyan.\n\nThe working process:\n\n1. The client sends an HTTP request to the service, passing to the API:  \n   1.1 Email address.  \n   1.2 The content of the work performed, in the form of a list of works and the cost for each item.\n\n2. On the server side \"web-api\":  \n   2.1 Using e-mail, the server retrieves additional information about the client from the database to generate an invoice.  \n   2.3 Sends data to the queue: \"generateInvoice\".  \n   2.4 Waiting for a response from the \"generateInvoice\" queue.  \n   2.5 If within 7s. no response, an error is returned.\n\n3. On the microservice \"worker-pdf\" side:  \n   3.1 The event listener responds to messages.  \n   3.2 Calls a function to generate an invoice.  \n   3.3 After the file is generated, it is sent to the queue: \"invoiceGenerated\".\n\nFor clarity, the Invoice generation function uses a delay of 2s. Logs are stored in the folder: Logs.\n\n## Running the app\n\n```bash\n\n# In the console, run the build and launch images with the command:\n$ docker-compose up\n\n# Wait until the server starts.\n\n# In the new terminal go to the web-api directory.\n$ cd web-api\n\n# Install dependencies.\n$ npm install\n\n# Create tables in the database using the \"migrations\" command:\n$ npm run migrate:run\n\n# Fill in the tables with the data \"seeders\" with the command:\n$ npm run seed:run\n\n# Start the server\n$ npm run start\n\n# In the new terminal go to the worker-pdf directory.\n$ cd worker-pdf\n\n# Install dependencies.\n$ npm install\n\n# Run worker-pdf microservice.\n$ npm run start\n\n```\n\n## Test\n\nDocumentation (Swagger UI) is available at: [link] http://localhost:3000/api/\n\nRabbitMQ Management: [link] http://localhost:15672/  \nCredentials: User: Yra, Passaword: 1234\n\nnode v16.14.2\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdz1kill%2Fworking_with_microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdz1kill%2Fworking_with_microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdz1kill%2Fworking_with_microservices/lists"}