|
| 1 | +# General organization contribution guidelines |
| 2 | + |
| 3 | +Please, read the [General Contribution Guidelines](https://github.com/upb-code-labs/docs/blob/main/CONTRIBUTING.md) before contributing. |
| 4 | + |
| 5 | +# Submissions Status Updater micro-service contribution guidelines |
| 6 | + |
| 7 | +## Project structure / architecture |
| 8 | + |
| 9 | +The Submissions Status Updater micro-service's architecture is based on the Hexagonal Architecture in order to make it easier to maintain and extend. |
| 10 | + |
| 11 | +The project structure is as follows: |
| 12 | + |
| 13 | +- `domain`: Contains the business logic of the Submissions Status Updater micro-service. |
| 14 | + |
| 15 | + - `definitions`: Contains the interfaces (contracts) of the Submissions Status Updater micro-service. |
| 16 | + - `entities`: Contains the entities of the Submissions Status Updater micro-service. |
| 17 | + - `dtos`: Contains the data transfer objects of the Submissions Status Updater micro-service. |
| 18 | + |
| 19 | +- `application`: Contains the application logic (use cases) of the Submissions Status Updater micro-service. |
| 20 | + |
| 21 | +- `infrastructure`: Contains the implementation of the Submissions Status Updater micro-service's interfaces (contracts) and the external dependencies of the Submissions Status Updater micro-service. |
| 22 | + |
| 23 | + - `implementations`: Contains the implementations of the `domain` interfaces (contracts). |
| 24 | + |
| 25 | +- `shared`: Contains the shared code of the Submissions Status Updater micro-service. |
| 26 | + |
| 27 | + - `utils`: Contains the utility functions of the Submissions Status Updater micro-service. |
| 28 | + |
| 29 | +## Local development |
| 30 | + |
| 31 | +### Dependencies |
| 32 | + |
| 33 | +The following dependencies are required to run the Submissions Status Updater micro-service locally: |
| 34 | + |
| 35 | +- [Go 1.21.5](https://golang.org/doc/install) |
| 36 | +- [Podman](https://podman.io/getting-started/installation) (To build and test the container image) |
| 37 | + |
| 38 | +Please, note that `Podman` is a drop-in replacement for `Docker`, so you can use `Docker` instead if you prefer. |
| 39 | + |
| 40 | +Additionally, you may want to install the following dependencies to make your life easier: |
| 41 | + |
| 42 | +- [Air](https://github.com/cosmtrek/air) (for live reloading) |
| 43 | + |
| 44 | +### Running the Submissions Status Updater micro-service locally |
| 45 | + |
| 46 | +As the role of the Submissions Status Updater micro-service is to listen for messages in the `submission-status-updates` queue and update the status of the submissions in the database and publish the updated submissions to the `real-time-updates` queue, you will need to run the [gateway](https://github.com/UPB-Code-Labs/main-api) project first in order to initialize the queue, database, RabbitMQ and the other micro-services and then you can send submissions by using the REST API. |
| 47 | + |
| 48 | +After you have the gateway running, you can start the Submissions Status Updater micro-service by running the following command: |
| 49 | + |
| 50 | +```bash |
| 51 | +air |
| 52 | +``` |
| 53 | + |
| 54 | +This will start the Submissions Status Updater micro-service and will watch for changes in the source code and restart the service automatically. |
0 commit comments