Sign inSign up

vitalyiegorov/rad-orders-api

By vitalyiegorov

•Updated over 7 years ago

Image
0

203

vitalyiegorov/rad-orders-api repository overview

⁠RAD Test assignment

According to this link⁠

  • Projects is written with typescript.
  • Service intercommunication is implemented using AMQP RabbitMQ⁠ direct exchange.
  • TypeORM/MySQL is used for order storage.

⁠Structure

⁠apps

Our micro-services folder:

  • orders - Orders service built with ExpressJS
  • payments - Payments service, simple AMQP handlers

⁠libs/common

Our config with generic types, enums, interfaces and services folder:

  • services/amqp.service.ts - Main messaging service used in both services

⁠Testing

Project uses Jest⁠ for unit testing and Supertest⁠ for E2E tests(only OrdersController).

⁠Running tests

npm run test

⁠Running the project

  • Start infrastructure: docker-compose build && docker-compose up
  • Create order: curl -X POST http://localhost:3001/orders
  • Cancel order: curl -X DELETE http://localhost:3001/orders/:id (Due to random nature of order creation and payment processing, please see logs to wait for DECLINED payment before canceling order)
  • Show order status: curl -X GET http://localhost:3001/orders/:id

Tag summary

Content type

Image

Digest

Size

396.4 MB

Last updated

over 7 years ago

docker pull vitalyiegorov/rad-orders-api