Commit 2e82afbd authored by Marek Veselý's avatar Marek Veselý
Browse files

Merge branch 'main' into '293-change-highlighting-of-unread-emails'

# Conflicts:
#   CHANGELOG.md
parents 69d280b9 7d560756
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
2024-05-07 - improve new email highlighting
2024-05-07 - add exercise name, rework exercise panel add dialogs
2024-05-07 - add learning objectives page to the instructor view
2024-05-07 - change the tab icon to the INJECT logo
2024-05-03 - improve Codegen pipeline and separate it from the codebase
2024-04-21 - improvements to the login UI, onboarding UI, added support for disabling AAI

INSTALLATION.md

0 → 100644
+21 −0
Original line number Diff line number Diff line
### Docker deployment

The repository has a prepared Dockerfile so you can build the image: 

```
docker build . -t inject-fe
```

Run the following command to deploy the docker container:

```
docker run -p 80:80 inject-fe
```

During runtime of the container it's required to bind the container to a given `backend` instance:

```
docker run -p 80:80 -e VITE_HTTP_HOST=secure-be.inject.muni.cz -e VITE_HTTP_WS=wss://secure-be.inject.muni.cz/ttxbackend/v1/graphql inject-fe
```

Please keep in mind that changing environment variables requires restarting the container if done during runtime.
 No newline at end of file
+32 −33
Original line number Diff line number Diff line
@@ -12,8 +12,7 @@ Subrepos:

## How to run

Install Node 20 LTS, Yarn, Python 3.8

To ensure the frontend application functions properly, it's necessary to have a backend instance up and running. Follow these steps to run the backend application:
```
# https://stackoverflow.com/questions/16773642/pull-git-submodules-after-cloning-project-from-github
git submodule update --init
@@ -24,22 +23,44 @@ poetry install
poetry run python manage.py migrate
poetry run python manage.py createcachetable
cd ..
```

yarn
# run backend server on a known address, set it appopriately in src/config.ts and also in Backend KNOWN_HOSTS
# first run backend in different pane
poetry run python manage.py runserver
After ensuring that the backend is properly configured and running, proceed with the installation steps for frontend outlined in [INSTALLATION.md](INSTALLATION.md).

To run the frontend, you have two options, each with its own set of requirements. The first method utilizes [yarn](#running-with-yarn) and is mostly used for development setup, while the second employs [Docker](INSTALLATION.md).

## Running with yarn

To run the frontend application using yarn, ensure you have the following prerequisites:

* [Node 20 LTS](https://nodejs.org/en)
* [Yarn](https://yarnpkg.com/)

Further make sure that the backend server is running. Make sure to set its address in `src/config.ts` and also in the backend's `KNOWN_HOSTS`.

Once you have these installed and everything configured, follow these steps:

# then after running backend, run frontend dev
First run the following command to install project dependencies:
```
yarn
```
Then run the frontend development server:
```
yarn dev
# if on windows, make sure that Git is installed and run on GitBash
```
If you're on Windows, ensure that Git is installed and run the command in GitBash:
```
GIT_ENABLED=1 yarn dev
```

# if building
If you want to build the app for deployment, then follow these steps.

# this step is mandatory, it compiles `graphql` and `shared` library
Compile the graphql and shared library:
```
yarn prebuild
# this builds the `dist/` artifact from `frontend` repo.
```
Then build the `dist/` artifact from the frontend repository:
```
yarn build
```

@@ -56,28 +77,6 @@ This tool needs to be executed every time when it's expected that there are chan
3. If headers change (signifying new behaviour), please revalidate if application works and fix it
4. Done, don't forget to mark your MR with [x] that the MR is tested with new backend

## Docker deployment

Repository has a prepared Dockerfile which can be compiled accordingly. 

```
docker build . -t inject-fe
```

To deploy the docker container, you only need to execute:

```
docker run -p 80:80 inject-fe
```

During runtime of the container it's required to bind the container to a given `backend` instance. This can be done accordingly

```
docker run -p 80:80 -e VITE_HTTP_HOST=secure-be.inject.muni.cz -e VITE_HTTP_WS=wss://secure-be.inject.muni.cz/ttxbackend/v1/graphql inject-fe
```

Please mind, that changing environment variables requires restart of the container if done during the runtime.

## How to test the Monorepo

Run `yarn test`, the tests should take no more than a minute now.
Compare 116b70b4 to caf6b1c1
Original line number Diff line number Diff line
Subproject commit 116b70b4ac5c450e7d62af41244fb47e672d5630
Subproject commit caf6b1c1038b43f45124e4a9220e63d822a8e900
+1 −0
Original line number Diff line number Diff line
fragment Exercise on ExerciseType {
  id
  name
  running
  finished
  exerciseStart
Loading