From 7c09a56669ec4fb729c8044917a586da75f9205a Mon Sep 17 00:00:00 2001 From: Gsk54 Date: Thu, 22 Dec 2022 14:42:47 +0100 Subject: [PATCH] update readme --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f2f8a66..2361d5c 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,14 @@ User-related data management. -## Installation +## Requirements You need [Docker](https://docs.docker.com/engine/) and [Docker-compose](https://docs.docker.com/compose/). +A RabbitMQ instance is also required to send messages when data has been inserted/updated/deleted. + +## Installation + Copy `.env.dist` to `.env` : ```bash @@ -33,7 +37,7 @@ sudo chown -R 5050:5050 postgresql/.pgadmin_data Before using the app, you need to launch the database migration : ```bash -docker exec v3_user sh -c "npx prisma migrate dev" +docker exec v3-user sh -c "npx prisma migrate dev" ``` ## Usage @@ -85,14 +89,24 @@ The app exposes the following [gRPC](https://grpc.io/) services : } ``` +## Messages + +A mentionned earlier, RabbitMQ messages are sent after these events : + +- **Create** (message : the created user informations) + +- **Update** (message : the updated user informations) + +- **Delete** (message : the uuid of the deleted user) + ## Test ```bash # unit tests -docker exec v3_user sh -c "npm run test" +docker exec v3-user sh -c "npm run test" # test coverage -docker exec v3_user sh -c "npm run test:cov" +docker exec v3-user sh -c "npm run test:cov" ``` Note : you can run all npm commands directly _outside_ the container (see _scripts_ section of `package.json` for available commands), but you need NodeJS installed locally. We **strongly** advise to install [Node Version Manager](https://github.com/nvm-sh/nvm) and use the latest LTS version of Node.