Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 6a313317 rédigé par Serge Bibauw's avatar Serge Bibauw
Parcourir les fichiers

Fix lint

parent f44b3108
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -4,7 +4,7 @@ This document aims to specify how we currently work on this project, and how to
## General organisation
To keep track of the past, present and future work, we use the gitlab repository as a source of trust for the progress of the project. All the bugs, *to do*, improvement ideas and discussions are developed in the [issues](https://forge.uclouvain.be/sbibauw/languagelab/-/issues).
To keep track of the past, present and future work, we use the gitlab repository as a source of trust for the progress of the project. All the bugs, _to do_, improvement ideas and discussions are developed in the [issues](https://forge.uclouvain.be/sbibauw/languagelab/-/issues).
The issues are categorised using tags. There are two types of tags. Gray tags are used to specify the kind of issues: UX, Studies, AI, topics, ... New kinds could be created at any time to reflect the progress and the targets of the project. Colored tags are used to specify the priority of an issue. Here are the different priorities:
......@@ -12,7 +12,7 @@ The issues are categorised using tags. There are two types of tags. Gray tags ar
- To do: New functionalities or improvements already discussed and validated.
- Waiting: Issues where work has already started, but is waiting someone else's answer or opinion to continue.
- To review: Developed functionalities and improvements waiting for a review.
- Nice to have: Non-priority features or improvements, that would be *nice to have*.
- Nice to have: Non-priority features or improvements, that would be _nice to have_.
- Open for discussions: Features and improvements that still need more discussions before being started.
- Won't: Rejected features and improvements.
......@@ -20,7 +20,6 @@ To keep track of who is working on what, it's better to assign our-self an issue
The different planned versions and the issues assigned to them are presented in the form of [milestones](https://forge.uclouvain.be/sbibauw/languagelab/-/milestones). The general idea is to finish a milestone before working on the next one.
## Getting started
#### Requirements
......@@ -31,11 +30,12 @@ The different planned versions and the issues assigned to them are presented in
#### Configuration
The application is configured using environment variables for both the frontend and the backend. The best way to specify them is through the `.env` file.
The application is configured using environment variables for both the frontend and the backend. The best way to specify them is through the `.env` file.
Check `backend/app/config.py` and `frontend/src/lib/config.ts` for an extensive list of the environment variables in use and their default values.
Here is a simple example:
```sh
LANGUAGELAB_JWT_SECRET_KEY=abc
LANGUAGELAB_JWT_REFRESH_SECRET_KEY=efg
......@@ -44,6 +44,7 @@ LANGUAGELAB_ADMIN_PASSWORD=admin
LANGUAGELAB_CALCOM_SECRET=hij
ALLOWED_ORIGINS=*
```
⚠ Be sure to NEVER push the `.env` to the repo, and to use long and random keys for tests and deployment ⚠
#### Backend dependencies
......@@ -69,6 +70,7 @@ pip install -r ../requirements.txt
#### Pre-Commit hooks
The CI run `npm run lint` and `black --check --verbose` on every commit, on every branch. To prevent a failing CI, there is a pre-commit hook ([docs](https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks)). To use it, you can configure the local repository to use the hooks available directly on the repository:
```sh
git config --local core.hooksPath .githooks
```
......@@ -102,16 +104,20 @@ As alembic is backend-specific, you have to go into the `backend` folder for the
:warning: Alembic versions work as a linked list. Each version refer it's previous and next version. To prevent having to tweak "weird" things, ensure you're up-to-date with any other version update. You could need to redo those steps if someone else merged a change in the meantime.
To create a migration script, you can run
```sh
alembic revision -m "<change message>"
```
It will tell you the name of the new file, where you can implement the changes.
In most cases, you should only need to change the functions:
- `upgrade` contains all your changes
- `downgrade` drop them. This is **deeply advised** to allow to rollback in case of issue, especially in production.
- `upgrade` contains all your changes
- `downgrade` drop them. This is **deeply advised** to allow to rollback in case of issue, especially in production.
Here are the most useful alembic functions:
```python
# Create a table
op.create_table(
......@@ -134,9 +140,11 @@ op.alter_column('account', 'id', new_column_name='uuid')
```
To update to the latest version:
```sh
alembic upgrade head
```
:warning: You will also need to run that if someone else wrote a version. This is NOT automatic for the local environment.
For more in depth information, check the [official documentation](https://alembic.sqlalchemy.org/en/latest/).
Generic single-database configuration.
\ No newline at end of file
Generic single-database configuration.
LanguageLab utilise le site https://cal.com pour programmer les séances entre les tuteurs et les étudiants.
Afin que l'intégration soit réussie, il est nécessaire de suivre les étapes suivantes:
- Créer un compte sur https://cal.com.
- Créer un nouveau type d'événement de 60 mins (https://app.cal.com/event-types -> [+ Nouveau]) avec un nom cohérent, par exemple `languagelab-tutorat`
- Indiquer le lien de l'évenement dans https://languagelab.sipr.ucl.ac.be/tutor/timeslots. Example: `username/languagelab-tutorat`
- Créer un compte sur https://cal.com.
- Créer un nouveau type d'événement de 60 mins (https://app.cal.com/event-types -> [+ Nouveau]) avec un nom cohérent, par exemple `languagelab-tutorat`
- Indiquer le lien de l'évenement dans https://languagelab.sipr.ucl.ac.be/tutor/timeslots. Example: `username/languagelab-tutorat`
......@@ -54,7 +54,7 @@
<label class="label" for="instructions">{$t('tasks.instructions')}</label>
<textarea
use:autosize
rows=2
rows="2"
class="input w-full"
id="instructions"
name="instructions"
......@@ -64,7 +64,7 @@
<label class="label" for="learnerInstructions">{$t('tasks.learnerInstructions')}</label>
<textarea
use:autosize
rows=2
rows="2"
class="input w-full"
id="learnerInstructions"
name="learnerInstructions"
......@@ -74,7 +74,7 @@
<label class="label" for="examples">{$t('tasks.examples')} *</label>
<textarea
use:autosize
rows=2
rows="2"
class="input w-full"
id="examples"
name="examples"
......
......@@ -165,24 +165,24 @@
<p>
{currentTask.instructions}
</p>
{/if}
{#if currentTask.examples}
<p class="mt-2 text-sm">
{currentTask.examples}
</p>
<div class="flex gap-2 mt-4">
<button class="btn flex-grow" onclick={cancelTask}>
🔙 {$t('button.cancel')}
</button>
<button class="btn btn-primary flex-grow" onclick={finishTask}>
✔️ {$t('tasks.achieveTask')}
</button>
</div>
{/if}
{:else}
{#if currentTask.learnerInstructions}
<p>
{currentTask.learnerInstructions}
</p>
{/if}
<div class="flex gap-2 mt-4">
<button class="btn flex-grow" onclick={cancelTask}>
🔙 {$t('button.cancel')}
</button>
<button class="btn btn-primary flex-grow" onclick={finishTask}>
✔️ {$t('tasks.achieveTask')}
</button>
</div>
{:else if currentTask.learnerInstructions}
<p>
{currentTask.learnerInstructions}
</p>
{/if}
{/if}
</div>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter