Skip to content

Repository files navigation

shared-reality-chat

Server-less real-time dyadic chat app platform for psychology experiments.

Built for the Shared Reality hackathon group at 2023 MIND (https://github.com/hawkrobe/shared-reality). Original chat platform located here.

Tech Stack

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm (comes with Node.js)
  • A Firebase project (for database and hosting)

Setup

  1. Clone this repository:
git clone https://github.com/cosanlab/shared-reality-chat.git
cd shared-reality-chat
  1. Install dependencies:
npm install
  1. Create a .env file from the example:
cp .env.example .env
  1. Configure your environment variables in .env:

    • Firebase config (required): Get these from your Firebase Console under Project Settings > General > Your apps > Web app
    • LogRocket (optional): For session replay and debugging
    • Prolific completion code (optional): For participant recruitment platform integration

Development

Start the development server:

npm run dev

The app will be available at http://localhost:3000

Production Build

Build for production:

npm run build

Preview the production build locally:

npm run serve

Deployment

The app is configured for Firebase Hosting with GitHub Actions CI/CD:

  • Merges to main branch trigger automatic deployment
  • Pull requests get preview deployments

To deploy manually, install the Firebase CLI and run:

npm install -g firebase-tools
firebase login
firebase deploy

Configuration

Key configuration options in src/utils.js:

  • taskVersion - Version string for tracking experiment versions
  • matchType - Matching algorithm: "high", "low", or "random"
  • NO_CHAT - Set to true for no-chat vignette version
  • DEBUG_MODE - Set to true to use separate dev collections in Firestore

About

Server-less real-time dyadic chat platform

Topics

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages