• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
  • Auth Overview
  • Global Configuration
    • Setting up your Firebase Project
    • Setting up Firebase Functions
  • Writing data to Firestore
  • Commands
  • Introduction
  • Production Checklist
  • Introduction
  • Overview
  • Stripe Configuration
  • Running Tests
  • Introduction
  • Setting up Firebase Auth
  • Fetching data from Firestore
  • Technical Details
  • Extending Organizations
  • Stripe Webhooks
  • CI Tests
  • Initial Setup
  • React Hooks
  • Auth Flow
  • API requests
  • Code Style
  • Clone the repository
  • Security Rules
  • User Permissions
  • Limitations
  • Project Structure
  • Third-Party Providers
  • Reading data from Storage
  • Running the application
  • Subscription Permissions
  • One-Time Payments
  • Running the App
  • Email Link Authentication
  • Uploading data to Storage
  • Security Rules
  • Migrate to Lemon Squeezy
  • Project Configuration
  • Multi-Factor Authentication
  • Writing your own Fetch
  • Translations and Locales
  • Coding Conventions
  • Environment Variables
  • Architecture and Folder Structure
    • Structure your Application
    • Data Model
  • Requiring Email verification
  • Sending Emails
  • Tailwind CSS and Styling
  • Validating API payload with Zod
  • Authentication
  • Onboarding Flow
  • Logging
  • Development: adding custom features
  • Prevent abuse with AppCheck
  • Enable CORS
  • Encrypting Secrets
  • User Roles
  • Firestore: Data Fetching
  • Custom React Hooks
  • Custom React Hooks
  • Firestore: Data Writing
  • Troubleshooting
  • Forms
  • Application Pages
  • API Routes
  • API Routes Validation
  • Translations
  • Adding pages to the Marketing Site
  • Deploying to Production
  • Updating to the latest version
This kit is no longer maintained.

How to run a Remix and Firebase MakerKit application

Learn how to run a MakerKit application

After installing the modules and the emulators, we can finally run the application in development mode.

We need to execute two commands (and an optional one for Stripe):

  1. Remix Server: the first command is for running the Remix server
  2. Firebase Emulators: the second command is for running the Firebase emulators
  3. Stripe CLI: finally, the Stripe CLI is needed to dispatch webhooks to our local server (optional, only needed when interacting with Stripe)

About this Documentation

This documentation complements the Firebase one and is not meant to be a replacement. We recommend reading the Firebase documentation to get a better understanding of the Firebase concepts and how to use it.

Running the Firebase Emulators

First, let's run the emulators. The command below runs the emulators for the following products: Authentication, Firestore, and Storage.

bash
npm run firebase:emulators:start

Additionally, it imports the default emulator's data from the folder . /firebase-seed, which we set up upfront to run the Cypress tests.

After running the command above, you will be able to access the Firebase Emulators UI at http://localhost:4000.

Running the Remix Server

And now, the Remix server:

bash
npm run dev

If everything goes well, your server should be running at http://localhost:3000.

Running the Stripe CLI

Run the Stripe CLI with the following command:

bash
npm run stripe:listen

Add the Stripe Webhooks Key to your environment file

If this is the first time you run this command, you will need to copy the Webhooks key printed on the console and add it to your development environment variables file:

.env.development
STRIPE_WEBHOOKS_SECRET=<PASTE_KEY_HERE>

Saving the Firebase Emulator's data

After shutting the emulators down, the Firebase emulator clears all the records and the users added during the session while the emulators are running.

Fortunately, we can save and restore as many dumps as we want. For example, this can be useful for saving and loading particular scenarios for testing.

To save the current snapshot, run the following command while the emulators are up and running:

bash
npm run firebase:emulators:export

By default, MakerKit imports and exports to ./firebase-seed, but you can change this to any other path.

Always Save on exit

We don't particularly recommend this, but if you want to keep persisting data as you exit the emulators, you can decorate the firebase:emulators:start with the following options:

bash
firebase emulators:start --export-on-exit=./your-directory

Saving your emulators' state can be handy, but keep in mind that for testing reasons, it's always best to create a snapshot of your data and use the same one so that your tests won't break if the data changes.

Of course, change ./your-directory to your preferred path.

On this page
  1. About this Documentation
    1. Running the Firebase Emulators
    2. Running the Remix Server
    3. Running the Stripe CLI
  2. Saving the Firebase Emulator's data
    1. Always Save on exit