Skip to content

Deployment Guide

Dae Houlihan edited this page Nov 11, 2024 · 2 revisions

Deployment Guide

Warning

This section is under construction. Some of this information is out of date with the latest release of the template. Use with caution.

This guide covers deploying your experiment to Firebase Hosting.

Release Process

The template includes a release script that automates deployment:

yarn release

What the Release Script Does

  1. Prompts for version increment
  2. Creates git commit
  3. Injects version and git hash
  4. Builds the project
  5. Deploys to Firebase

Manual Deployment Steps

If you prefer to deploy manually:

  1. Build the project:
yarn build
  1. Deploy to Firebase:
yarn deploy

Version Control

Git Workflow

  1. Create feature branch:
git checkout -b feature/my-feature
  1. Make changes and commit:
git add .
git commit -m "Description of changes"
  1. Push changes:
git push origin feature/my-feature
  1. Create pull request and merge

Pre-deployment Checklist

Code Quality

  • Run yarn lint to check formatting
  • Run TypeScript compiler
  • Remove any console.log statements
  • Check for unused imports

Firebase Configuration

  • Update Firestore rules if needed
  • Verify Authentication settings
  • Check Firebase quotas and limits

Testing

  • Test with production Firebase config
  • Verify data storage
  • Test Prolific integration
  • Cross-browser testing

Deployment Verification

After deploying:

  1. Visit your Firebase-hosted URL
  2. Complete test run of experiment
  3. Verify data in Firestore
  4. Check browser console for errors
  5. Test Prolific integration

Monitoring

Firebase Console

Monitor your deployment in Firebase Console:

  • Hosting tab for deployment status
  • Authentication tab for user activity
  • Firestore tab for database operations

Analytics

If enabled, check Google Analytics for:

  • User engagement
  • Error rates
  • Performance metrics

Troubleshooting

Common Deployment Issues

  1. Build Failures

    • Check build output
    • Verify dependencies
    • Check TypeScript errors
  2. Firebase Errors

    • Verify Firebase CLI login
    • Check project permissions
    • Validate firebase.json
  3. Data Storage Issues

    • Check Firestore rules
    • Verify authentication flow
    • Check database permissions

Rollback Process

If needed, rollback to previous version:

  1. Find previous deployment in Firebase Console
  2. Click "Rollback"
  3. Verify rollback success

Next Steps