Skip to main content

Firebase Project README

This README provides instructions for local development and deployment of the Firebase project.

Firebase Workflow

There is only one Firebase project you need to work with: Overlevered. On Firebase the project ID is flashcards-b2cb7. You can run local emulators using this project ID or you can use the firebase use command to switch to the project ID. Our firebase config has another project local-over-levered which is used for local development.

Local Development

To start local development, follow these steps:

  1. Clone the repository: git clone <repository-url>
  2. Install dependencies: npm install
  3. Build the JS files: npm run build
  4. Run the project locally: npm run serve
  5. Run the stripe cli to receive webhook events: npm run stripe:listen

Making changes

Currently, every time you make a change to the index.ts functions file you need to rebuild and restart the server.

Deployment

To deploy the project to Firebase, use the following commands:

  1. Change into the functions directory: cd functions
  2. Build the project: npm run build
  3. Set the correct env vars for production in the functions/.env file
  4. Deploy to Firebase: firebase deploy

That's it! You're now ready to develop and deploy your Firebase project.