-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve dev instructions and fix auth audience for dev in config
- Loading branch information
Showing
2 changed files
with
45 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,71 +74,63 @@ This platform is composed of 3 main components: | |
> | ----------------- | -------- | --------------- | --------------- | ----- | -------------- | ----- | -------------- | ------------ | ------------------ | ----------- | ---------------------- | --------------------- | --------------------- | ----------------------- | | ||
> | | | | | | | | | | | | | | | | | ||
### 📥 Install dependencies | ||
### ⚡ Start for development | ||
|
||
1. Install [hatch](https://hatch.pypa.io/latest/) for managing python projects, and [pnpm](https://pnpm.io/installation) for TS/JS projects | ||
Requirements: [Docker](https://docs.docker.com/engine/install/) | ||
|
||
```bash | ||
pip install hatch | ||
``` | ||
1. Create a `.env` file with the secret configuration at the root of the repository (ask admins for the client ID and secret, and retrieve you Decentriq token from decentriq): | ||
|
||
2. Create a `backend/.env` file with secret configuration: | ||
```bash | ||
AUTH_ENDPOINT=https://auth0.com | ||
CLIENT_ID=AAA | ||
CLIENT_SECRET=BBB | ||
[email protected] | ||
DECENTRIQ_TOKEN=EEE | ||
JWT_SECRET=vCitcsPBwH4BMCwEqlO1aHJSIn--usrcyxPPRbeYdHM | ||
[email protected],[email protected] | ||
``` | ||
|
||
```bash | ||
AUTH_ENDPOINT=https://auth0.com | ||
CLIENT_ID=AAA | ||
CLIENT_SECRET=BBB | ||
[email protected] | ||
DECENTRIQ_TOKEN=EEE | ||
JWT_SECRET=vCitcsPBwH4BMCwEqlO1aHJSIn--usrcyxPPRbeYdHM | ||
[email protected],[email protected] | ||
``` | ||
2. Put the excel spreadsheet with all cohorts metadata in `data/iCARE4CVD_Cohorts.xlsx`. Uploaded cohorts will go to separated folders in `data/cohorts/` | ||
|
||
3. Put the excel spreadsheet with all cohorts metadata in `data/iCARE4CVD_Cohorts.xlsx`. Uploaded cohorts will go to separated folders in `data/cohorts/` | ||
3. Start the whole stack in development with docker compose, with hot reload for the frontend and backend: | ||
|
||
> \[!WARNING] | ||
> | ||
> There is a bug with pandas when conditional cells are used in the excel spreadsheet. To remove conditional cells copy the whole sheet content, delete the current content, and paste the original sheet content without formatting (ctrl+shift+v) | ||
```bash | ||
docker compose up | ||
``` | ||
|
||
> \[!IMPORTANT] | ||
> [!IMPORTANT] | ||
> | ||
> For the authentication to the Decentriq OAuth provider to work you need to deploy the backend on <http://localhost:3000> | ||
|
||
### ⚡ Start for development | ||
|
||
In development it is more convenient to start all components like the database with docker, and the backend/frontend outside of docker. | ||
|
||
Start the database with docker: | ||
|
||
```bash | ||
docker compose up db | ||
``` | ||
|
||
In a different terminal, start the backend: | ||
|
||
```bash | ||
cd backend | ||
hatch run dev | ||
``` | ||
|
||
In another terminal, start the frontend: | ||
|
||
```bash | ||
cd frontend | ||
pnpm dev | ||
``` | ||
> [!NOTE] | ||
> | ||
> In development the user requesting a DCR will be added to as data owner of all cohorts dataset requested for development purpose (so they can provision the data themselves, and to avoid spamming emails owners when developing) | ||
|
||
> \[!TIP] | ||
> [!TIP] | ||
> | ||
> Alternatively you can start the different component in in different terminals outside of docker. For this, put the `.env` file in the `backend` folder | ||
> | ||
> Alternatively you can start the whole stack in development with docker compose in 1 command, but you won't get hot reload for the frontend (you will need to rebuild the frontend image for changes to be taken into account): | ||
> Start the database with docker: | ||
> | ||
> ```bash | ||
> docker compose up | ||
>docker compose up db | ||
> ``` | ||
> [!NOTE] | ||
> | ||
> In a different terminal, start the backend with [hatch](https://hatch.pypa.io/latest/install/): | ||
> | ||
> In development the user requesting a DCR will be added to as data owner of all cohorts dataset requested for development purpose (so they can provision the data themselves, and to avoid spamming emails owners when developing) | ||
> ```bash | ||
>cd backend | ||
> hatch run dev | ||
> ``` | ||
> | ||
> In another terminal, start the frontend with [pnpm](https://pnpm.io/installation): | ||
> | ||
> ```bash | ||
>cd frontend | ||
> pnpm install | ||
> pnpm dev | ||
> ``` | ||
> | ||
|
||
### 🧹 Code formatting and linting | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters