Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 1.58 KB

infrastructure.md

File metadata and controls

33 lines (28 loc) · 1.58 KB

Infrastructure

The app is build using Google Cloud Platform (GCP) and Firebase.

Serverless approach is used mainly.

Diagram:

diagram

Next cloud products are used:

  • Google Cloud Run
  • Google Cloud SQL (for PostgreSQL)
  • Google Cloud Tasks
  • Google Cloud Logging
  • Google Cloud IAM
  • Firebase Authentication
  • Firebase Hosting (for future Admin Panel)
  • Firebase Storage
  • Sentry (for error logging)

Basic idea:

  1. Frontend apps (iOS & future Admin Panel) communicate with backend via REST API.
  2. REST API is build on top of Node using Nest.js framework
  3. Docker container with REST API app is deployed to Google Cloud Run (GCR).
  4. GCR scales REST API up and down in serverless way.
  5. GCR connects with Google Cloud SQL to get access to production PostgreSQL DB.
  6. Cloud SQL keeps DB up and running, tracks usage, makes automatic backups and provides replication (not yet used).
  7. REST API communicates with Google Cloud Tasks to schedule tasks in the future.
  8. Firebase Authentication is used on frontend side to do user authentication (email+password, passwordless, Google, Facebook, Twitter, Phone auth, etc) and returns JWT.
  9. JWT is used to verify user's requests on REST API side and Cloud Storage.
  10. Cloud Storage is used for files storage (upload/download static resources).
  11. REST API also uses Cloud Memorystore (serves Redis) for caching and Cloud Logging/Sentry for logs/errors.
  12. Firebase Hosting hosts Admin Panel and Web Client apps.