EcomCraft is a full-stack e-commerce boilerplate. Get a head start on your online shop with a reliable, dockerized foundation using React, Node.js, B2-Backblaze, and Firebase. Focus on design and features, not complex setup.
- User Authentication: Secure sign-in using Firebase custom tokens.
- Product Catalog: Display products fetched from a backend API.
- Custom Order Submission: A form for authenticated users to submit custom orders with file uploads.
- Secure File Uploads: Integration with Backblaze B2 cloud storage for file uploads.
- Order Tracking: A component to track the status of an order by ID.
- Invoice Display: A protected endpoint for authenticated users to view invoice details.
- Dockerized Architecture: A mulit-container setup with a React frontend, Node.js backend, and NGINX reverse proxy.
- Frontend: React, Axios, Firebase Client SDK
- Backend: Node.js, Express, Firebase Admin SDK, AWS SDK (for B2)
- Database: Google Firestore
- Cloud Storage: Backblaze B2 (S3-compatible)
- Containerization: Docker Compose
- Reverse Proxy: NGINX
Before you begin, you need to have the following installed:
- Docker and Docker Compose
- Node.js and npm
- A Firebase Project with Firestore and Authentication enabled.
- A Backblaze B2 Bucket with S3-compatible API enabled
Follow these steps to set up and run the application.
Clone the EcomCraft repository to your local machine.
git clone https://github.com/drd60199/EcomCraft.gitcd EcomCraft
Create .env files to store your project's credentials.
Create a file named .env in the root of the project (the same directory as docker-compose.yml). This file contains the sensitive keys for your backend services.
# Backblaze B2 S3-Compatible API Credentials
B2_KEY_ID=YOUR_B2_KEY_ID
B2_APPLICATION_KEY=YOUR_B2_APPLICATION_KEY
B2_ENDPOINT=YOUR_B2_ENDPOINT
B2_BUCKET_NAME=YOUR_B2_BUCKET_NAME
# Firebase Admin SDK Service Account Key
# This should be the Base64-encoded JSON string of your service account key.
FIREBASE_SERVICE_ACCOUNT_KEY=YOUR_BASE64_ENCODED_JSON_STRING
Create another file named .env in the frontend directory. This file contains the public API keys for your frontend.
# Frontend Environment Variables
# Firebase Configuration
# These keys are required to initialize the Firebase SDK in your frontend.
REACT_APP_FIREBASE_API_KEY=YOUR_FIREBASE_API_KEY
REACT_APP_FIREBASE_AUTHDOMAIN=YOUR_FIREBASE_AUTHDOMAIN
REACT_APP_FIREBASE_PROJECTID=YOUR_FIREBASE_PROJECTID
REACT_APP_FIREBASE_STORAGEBUCKET=YOUR_FIREBASE_STORAGEBUCKET
REACT_APP_FIREBASE_MESSAGINGSENDERID=YOUR_FIREBASE_MESSAGINGSENDERID
REACT_APP_FIREBASE_APPID=YOUR_FIREBASE_APPID
REACT_APP_FIREBASE_MEASUREMENTID=YOUR_FIREBASE_MEASUREMENTID
Important: Both of these .env files are already included in their respective .gitignore files, so they will not be committed to Git.
With your .env files configured, you can now build and run the application using Docker Compose.
# Build the images and start the containers in detached mode
docker compose up --build -dThis application will be accessible at http://localhost.
/frontend: Contains the React application and itsDockerfile./backend: Contains the Node.js/Express API and itsDockerfile./nginx: Contains the NGINX configuration file (nginx.conf) for the reverse proxy.docker-compose.yml: The main file for orchestrating all the services.
EcomCraft is an open-source project, and contributions are welcome!
This project is licensed under the MIT License.