😊
npm i -g pnpm firebase-tools
Clone this repo to your local machine and install the dependencies:
git clone git@github.com:ecomplus/cloud-commerce.git
cd cloud-commerce
git submodule update --init store
pnpm install
You may create a Firebase project to test or just setup emulators to test locally:
firebase init emulators
Select emulators for Authentication, Hosting, Functions, Firestore, Pub/Sub and Storage.
You can skip the last three if you're willing to work with Storefront only, and the first two if willing to work if app(s) only.
If you want to deploy to a new Firebase project (needed for larger changes):
-
Start creating new project on Firebase console:
- Set a nice project name (ID) and remember it;
- You may enable Firebase Analytics for enhanced remote config options and A/B testing;
-
Go to Creation > Firestore Database page (on sidebar) and create database:
- Just bypass with default production mode and rules;
- Select region
us-east4
(recommended);
-
Firebase free plan doesn't support sending external HTTP requests, so you'll need to upgrade to Blaze (on demand) plan;
-
Go to
/store
folder and edit.firebaserc
setting your project ID (don't commit this file); -
Deploy with
firebase login && npm run deploy
;
To emulate Firebase and serve all starter Store services locally, run the following commands on the monorepo root:
pnpm run setup
pnpm serve
run setup
is only needed for the first time, it'll get your store credentials and put them in functions/.env
.
To run tests for all packages:
pnpm test