Full-stack starter using React, Tailwind CSS, Node.js, and Express.
npm run install:all
npm run dev- Frontend: http://localhost:5173
- API health check: http://localhost:5001/api/health
Complete frontend/.env and backend/.env, then run:
npm run docker:up- Storefront: http://localhost:8080
- API health check: http://localhost:5001/api/health
Stop and remove the containers:
npm run docker:downThe frontend is built with Vite and served by Nginx. Nginx proxies /api
requests to the private Compose backend service. Firebase's public web config
is compiled into the frontend bundle, while Firebase Admin credentials are
supplied only to the backend container through backend/.env.
- Create a Firebase project and a Web app in the Firebase console.
- Enable Authentication → Sign-in method → Email/Password.
- Create a Firestore database.
- Enable Storage in the Firebase console for seller product media.
- Copy
frontend/.env.exampletofrontend/.envand add the Web app config. - In Project settings → Service accounts, generate a private key.
- Copy
backend/.env.exampletobackend/.envand add the service-account values. - Set
FIREBASE_STORAGE_BUCKETinbackend/.envto your Storage bucket name, for exampleyour-project-id.appspot.comor the bucket shown in Storage → Files.
Keep the private key in backend/.env; never expose it through a VITE_ variable.
Authentication routes:
POST /api/auth/profilecreates the signed-in user's Firestore profile.GET /api/auth/mereturns the signed-in user's profile.
Both routes require Authorization: Bearer <Firebase ID token>.
During development, the API accepts localhost frontend origins on any port so
Vite can fall back from 5173 when that port is already occupied. In production,
only origins listed in CLIENT_URL are accepted.
The storefront loads products from GET /api/products. Product documents live
in the Firestore products collection rather than inside the React page.