This is the frontend for Unrated, an application created in the context of the subject DAT251 at HVL (Western Norway University of Applied Sciences)
The frontend is created using SvelteKit, and has partial test coverage using Cypress
Environment variables can be set in a .env
file. See .env-example
for an example on the of the file. These are the different variables that can be set:
PUBLIC_BACKEND_BASE_URL: The URL that the backend is running on
PUBLIC_IMAGE_BASE_URL: The URL where images are hosted
PUBLIC_FLAGSMITH: The SDK enviroment varible to flagsmith
ORIGIN: The URL that this application can be accessed by
VITE_ADAPTER: Tells what adapter to use. Possible "node" and "static". Defaults to "node".
VITE_MSW: "true" if it should build with a mocked backend.
The project uses Flagsmith for feature flags. The possible feature flags are:
logo_change: When enabled, a different logo is used
whiskey_spelling: Changes the spelling of the whiksey to the set value
To run the application as a Node.js project, you need to build the application:
npm install
npm run build
node -r dotenv/config build
The last line will ensure that the environment variables in .env
get added.
To create a mobile application, you can use cypress. It currently only tested for android. Before building anything, the build types needs to be added. This only needs to be done once.
npx cap add android
To run it:
npm install
npm run build:static
npx cap sync
npx capacitor-assets generate
npx cap open android
The last line will open android studio.