Prerequisites
Before setting up the project locally, ensure you have the following installed:- Node.js v24 (required by Cloud Functions)
- npm (comes with Node.js)
- Firebase CLI (
npm install -g firebase-tools) - Git for version control
Getting Started
Install Root Dependencies
Install the dependencies for the main project (Tailwind CSS and utilities):This will install:
tailwindcss@^4.1.18- CSS framework@tailwindcss/cli@^4.1.18- Tailwind CLIdotenv@^17.2.3- Environment variable management
Install Cloud Functions Dependencies
Navigate to the functions directory and install dependencies:This installs all Cloud Functions dependencies including:
firebase-admin@^13.7.0- Firebase Admin SDKfirebase-functions@^7.0.6- Cloud Functions SDKmercadopago@^2.12.0- MercadoPago integrationnodemailer@^7.0.13- Email notificationsaxios@^1.13.4- HTTP client- And other payment gateway integrations
Configure Environment Variables
Create a
.env file in the functions/ directory with the following variables:functions/.env
Start the Development Server
Run the Tailwind CSS build process in watch mode:This command watches for changes in
./src/input.css and compiles to ./public/css/styles.css.Start Firebase Emulators
In a separate terminal, start the Firebase emulators for local testing:This will start the following emulators:
- Authentication:
localhost:9099 - Firestore:
localhost:8080 - Cloud Functions:
localhost:5001 - Hosting:
localhost:5000 - Emulator UI: Available with detailed logs and data inspection
The emulator ports are configured in
firebase.json. You can access the Emulator UI to view and manage your local Firebase data.Development Workflow
Tailwind CSS Compilation
The project uses Tailwind CSS v4 with the following configuration:tailwind.config.js
src/input.css to public/css/styles.css automatically when running npm run dev.
Testing Cloud Functions Locally
To test individual Cloud Functions:Viewing Function Logs
View Cloud Functions logs during development:Troubleshooting
Port already in use
Port already in use
If you see a port conflict error, you can:
- Stop the process using that port
- Change the port in
firebase.jsonunder theemulatorssection
Node version mismatch
Node version mismatch
Cloud Functions require Node.js v24. Check your version:Use
nvm (Node Version Manager) to switch versions if needed:Tailwind not compiling
Tailwind not compiling
Ensure you’re running
npm run dev in the root directory and that the input file exists at src/input.css.Firebase emulators not starting
Firebase emulators not starting
Make sure you’re logged in to Firebase CLI:And that you’ve selected the correct project:
Next Steps
Firebase Setup
Configure your Firebase project and services
Deployment
Learn how to deploy to production