# Microservices Each microservice has a core/common module with modules that can be useful in any microservice: Kafka module. Sends messages via Kafka. Logger module. Logs all the messages fro microservice. HTTP response. Generates a generic HTTP response with your data. Health service. Makes a helath check. Prometheus service. Sends info to Prometheus. > Do not use `console.log`, use the _**logger service**_ instead. For detailed documentation about any microservice you can see its compodoc. ```sh npm run compodoc ``` All gateways use _**JWT token**_ to guard access and get user ID with all requests. This means that when anyone logs into their account, they receive an access token with user account information (see below). This access token also contains encoded Keycloak security information, so our _**gateways reject access tokens**_ not created by our system. We also get _**Account ID**_ and _**Username**_ (phone number) from the JWT token. JWT token data example: ```json { "exp": 1673560863, "iat": 1673524863, "jti": "6d29c45d-1f63-4b0f-a3fc-22cc9d8db25c", "iss": "http://localhost:8080/auth/realms/master", "sub": "99b2ca6d-b179-4161-9c25-ad84ab7ca438", "typ": "Bearer", "azp": "comfortech", "session_state": "9b1a9973-b270-4e27-b83e-3284b867e4f1", "acr": "1", "resource_access": { "comfortech": { "roles": [ "user" ] } }, "scope": "email profile", "sid": "9b1a9973-b270-4e27-b83e-3284b867e4f1", "email_verified": true, "preferred_username": "+79516519741" } ``` ### Iguana **Iguana** is a main gateway responsible for communication between Peacock and Kaiser (via HTTP). ### Pyrador **Pyrador** is a gateway responsible for authentification and user account management (for both users and admins). ### Zoo **Zoo** is a gateway responsible for communication with the admin panel only and environment configuration scripts. ### Crow **Crow** is a microservice responsible for all data operations, account management and some business logic. ### Goose **Goose** is a microservice responsible for connection with foxes (via MQTT). ### Pigeons **Pigeons** is a microservice responsible for notifications (push, SMS, email).