Install project dependencies:
npm install
Create a local environment file by copying the example:
cp .env.local.example .env.local
Start the application in development mode:
npm run dev
Useful for viewing and debugging UI components:
# Start Storybook with documentation only
npm run sb:dev:docs
# Start Storybook with documentation and stories
npm run sb:dev
# Build Storybook for deployment
npm run sb:build
# Preview the built Storybook app
npm run sb:preview
Run linting checks to maintain code quality:
# Show style errors and warnings
npm run lint
# Automatically fix style issues
npm run lint:fix
# Run linter in CI mode (fails on warnings and errors)
npm run lint:ci
Run automated unit tests:
npm run test:unit
Prepare the app for production:
# Create the production environment file
cp .env.example .env
# Replace environment placeholders with actual values
sed -i "s|{{DOMAIN}}|$FE_URL|g" .env # Set VITE_DOMAIN
sed -i "s|{{API_DOMAIN}}|$API_URL|g" .env # Set VITE_API_DOMAIN
# Build the app
npm run build
# Copy the built files to the deployment directory
cp -r dist/. $DEPLOY_PATH
Start the built app from the /dist
directory:
npm run preview
Keep the Browserslist DB up to date:
npx browserslist@latest --update-db