Skip to main content

Deployment

Kuviq is deployed to Firebase Hosting with automatic deployments on successful CI builds.

Automatic Deployment

When you push to main or master and all CI checks pass:

  1. Version is automatically updated (npm run version:date)
  2. Application is built for production
  3. Deployed to Firebase Hosting
  4. Version commit is pushed back to the repository

Manual Deployment

Full Deployment (App + Docs)

npm run deploy

App Only

npm run deploy:app

Documentation Only

npm run docs:build
npm run deploy:docs

Firebase Configuration

Hosting Targets

The project uses two Firebase Hosting sites:

TargetSiteURL
appae-inspectorhttps://app.kuviq.io
docsae-inspector-docshttps://docs.kuviq.io

Firebase Services Used

  • Hosting: Static web hosting for app and docs
  • Firestore: NoSQL database
  • Authentication: User authentication (email/password, Google)
  • Storage: File storage for images and documents
  • Functions: Serverless backend functions

Environment Configuration

Required Environment Variables

The application requires Firebase configuration environment variables to be set during the build process. Vite bundles these variables at build time, so they must be available when running npm run build.

Required variables:

  • VITE_FIREBASE_API_KEY - Firebase Web API Key
  • VITE_FIREBASE_AUTH_DOMAIN - Firebase Auth Domain (e.g., project-id.firebaseapp.com)
  • VITE_FIREBASE_PROJECT_ID - Firebase Project ID
  • VITE_FIREBASE_STORAGE_BUCKET - Firebase Storage Bucket (e.g., project-id.appspot.com)
  • VITE_FIREBASE_MESSAGING_SENDER_ID - Firebase Messaging Sender ID
  • VITE_FIREBASE_APP_ID - Firebase App ID
  • VITE_FIREBASE_MEASUREMENT_ID - Google Analytics Measurement ID (optional)

Development

For local development, create a .env file in the project root:

VITE_FIREBASE_API_KEY=your-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
VITE_FIREBASE_APP_ID=1:123456789:web:abcdef123456
VITE_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX

You can also use Firebase Emulator Suite for local development:

npm run emulators

Production / CI/CD

For automated deployments via GitHub Actions, configure the following secrets in your GitHub repository:

  1. Go to your repository Settings → Secrets and variables → Actions
  2. Add the following repository secrets:
    • VITE_FIREBASE_API_KEY
    • VITE_FIREBASE_AUTH_DOMAIN
    • VITE_FIREBASE_PROJECT_ID
    • VITE_FIREBASE_STORAGE_BUCKET
    • VITE_FIREBASE_MESSAGING_SENDER_ID
    • VITE_FIREBASE_APP_ID
    • VITE_FIREBASE_MEASUREMENT_ID

Important: Without these secrets configured, the build will fail with a clear error message. The application will not deploy with placeholder/invalid Firebase configuration.

Getting Firebase Configuration Values

  1. Go to Firebase Console
  2. Select your project
  3. Go to Project Settings (gear icon)
  4. Scroll down to "Your apps" section
  5. Select your web app or create a new one
  6. Copy the configuration values from the firebaseConfig object

Version Management

Version is stored in package.json and follows the format:

DD.MM.YYYY-buildNumber

Example: 27.11.2025-348

Manual Version Update

# Update to current date
npm run version:date

# Semantic versioning
npm run version:major
npm run version:minor
npm run version:patch

Rollback

To rollback to a previous deployment:

  1. Go to Firebase Console
  2. Select the project
  3. Go to Hosting
  4. Click "Release history"
  5. Select a previous release and click "Rollback"

Pre-deployment Checklist

Before deploying manually:

  • All tests pass (npm run test:ci)
  • TypeScript compiles (npm run typecheck)
  • ESLint passes (npm run lint)
  • Firebase environment variables are set (see Environment Configuration above)
  • Build succeeds (npm run build)
  • Test locally with npm run preview

Note: The build script will validate Firebase configuration and fail early if required environment variables are missing or invalid.