- node needs to be installed. See nvmrc or the
engines
definition in package.json for version. - Coral uses pnpm (version 8) as a package manager. Read their official documentation how to install pnpm.
Step by step
- navigate to
/coral
- run
pnpm install
- run
pnpm add-precommit
the first time you install the repository to set the custom directory for our pre commit hooks. - Run development:
4.1. If you have not set up a remote API mode, please follow First setup
4.2. If you already have a setup, run
pnpm dev
- Create new Vite mode for remote API development
- When your API runs on
https
: Set up self-signed certificate
Start by creating a new Vite mode called .env.remote-api
. The easiest
way is to create one is to run the commend below. Note, that you need to replace the [KLAW API ORIGIN]
placeholder value with your Klaw API server origin.
cat << EOF > .env.remote-api
NODE_ENV=development
VITE_PROXY_TARGET=[KLAW API ORIGIN]
VITE_API_BASE_URL=https://localhost:5173/api
VITE_SERVER_CERTIFICATE_PATH=".cert/localhost.crt"
VITE_SERVER_CERTIFICATE_KEY_PATH=".cert/localhost.key"
EOF
You can use Let's Encrypt instructions for setting up self-signed certificates for local development.
openssl req -x509 -out .cert/localhost.crt -keyout .cert/localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost,IP:127.0.0.1\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
Install .cert/localhost.crt
in your list of locally trusted roots. This is different dependent on your OS, you can look up a current way to do this online. Keep in mind that dependent on your OS and browser, you may have to refresh that certificate from time to time.
If all requirements are met, and you've done your first setup:
pnpm run dev
- login to Klaw with your credentials on
<YOUR_LOCALHOST>:5173/login