To run the frontend at your local machine, install the following:
- pnPm: Fast, disk space efficient package manager.
To start, open a command prompt and follow these instructions:
Warning
In case if you're self-hosting, consider reading back-end setup instructions first.
pnpm i
Create .env
file in the frontend root directory with the following contents:
VITE_APP_NAME=$npm_package_name
VITE_APP_VERSION=$npm_package_version
VITE_API_URL="http://127.0.0.1:8000/"
VITE_SESSION_SECRET="9aCbXMa1%pJcCMubS^HuprJ5YjS&#xY5"
VITE_SECURE_COOKIES=
These settings are suitable for the most who want to run the app locally. Here's a more detailed and advanced explanation of each configuration option:
Option | Description | Type | Default | Required |
---|---|---|---|---|
VITE_APP_NAME |
The web app name. | string |
✓ | |
VITE_APP_VERSION |
The web app version. | string |
✓ | |
VITE_API_URL |
URL of the API server that the web app will interact with. You may also want to setup back-end to get it first. | string |
✓ | |
VITE_SESSION_SECRET |
Private key used to encrypt sessions. Must be at least 32 characters long. | string |
✓ | |
VITE_SECURE_COOKIES |
Determines whether the cookies sent to browser should be marked as secure. Make sure to enable this when have an SSL (HTTPS) certificate. | boolean |
false |
✗ |
Note
You can also browse all available configuration options here.
To build and start the app, just execute the following command:
pnpm serve
The setup is done. Enjoy using this! 🎉
Make sure VITE_SECURE_COOKIES
is not set to true
or you have a valid SSL (HTTPS) certificate.
VITE_SESSION_SECRET
Configuration option is not set. Make sure to re-read the step 2 and clear browser cookies.
Note
You may also need to re-build the web app using pnpm serve
or pnpm build
to include newly configured options in .env
.
Error
Seroval caught an error during the parsing process.
TypeError
Response.clone: Body has already been consumed.