Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 1.81 KB

CONTRIBUTING.md

File metadata and controls

64 lines (42 loc) · 1.81 KB

Contribution guidelines

😊

Prepare your environment

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

Setup Firebase

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.

Creating a Firebase project

If you want to deploy to a new Firebase project (needed for larger changes):

  1. 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;
  2. Go to Creation > Firestore Database page (on sidebar) and create database:

    • Just bypass with default production mode and rules;
    • Select region us-east4 (recommended);
  3. Firebase free plan doesn't support sending external HTTP requests, so you'll need to upgrade to Blaze (on demand) plan;

  4. Go to /store folder and edit .firebaserc setting your project ID (don't commit this file);

  5. Deploy with firebase login && npm run deploy;

Development

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