This guide shows you how to set up Firebase Firestore for development.
The project uses Firebase Firestore because it:
hiking-logbook-dev
backend/
folder (keep it secret!)Create backend/.env
file:
PORT=3001
NODE_ENV=development
# Copy these from your downloaded JSON file
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_PRIVATE_KEY_ID=your_private_key_id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
FIREBASE_CLIENT_EMAIL=firebase-adminsdk-xxxxx@your_project.iam.gserviceaccount.com
FIREBASE_CLIENT_ID=your_client_id
Create frontend/.env
file:
# Get these from Firebase Console → Project Settings → General
REACT_APP_FIREBASE_API_KEY=your_api_key
REACT_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
REACT_APP_FIREBASE_PROJECT_ID=your_project_id
REACT_APP_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
REACT_APP_FIREBASE_APP_ID=your_app_id
Test the connection:
# Start backend
cd backend
npm start
# You should see: "Firebase initialized successfully"
Problem: “Permission denied” errors
Problem: “Project not found”
Problem: Frontend can’t authenticate
For detailed database schema and structure, see database documentation
The app will create collections automatically when you start using it.