Skip to content

sneat-co/sneat-go-backend

Repository files navigation

sneat-go

Go CI Go Report Card

Go lang backend for sneat apps:

3-d party dependencies

  • AWS - to send emails

Running GAE app

To run Google AppEngine app locally execute:

> cd sneatgaeapp
> go run main.go 

Running with emulators

If you want Firebase SDKs to use Firebase emulators you would need to set next local variables:

export GCLOUD_PROJECT="demo-sneat"
export FIREBASE_AUTH_EMULATOR_HOST="localhost:9099"
export FIRESTORE_EMULATOR_HOST="localhost:8080"

Set path to Google Application Credentials files. For example:

export GOOGLE_APPLICATION_CREDENTIALS="~/projects/sneat/private_keys/sneat-54237a268b5a.json"

Running with Google Firebase emulators:

At the time of writing Firebase Go Admin SDK does not support `Authentication` emulator. It is planned to be supported in the future.

See Admin SDK availability to check current status.

Firebase Admin Go SDK is supposed to support Authentication emulator. It has been merged with PR # 419 on 21st April 2021 with commit # 27ac52.

So to use Firebase Authentication & Firestore emulators run as:

cd firestore
firebase emulators:start --only auth,firestore --project sneat-team

To run with real authentication but only emulated firestore execute:

cd firestore
firebase emulators:start --only firestore --project sneat-team

Note**:

It looks like a bug that Admin SDK is not able to use "demo-*" project ID. We have to use a real project ID and provide an environment variable GOOGLE_APPLICATION_CREDENTIALS. That's wrong and should not be used for scaled development.

Google emulators documentation

Read more about connecting an app to:

Testing chatbots locally

There is a dedicated section regards how to test Telegram bots locally in src/bots.