Skip to content

Commit d9bb99a

Browse files
committed
docs: improve documentation
1 parent 068fab8 commit d9bb99a

11 files changed

+170
-104
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The full documentation is available [here](https://codegouvfr.github.io/catalogi
1313

1414
1. [https://code.gouv.fr/sill](https://code.gouv.fr/sill/) for the
1515
list of recommanded Free Software for French administrations.
16-
2. [https://logiciels.catalogue-esr.fr/](https://logiciels.catalogue-esr.fr/) for the CNRS, listing mostly HAL softwares.
16+
2. [https://logiciels.catalogue-esr.fr/](https://logiciels.catalogue-esr.fr/) for the French Research Minister, listing mostly HAL softwares.
1717

1818
## Code organization
1919

docker-compose.resources.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ services:
2424
# an OIDC provider, Keycloak
2525
keycloak:
2626
image: quay.io/keycloak/keycloak:26.2.5
27-
container_name: keycloak-standalone
2827
environment:
2928
KC_BOOTSTRAP_ADMIN_USERNAME: admin
3029
KC_BOOTSTRAP_ADMIN_PASSWORD: admin

docs/README.md renamed to docs/1-about-catalogi.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,30 @@ The catalogi software is deployed on different places, such as :
1010

1111
1. [https://code.gouv.fr/sill](https://code.gouv.fr/sill/) for the
1212
list of recommanded Free Software for French administrations.
13-
1. [https://logiciels.catalogue-esr.fr/](https://logiciels.catalogue-esr.fr/) for the CNRS, listing mostly HAL softwares.
13+
1. [https://logiciels.catalogue-esr.fr/](https://logiciels.catalogue-esr.fr/) for the French Research Minister, listing mostly HAL softwares.
1414

1515

1616
[Summary](_sidebar.md)
1717

1818
Doc deployment (folder `/docs`) uses [docsify-dsfr-template](https://github.com/codegouvfr/docsify-dsfr-template).
1919

20-
# Contribute
20+
## Source code
21+
22+
All the source code is hosted on the monorepo : [https://github.com/codegouvfr/catalogi](https://github.com/codegouvfr/catalogi).
23+
24+
It is the source code for 3 differents apps :
25+
26+
* `/web`: The web application, runs in the browser.
27+
* `/api`: The RPC API consumed by the web application. The code for different jobs is also in this folder.
28+
* `/docs`: The documentation. It is hosted on [https://codegouvfr.github.io/sill](https://codegouvfr.github.io/sill)
29+
30+
The data is kept in a postgres database .
31+
32+
## Contribute
2133

2234
See [CONTRIBUTING.md](CONTRIBUTING.md).
2335

24-
# License
36+
## License
2537

2638
2021-2025 Direction interministérielle du numérique, mission logiciels libres.
2739

docs/2-getting-started.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Getting started with Catalogi
2+
3+
## Run in local
4+
5+
To run the application in local, you need :
6+
- docker and docker-compose, do setup the database, and local keycloak server.
7+
- nodejs 22 and yarn to run the web application (front and back)
8+
9+
10+
1. Clone the repository
11+
12+
```bash
13+
git clone [email protected]:codegouvfr/catalogi.git
14+
```
15+
16+
2. Install the dependencies
17+
18+
```bash
19+
cd catalogi
20+
yarn install
21+
```
22+
23+
3. Create a `.env` file and set the environment variables as needed. You can copy the `.env.sample` file to start with a template.
24+
25+
```bash
26+
cp .env.sample .env
27+
```
28+
29+
Than you should adjust the variables in the `.env`, look at [the different variables here](6-env-variables-and-customization.md) for more details.
30+
31+
4. start the local resources with docker-compose
32+
33+
```bash
34+
docker compose -f docker-compose.resources.yml up --build -d
35+
```
36+
37+
5. start the frontend and backend in dev
38+
39+
```bash
40+
yarn dev # from the root, this will run both the frontend and backend `yarn dev`
41+
```
42+
43+
44+
The docker-compose.resources.yml will start:
45+
- a postgres database
46+
- an adminer instance so that you can access the database with a UI (http://localhost:8082)
47+
- a keycloak server (http://localhost:8080/) in dev mode, with a default admin user `admin` and password `admin`.
48+
49+
## Pushing a new version
50+
51+
When you want to push a new release, you need to update the version number in the root `package.json`.
52+
The CI will :
53+
- validate the code
54+
- create a release on GitHub
55+
- create the corresponding docker images and push them on docker hub :
56+
- [codegouvfr/catalogi-web](https://hub.docker.com/r/codegouvfr/catalogi-web/tags)
57+
- [codegouvfr/catalogi-api](https://hub.docker.com/r/codegouvfr/catalogi-api/tags)
58+
59+
## Deployments
60+
61+
You can deploy Catalogi with the following methods:
62+
63+
- [Docker Compose](4-deploying-with-docker-compose.md)
64+
- [Kubernetes (with Helm charts)](5-deploying-with-kubernetes.md)
65+
66+
67+
## Source code
68+
69+
All the source code is hosted on this repository.
70+
71+
The repository is the source code for 3 differents apps :
72+
73+
* `/web`: The web application, runs in the browser. The site is here : [https://code.gouv.fr/sill](https://code.gouv.fr/sill)
74+
* `/api`: The RPC API consumed by the web application.
75+
* `/docs`: The documentation. It is hosted on [https://codegouvfr.github.io/sill](https://codegouvfr.github.io/sill)
76+
77+
The data is hosted on separate repositories:
78+
* [codegouvfr/sill-data](https://github.com/codegouvfr/sill-data): Production database (private repository).
79+
* [codegouvfr/sill-data-test](https://github.com/codegouvfr/sill-data-test): Preprod database
80+
* [codegouvfr/sill-data-template](https://github.com/codegouvfr/sill-data-template): Template for creating new database.
81+

docs/3-setup-a-keycloak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO : Document how to set up a Production Keycloak server

docs/deploying-with-docker-compose.md renamed to docs/4-deploying-with-docker-compose.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## Deploying the web app with docker-compose
22

3+
# Requirements
4+
5+
To deploy the app using docker compose you need :
6+
- Docker
7+
- Docker Compose
8+
- An OIDC provider like Keycloak, that is already independently deployed
9+
310
There is an example of how to deploy the sill web app with docker-compose [here](https://github.com/codegouvfr/sill/tree/main/deployments/docker-compose-example).
411

512
You can copy paste the folder. Than you will need `.env` file to configure the environnement variables. You can get it by copying the `.env.sample` file from the sill-api repository and modifying it to your needs.
@@ -8,9 +15,7 @@ You can copy paste the folder. Than you will need `.env` file to configure the e
815
cp .env.sample .env
916
```
1017

11-
You will need to provide an ssh key in SILL_SSH_PRIVATE_KEY, and it should have the access to the repo you provide in SILL_DATA_REPO_SSH_URL
12-
13-
You will also need to provide a GITHUB_TOKEN.
18+
Than ajust the variables in the `.env` file to match your OIDC provider, your database and all. [More details about the variables can be found here]()
1419

1520
You can change the way you handle the frontal part in the [nging configuration file](https://github.com/codegouvfr/sill/blob/main/deployments/docker-compose-example/nginx/default.conf).
1621
The provided example is basic, and for example it does not provide support for `https` (you would need to configure it with you SSL certificates).

docs/deploying-with-kubernetes.md renamed to docs/5-deploying-with-kubernetes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
# Deploying Catalogi with Kubernetes
3+
4+
⚠ WARNING - This page of the documentation is obsolete, and will be updated soon. - ⚠
5+
16
This is a step by step guide for deploying sill.code.gouv.fr
27

38
## The Git based Database
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Environment Variables and Customization
2+
3+
## Environment variables
4+
5+
The following environment variables are used to configure the Catalogi web application.
6+
You can set them in a `.env` file or directly in your environment.
7+
8+
| Variable Name | Required | Default Value | Example Value |
9+
|----------------|----------|----------------|----------------|
10+
| OIDC_ISSUER_URI || - | `http://localhost:8080/realms/catalogi` |
11+
| OIDC_CLIENT_ID || - | `catalogi` |
12+
| DATABASE_URL || - | `postgresql://catalogi:pg_password@localhost:5432/catalogi` |
13+
| API_PORT || `8080` | `1234` |
14+
| IS_DEV_ENVIRONNEMENT || `false` | `true` |
15+
| EXTERNAL_SOFTWARE_DATA_ORIGIN || `wikidata` | `wikidata` or `HAL` |
16+
| INIT_SOFT_FROM_SOURCE || `false` | `true` |
17+
| BOT_AGENT_EMAIL || - | `[email protected]` |
18+
| IMPORT_WIKIDATA || - | `Q123,Q456,Q789` |
19+
| REDIRECT_URL || - | `https://catalogi.example.com` |
20+
21+
There is another variable that is purely for frontend configuration, which can contain HTML code, that will be injected in the `<head>` of the web application. It is useful to add meta tags, or other HTML elements that you want to be present in the head of the page. Note that you cannot use the syntay with backticks '`'.
22+
23+
```
24+
VITE_HEAD="
25+
<title>Catalogi - Deployment exemple</title>
26+
27+
<script defer>
28+
console.log('This is a custom code in head');
29+
</script>
30+
"
31+
```
32+
33+
There are also some variables that are used only for the docker-compose.resources.yml to work properly in dev env. Make sure it is aligned with the `DATABASE_URL` variable above.
34+
35+
```
36+
POSTGRES_DB=db
37+
POSTGRES_USER=catalogi
38+
POSTGRES_PASSWORD=pg_password
39+
```
40+
41+
## UI Configuration
42+
43+
The UI can be customized, some tabs might not be relevant for your use case. We have a json file that can be used to configure the UI. It is located in `api/src/customization/ui-config.json`. It has to follow the schema defined in `api/src/core/uiConfigSchema.ts`.
44+
45+
46+
## Translations
47+
48+
The translations are also configurable, so you can choose any wording you want. Is is defined in `api/src/customization/translations`. There you can add your own translations, providing a `en.json` and `fr.json` file. For now we support only English and French, but fill free to [raise an issue](https://github.com/codegouvfr/catalogi/issues/new) if you want to add more languages.
49+
50+
Please note that you can override the translations you want, and all those that are not overridden will fallback to the default translations provided by the application.

docs/_sidebar.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
* [README](README.md)
1+
<!-- * [ℹ About catalogi](1-about-catalogi.md)
22
* [🎯 Index](index.md)
33
* [🏁 Deploying the web App (Kubernetes)](deploying-with-kubernetes.md)
44
* [🏁 Deploying the web App (docker-compose)](deploying-with-docker-compose.md)
55
* [⚒ Deploying the web App (Bare metal)](deploying-the-web-app-bare-metal.md)
66
* [👩💻 Setting up a development environment](setting-up-a-development-environment.md)
7-
* [🤝 Contributing](CONTRIBUTING.md)
7+
* [🤝 Contributing](CONTRIBUTING.md) -->
8+
9+
10+
* [ℹ About catalogi](1-about-catalogi.md)
11+
* [🎯 Getting started](2-getting-started.md)
12+
* [🏁 Deploying the web App (docker-compose)](4-deploying-with-docker-compose.md)
13+
* [🏁 Deploying the web App (Kubernetes)](5-deploying-with-kubernetes.md)
14+
* [⚙ Environment variables and customization](6-env-variables-and-customization.md)

docs/index.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)