Skip to content

DHT-Uri/sales-notification

Repository files navigation

app-name

Application tag line describe here

Preparation

Installation

  • Choose a project staging for Firebase application
firebase use --add
  • Configure all settings for Firebase development environment by create a new file .runtimeconfig.json
{
  "shopify": {
    "api_key": "<Shopify API Key>",
    "secret": "<Shopify Secret>",
    "firebase_api_key": "<Firebase API Key>"
  }
}
SHOPIFY_API_KEY=<Insert here>
FIREBASE_API_KEY=<Insert here>
FIREBASE_AUTH_DOMAIN=<Insert here>
FIREBASE_PROJECT_ID=<Insert here>
FIREBASE_STORAGE_BUCKET=<Insert here>
FIREBASE_APP_ID=<Insert here>
FIREBASE_MEASUREMENT_ID=<Insert here>
  • Create an empty Firestore database
  • Deploy the Firestore default indexes
firebase deploy --only firestore

Development

  • To start to develop, please run 2 below commands
npm run start-dev
GOOGLE_APPLICATION_CREDENTIALS=<Path to service-account.json> firebase serve

Lint

  • All your files must be passed ESLint:

To setup a git hook before committing to Gitlab, please run:

cp git-hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit

Where you can see all function logs

  • You can see all logs from your functions by follow commands
firebase functions:log
  • You also view in Web interface by access

View all logs from Firebase web interface

Common issues

  • When you try, it can throw an error like that

Content Security Policy Error

Solution

Install Disable Content-Security-Policy (CSP) to disable CSP in Chromium browers

  • I got message: Unauthorized after authentication

Solution

Go https://console.firebase.google.com/u/0/project/{project-id}/settings/serviceaccounts/adminsdk

Click Generate new private key

Use command to export global environment

export GOOGLE_APPLICATION_CREDENTIALS=<Path to service-account.json>
  • Permission issue

** Solution **

Enable permission Service Account Token Creator for user@appspot.gserviceaccount.com

Enable Permission for appspot

  • I can't see FIREBASE_MEASUREMENT_ID in Firebase project

** Solution **

You can enable Analytics for your project from Firebase project

Enable Google Analytics on your app

TODO

  • Add testing
  • CI/CD
  • Add document

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published