Getting Started
This guide will walk you through the process of setting up your first Fireact application.
Prerequisites
Before you begin, ensure you have the following installed and configured:
- Node.js (version 22 or higher): Fireact.dev uses Node.js for its development environment and Cloud Functions.
- You can download it from nodejs.org.
- Verify your installation:
node -v
- npm (Node Package Manager): npm is installed automatically with Node.js.
- Verify your installation:
npm -v
- Verify your installation:
- Firebase CLI: The Firebase Command Line Interface is essential for interacting with your Firebase project, deploying functions, and running emulators.
- Install it globally:
npm install -g firebase-tools - Log in to Firebase:
firebase login
- Install it globally:
- Stripe CLI: If you plan to use Stripe for subscriptions, the Stripe CLI is necessary for testing webhooks locally.
- Follow the installation instructions on the Stripe documentation.
- Log in to Stripe CLI:
stripe login
- Firebase Project: You need an existing Firebase project.
- Create one at Firebase Console.
- Ensure you have at least one Web App configured within your Firebase project. Fireact.dev will fetch the SDK configuration for this web app during setup.
Creating a New Fireact Application
To create a new Fireact application, use the create-fireact-app CLI tool. This tool will guide you through the setup process, including Firebase and Stripe configurations.
Install the CLI (if you haven’t already):
npm install -g create-fireact-appCreate a new project:
create-fireact-app <your-project-name>Replace
<your-project-name>with the desired name for your new application.Follow the prompts: The CLI will guide you through selecting your Firebase project and configuring Stripe.
After Creation: Running Your Application
Once the create-fireact-app command completes, follow these steps to run your new Fireact application locally:
Navigate to your project directory:
cd <your-project-name>Build Cloud Functions:
cd functions && npm run buildThis compiles your Firebase Cloud Functions from TypeScript to JavaScript.
Build the React Application:
cd .. && npm run buildThis builds the React frontend application.
Start Firebase Emulators:
firebase emulators:startThis command starts the Firebase emulators for Authentication, Firestore, and Cloud Functions. Your frontend application will also be served on
http://localhost:5002.Set up Stripe Webhook (in a separate terminal): If you are using Stripe, you need to forward Stripe events to your local Cloud Functions emulator. Open a new terminal and run:
stripe listen --forward-to http://127.0.0.1:5001/<your-firebase-project-id>/us-central1/stripeWebhookReplace
<your-firebase-project-id>with your actual Firebase project ID.Update Stripe Webhook Secret: The
stripe listencommand will output a new webhook endpoint secret (e.g.,whsec_...). You must copy this secret and update it in your functions configuration:- Open
functions/src/config/stripe.config.jsonin your project. - Replace the existing
endpointSecretvalue with the new one.
- Open
Rebuild Cloud Functions (after updating secret):
cd functions && npm run buildThis ensures your Cloud Functions use the updated Stripe webhook secret.
Access your application: Your Fireact application will be available in your browser at
http://localhost:5002.
Next Steps: Customizing Your SaaS Application
The create-fireact-app CLI provides a solid foundation with essential SaaS functionalities like authentication, user management, and subscription handling. However, the generated application is a starting point. To build the specific features and unique user experience for your SaaS product, you will need to engage in custom development.
The Custom Development section of this documentation provides comprehensive guides on how to:
- Develop your own React components and pages.
- Understand and manage data fetching within the framework.
- Implement and extend localization capabilities.
- Configure routing and enforce permission control.
By leveraging the information in the Custom Development section, you can effectively extend the Fireact.dev framework to build the unique features of your SaaS application.
Troubleshooting
Common Setup Issues
CLI Command Not Found
If create-fireact-app is not recognized after installation:
# Check global npm path
npm config get prefix
# Use npx instead (no installation needed)
npx create-fireact-app my-app
Firebase Login Issues
If firebase login fails or hangs:
# Try CI mode (opens browser authentication)
firebase login --no-localhost
# Or clear cache and retry
rm -rf ~/.config/firebase
firebase login
Node.js Version Error
Fireact.dev requires Node.js v18 or higher:
# Check your version
node -v
# Upgrade using nvm (recommended)
nvm install 18
nvm use 18
Build and Emulator Issues
Emulators Won’t Start
If Firebase emulators fail to start:
Check port availability:
# Common ports used by emulators lsof -i :5173 # Vite dev server lsof -i :9099 # Auth emulator lsof -i :8080 # Firestore emulator lsof -i :5001 # Functions emulator lsof -i :5002 # Hosting emulatorEnsure functions are built:
cd functions npm run build cd ..Check Java installation (required for Firestore emulator):
java -version # Install Java if missing
Build Errors
If you encounter build errors:
# Clean and rebuild
rm -rf node_modules dist
npm install
npm run build
# For functions
cd functions
rm -rf node_modules lib
npm install
npm run build
cd ..
Stripe Integration Issues
Webhook Secret Mismatch
If Stripe webhooks fail with signature verification errors:
Get new webhook secret from Stripe CLI:
stripe listen --forward-to http://127.0.0.1:5001/YOUR_PROJECT_ID/us-central1/stripeWebhookCopy the webhook signing secret (starts with
whsec_)Update
functions/src/config/stripe.config.json:{ "endpointSecret": "whsec_YOUR_NEW_SECRET_HERE" }Rebuild functions:
cd functions && npm run build && cd ..Restart emulators
Test Card Not Working
Use these Stripe test card numbers:
- Success:
4242 4242 4242 4242 - Requires Authentication:
4000 0025 0000 3155 - Declined:
4000 0000 0000 9995
For all test cards:
- Expiry: Any future date
- CVC: Any 3 digits
- ZIP: Any valid ZIP code
Authentication Issues
User Not Redirected After Sign-In
If the user is stuck on the sign-in page after authentication:
- Clear browser cache (Cmd+Shift+R or Ctrl+Shift+R)
- Check browser console for errors
- Verify routing configuration in your app
- Ensure emulators are running
Password Reset Email Not Received
In emulator mode:
- Emails are not sent
- Check the Auth emulator UI at http://localhost:4000
- Look for reset links in the Auth tab
In production:
- Check spam folder
- Verify email templates in Firebase Console
- Check email quota limits
Firestore Issues
Permission Denied Errors
If you see “Permission denied” errors when accessing Firestore:
- In emulator mode: Check
firestore.rulesfile - Restart emulators after rule changes
- Verify user is authenticated
- Check Firestore rules in Firebase Console (production)
Data Not Appearing
If data doesn’t appear in your application:
- Check Firestore emulator UI: http://localhost:4000
- Verify collection and document names
- Check query filters and where clauses
- Look for errors in browser console
Getting Help
If you’re still experiencing issues:
Check the comprehensive troubleshooting guide: Troubleshooting Documentation
Search existing issues: GitHub Issues
Ask the community: GitHub Discussions
Report a bug: Create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Your environment (OS, Node version, browser)
- Error messages and logs
Quick Reference
# Common commands
create-fireact-app my-app # Create new app
firebase emulators:start # Start emulators
firebase emulators:start --export-on-exit # Save data on exit
stripe listen --forward-to ... # Start Stripe webhooks
npm run build # Build React app
cd functions && npm run build # Build functions
# Troubleshooting commands
firebase --version # Check Firebase CLI version
node --version # Check Node version
npm cache clean --force # Clear npm cache
rm -rf node_modules # Remove dependencies
git submodule update --init # Initialize submodules
What’s Next?
Congratulations! You now have a working Fireact.dev application. Here’s your recommended learning path:
1. Build Your First Feature (Recommended)
Start with the Building Your First Custom Feature tutorial. This hands-on guide walks you through creating a complete feature from scratch, including:
- Frontend components with React and TailwindCSS
- Cloud Functions for backend logic
- Firestore database integration
- User permissions and access control
Time: ~45 minutes | Difficulty: Beginner
2. Customize the Look and Feel
Follow Customizing the UI Theme to brand your application:
- Configure TailwindCSS colors and fonts
- Implement dark mode
- Create custom components
- Apply your brand identity
Time: ~30 minutes | Difficulty: Beginner
3. Explore Code Examples
Browse the Examples section for ready-to-use code snippets:
- Authentication Examples - Social login, email verification
- Data Management Examples - CRUD operations, pagination
- UI Components Examples - Forms, modals, tables
- Subscription Examples - Payment flows, billing
4. Advanced Topics
Once comfortable with the basics, explore advanced tutorials:
- Custom Subscription Plans - Implement tiered pricing, usage-based billing, and add-ons
- Third-Party Integrations - Integrate SendGrid, Google Analytics, external APIs
5. Learn Custom Development Patterns
Deep dive into Custom Development to understand:
- Application architecture and routing
- Data fetching patterns
- Localization and i18n
- Permission control systems
6. Production Readiness
Before deploying to production, review:
- Best Practices - Code organization, performance, error handling, testing
- Security Guide - Authentication, authorization, data protection
- Deployment Guide - Deploy to Firebase, Vercel, AWS, or Docker
Additional Resources
- API Reference - Complete documentation of all components and hooks
- Functions Reference - Cloud Functions API documentation
- Architecture Overview - System design and architecture
- Contributing Guide - Contribute to Fireact.dev
- GitHub Discussions - Ask questions and share ideas
Quick Tips for Success
- Start Small: Begin with simple features before tackling complex ones
- Use Examples: Copy and adapt code from the Examples section
- Test Locally: Always test with emulators before deploying
- Read Error Messages: Firebase and React provide helpful error messages
- Check the Console: Browser developer console shows runtime errors
- Version Control: Commit your changes frequently
- Join the Community: Don’t hesitate to ask questions in GitHub Discussions
Happy building! 🚀
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.