Website for Centor
====

---

# Project setup

```shell
git clone -b develop git@gitlab.km2.de:clients/centor.git <target-directory>
```

This project requires composer to authenticate against our Gitlab in order to install the house extension.
The authentication can be configured as followed:

1. Create new token a https://gitlab.km2.de/-/profile/personal_access_tokens with scopes `read_api` and `read_repository`
2. Configure access token for composer with `ddev composer config gitlab-token.gitlab.km2.de 'YOUR_TOKEN'`
3. Configure access for news administration module with `ddev composer config github-oauth.github.com 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`

The whole system can be setup with the following commands:

```shell
ddev start
ddev setup
```

## Fetching data for relaunch

```shell
ddev fetch all
```

## Starting Frontend Environment

### Without hot module replacement

Running the project without hmr, just build the files with

```
ddev pnpm build
```

and make sure vite server is not enabled by `USE_VITE_SERVER=1` in your `.env` file.

### With hot module replacement

This project supports hot module replacement for frontend development.
To enable hmr, create a file `.env` in project root with the content
```
USE_VITE_SERVER="1"
```

To start the vite server, run

```shell
ddev vite-serve
```

The server needs to be started after every ddev start/restat.


## Updating project

To update the project to the lastest code base, the following commands can be used:

```shell
git pull --rebase
ddev build
```

## Disabling frontend cache for development

To disable TYPO3 frontend caches in order to improve development experience, the following steps needs to be done

1. Create new file `.env` on project level
2. Add `DISABLE_FRONTEND_CACHES="1"` to the file `.env`


## Project configurations

### Tailwind

To update or check Tailwind CSS, follow the docs at: https://tailwindcss.com/docs

