Skip to content
Snippets Groups Projects
Commit 559930e1 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Update media-library, organizations and resources services' documentation

parent 441cdd15
No related branches found
No related tags found
2 merge requests!14Doc webapp,!13Doc webapp
docs/assets/resources-service.png

29.5 KiB

# Reuses
## Features
## Dependencies
## Endpoints
## Implementation
...@@ -23,11 +23,10 @@ This service has no dependency on other components. ...@@ -23,11 +23,10 @@ This service has no dependency on other components.
The service provides two endpoints, The service provides two endpoints,
1. `/credits`; 1. `/credits`;
2. `/links`,
allowing one to perform CRUD operations on credits and links in a RESTful manner. Moreover, an healtcheck endpoint is provided, allowing one to perform CRUD operations on credits in a RESTful manner. Moreover, an healtcheck endpoint is provided,
3. `/health`, 2. `/health`,
returning a `200` HTTP code if the API is healthy, `503` otherwise. For the service to be healthy, the underlying database must be up. returning a `200` HTTP code if the API is healthy, `503` otherwise. For the service to be healthy, the underlying database must be up.
......
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
## Features ## Features
This service allows you to upload a file on the [Minio](https://min.io/) instance (compatible with S3) of your choice. The file will be stored in the bucket defined in the configuration of the service. This service allows you to upload a file on the [Minio](https://min.io/) instance (compatible with S3) of your choice. The file will be stored in the bucket defined in the configuration of the service. It also stores some metadataabout the file in a mongo database.
## Dependencies ## Dependencies
This service needs a running instance of Minio in order to work.
## Endpoints ## Endpoints
For this service we implemented a custom health indicator that checks the connection to MinIO giving the total number of buckets when the connection is succesful. For this service we implemented a custom health indicator that checks the connection to MinIO giving the total number of buckets when the connection is succesful.
...@@ -20,4 +22,4 @@ Before uploading the file, it makes sure that the specified bucket is created. I ...@@ -20,4 +22,4 @@ Before uploading the file, it makes sure that the specified bucket is created. I
The files are folded in sub-buckets as following `/<specified-bucket-name>/<year-YYYY>/<month-MM>/`. The files are folded in sub-buckets as following `/<specified-bucket-name>/<year-YYYY>/<month-MM>/`.
The uploaded file keep its original name but is prefixed by an md5 computed based on its content witch gives the following pattern for file names: `<md5>-<original-name>`. This means that if we upload twice the exact same file, with the same name there will be only one file stored in MinIO. The uploaded file keep its original name but is prefixed with the id of the corresponding entry in the mongo database.
\ No newline at end of file
...@@ -5,12 +5,37 @@ ...@@ -5,12 +5,37 @@
This service provides a list of organizations with different information about it (such as description, logo..etc). This service provides a list of organizations with different information about it (such as description, logo..etc).
In our application, one organization is usually a provider of data, used in the Portal Open Data. It can be a public actor or a private one. In our application, one organization is usually a provider of data, used in the Portal Open Data. It can be a public actor or a private one.
Each record of the catalog includes the following information:
* `id`: a technical unique identifier acting as primary key in the underlying database
* `uuid`: a business unique identifier
* `name`: the name of the credited initiative
* `description`: a short description of the credited initiative, in particular of the role the latter plays in this project
* `links`: a collection of URLs related to the organization, modeled as a One-To-Many relationship
* `logo`: the URL of the organization's logo
* `published`: a boolean flag, indicating whether the record is published or not (draft)
* `elasticSearchName`: name of the organization in elasticsearc, it can be found in the metadata of a dataset under `responsibleParty[0].organisationName`.
## Dependencies ## Dependencies
This service has no dependency on other components.
## Endpoints ## Endpoints
The service provides two endpoints,
1. `/organizations`;
allowing one to perform CRUD operations on credits and links in a RESTful manner. Moreover, an healtcheck endpoint is provided,
2. `/health`,
returning a `200` HTTP code if the API is healthy, `503` otherwise. For the service to be healthy, the underlying database must be up.
## Implementation ## Implementation
![organizations-service](../../assets/organizations-service.png) ![organizations-service](../../assets/organizations-service.png)
The entrypoint of the service is a REST API provided by a [NestJS](https://github.com/nestjs/nest) application. This backend application interacts with a PostgresSQL database through an ORM called [TypeORM](https://github.com/typeorm/typeorm). The service is implemented using the [NestJS](https://nestjs.com/) framework. We refer the reader to the [NestJS-based micro-services](../../miscellaneous/nestjs-micro-services.md) page for further details concerning NestJS and the features it provides.
\ No newline at end of file
Data persistence is achieved by using [PostgreSQL](https://www.postgresql.org/) and [TypeORM](https://github.com/typeorm/typeorm).
...@@ -11,12 +11,27 @@ the output of a Web Feature Service (WFS), standard service providing an interfa ...@@ -11,12 +11,27 @@ the output of a Web Feature Service (WFS), standard service providing an interfa
## Dependencies ## Dependencies
This service has no dependency on other components.
## Endpoints ## Endpoints
For this service we declared an health indicator that verifies that it can connect to the database. The service provides five endpoints,
1. `/resources`;
2. `/resourceformats`;
3. `/projections`;
4. `/formats`;
allowing one to perform CRUD operations in a RESTful manner. Moreover, an healtcheck endpoint is provided,
5. `/health`,
returning a `200` HTTP code if the API is healthy, `503` otherwise. For the service to be healthy, the underlying database must be up.
## Implementation ## Implementation
![resources-service](../../assets/organizations-service.png) ![resources-service](../../assets/resources-service.png)
The service is implemented using the [NestJS](https://nestjs.com/) framework. We refer the reader to the [NestJS-based micro-services](../../miscellaneous/nestjs-micro-services.md) page for further details concerning NestJS and the features it provides.
The entrypoint of the service is a REST API provided by a [NestJS](https://github.com/nestjs/nest) application. This backend application interacts with a PostgresSQL database through an ORM called [TypeORM](https://github.com/typeorm/typeorm). Data persistence is achieved by using [PostgreSQL](https://www.postgresql.org/) and [TypeORM](https://github.com/typeorm/typeorm).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment