This repository is used for the respondent web app of the Curious application stack.
- Curious Admin - GitHub Repo
- Curious Backend - GitHub Repo
- Curious Mobile App - GitHub Repo
- Curious Web App - This Repo
Running the app:
-
NodeJS
20.11.0or higher, recommend usingasdfornvmto manage local node versionTo install:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bashAfter installation, add the following lines to your shell profile (~/.zshrc, ~/.bashrc, or ~/.bash_profile):
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Then restart your terminal.
When nvm is installed, it is placed in ~/.nvm but not automatically available in your terminal. These lines ensure nvm is loaded in every shell session, so commands like nvm use and nvm install work properly.
-
Yarn 1.x
-
Backend project running locally or accessible in a test environment
- If running locally, ensure that
http://localhost:5173has been added to the BE'sCORS__ALLOW_ORIGINSenvironment variable
- If running locally, ensure that
-
Configured environment variables:
cp .env.example .env
- Install dependencies using
yarn - Run the project using
yarn dev(see scripts) - Open http://localhost:5173 in a browser to view the web app
See Curious's Knowledge Base article to discover the Curious application stack's features.
- Typescript - TypeScript is JavaScript with syntax for types
- React - A JavaScript library for building user interfaces
- Vite - Next-generation frontend bundling tool
- Redux Toolkit - Global state manager for JavaScript applications
- Material UI - Library of React UI components
- React-query - Powerful asynchronous state management
- Feature-Sliced Design - Architectural methodology
In the project directory, you can run:
-
yarn devRuns the app in the development mode.
Open http://localhost:5173 to view it in the browser.The page will reload if you make edits.
You will also see any lint errors in the console. -
yarn buildBuilds the app for production to the
distfolder.
It correctly bundles React in production mode and optimizes the build for the best performance.Your app is ready to be deployed!
See the section Building for Production for more information.
-
yarn previewOnce you've built the app, use this command to test it locally.
It will boot up a local static web server that serves the files fromdistat http://localhost:4173.
See the documentation on Vitest for more information about running tests.
yarn test:watch- Launches the test runner in the interactive watch mode.yarn test- Runs test suite onceyarn test:ui- Run the Vitest UI at http://localhost:51204/__vitest__/yarn coverage- Generate test coverage report
yarn lint:check- Check that source code follows eslint rulesyarn lint:fix- Automatically fix problems detected by eslintyarn prettier:check- Check that source code follows prettier rulesyarn prettier:fix- Automatically fix problems detected by prettier
| Key | Required | Default value | Description |
|---|---|---|---|
NODE_ENV |
yes | development |
Node environment (development or production) |
VITE_ENV |
yes | dev |
Server environment (dev, stage, or prod) |
VITE_API_HOST |
yes | http://localhost:8000/ |
Curious Backend API base URL |
VITE_ADMIN_PANEL_HOST |
no | http://localhost:3000/ |
Curious Admin URL |
VITE_SECURE_LOCAL_STORAGE_HASH_KEY |
yes | ML_SECURE |
Secure local storage hash key |
VITE_SECURE_LOCAL_STORAGE_PREFIX |
yes | ML_SECURE |
Secure local storage prefix |
VITE_IV_LENGTH |
yes | 16 |
Encryption initialization vector length |
VITE_BUILD_VERSION |
yes | dev-build |
Build version |
VITE_MIXPANEL_TOKEN |
yes | null | Mixpanel client ID, refer to Confluence for correct environment key |
VITE_LAUNCHDARKLY_CLIENT_ID |
yes | null | LaunchDarkly client ID, refer to Confluence for correct environment key |
VITE_DD_APP_ID |
no | "" | DataDog RUM App ID |
VITE_DD_CLIENT_TOKEN |
no | "" | DataDog RUM Client token |
VITE_DD_VERSION |
no | local | Current admin panel version |
VITE_DD_TRACING_URLS |
no | "" | Comma separated URL prefixes that Datadog is allowed to trace. |
Common Public Attribution License Version 1.0 (CPAL-1.0)
Refer to LICENSE.md