Skip to content
Snippets Groups Projects
Commit d6062812 authored by FORESTIER Fabien's avatar FORESTIER Fabien Committed by ncastejon
Browse files

Update media-library, organizations and resources services' documentation

parent f079234e
No related branches found
No related tags found
1 merge request!14Doc 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.
The service provides two endpoints,
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.
......
......@@ -2,10 +2,12 @@
## 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
This service needs a running instance of Minio in order to work.
## 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.
......@@ -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 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.
\ No newline at end of file
The uploaded file keep its original name but is prefixed with the id of the corresponding entry in the mongo database.
......@@ -5,12 +5,37 @@
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.
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
This service has no dependency on other components.
## 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
![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).
\ No newline at end of file
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.
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
## Dependencies
This service has no dependency on other components.
## 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
![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.
Finish editing this message first!
Please register or to comment