Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mustafah15/coding-challenge
https://github.com/mustafah15/coding-challenge
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mustafah15/coding-challenge
- Owner: mustafah15
- Created: 2023-09-23T16:06:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-25T19:08:44.000Z (about 1 year ago)
- Last Synced: 2024-05-02T06:12:26.352Z (7 months ago)
- Language: TypeScript
- Size: 115 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# coding challenge
working local development for NestJs, Kafka, PostgreSQL on top of docker-compose
## Quick Start
- Clone this repo
- Install npm packages - _for IDE type checking_.```bash
yarn install --frozen-lockfile
```- Build and run the Docker image for development
```bash
yarn docker-compose:dev
```### API swagger
can be accessed from `http://localhost:3000/doc`- Access the app at http://localhost:3000.
- Make file changes and it will automatically rebuild the app.### Running All Tests
```bash
yarn run test
```## objectives
sample REST API for
- retrieve all orders
- get one order by its id
- create a new orderOrder creation will create a new event in kafka topic called `orders.notification` with message type `order.placed`
Notification service listen to this specific topic and handle the event## common infrastructure
you can find under `/common` a few infrastructure services that serve the following cases:
- kafka decorators which can be used to decorate any function listen to any specific topic
- kafka module a global module that expose kafka service that can be used to send different event to the kafka stream
- filters (entity not found) which catch any entity not found error and return 404 http response## testing
only orders service is tested the reason why is that this is almost where all the logic happens however this is super minimal approach to see through and just make sure all dots are connected and **not enough by any mean for a production service
**## todos
- [ ] add more e2e test
- [ ] make the CI tests faster by removing kafka
- [ ] if there enough domain information abstract order into a separate domain class