|
| 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 | + |
0 commit comments