didmar / visible-thoughts-writer

Interface for Visible Thoughts dataset creation
https://visible-thoughts-writer.web.app/
MIT License
0 stars 0 forks source link

Visible Thoughts Writer

Setup

Firebase project

Create a project on Firebase and enable the following modules: Authentication, Firestore, Hosting and Functions.

Email notifications

For sending notification emails, the application needs an SMTP relay service such as SendGrid:

Algolia search

For search capabilities, the application uses Algolia:

Local setup

Rename src/firebase.creds.json.temp into src/firebase.creds.json and edit it with the credential from the Firebase project.

Rename src/conf.json.temp into src/conf.json and fill in the required info.

Connect to your Firebase project:

npm install -g firebase-tools
firebase login

Install project dependencies:

npm install

Using emulators (optional)

To make some local tests without interacting with the production environment, you can run emulators for all the Firebase services (except Hosting).

Optional: to have Cloud functions working, you need to set up the GOOGLE_APPLICATION_CREDENTIALS environment variable, see here. Otherwise, it will call the production environment.

Run the following command to start the emulators:

firebase emulators:start

Edit src/conf.json to set useEmulators to true, for the React app to use them.

Copy

Then, see below to run the React app either in development or production mode.

Run development version locally

npm run start to run the app in the development mode.\ Open http://localhost:3000 to view it in your browser.

To populate the database with random data:

npx tsx scripts/populate.ts

For unit testing, run npm run test.

Run production build locally

npm install -g serve
npm run build && serve -s build

Deploy to hosting service

npm run build && firebase deploy