Skip to main content

☁️ Infrastructure and Deployment

Hey, Inner Journey deployers! This document outlines how Inner Journey is deployed and managed on Google Cloud infrastructure. We use Git for version control, Google Cloud Run for the backend, and Firebase Hosting for the frontend – all automated for efficiency. Let’s keep the platform running smoothly! 🌟

πŸ—οΈ Infrastructure Overview​

Here's a quick look at the core components:

  • Frontend Hosting: Firebase Hosting serves the static React application. Fast and reliable global CDN.
  • Backend Hosting: Google Cloud Run hosts the containerized FastAPI application, offering serverless scalability.
  • Secrets Management: Google Cloud Secret Manager securely stores sensitive information like API keys (e.g., Firebase service account, Gemini API key).
  • CI/CD: Git repository changes trigger automated deployment pipelines using GitHub Actions and Google Cloud Build.

Deployment Flow Visualization​

This diagram illustrates the automated deployment process from code push to live services:

πŸš€ Deployment Process Details​

Frontend Deployment​

  1. Trigger: Code is pushed to the main branch in the GitHub repository.
  2. CI/CD Pipeline: GitHub Actions automatically triggers a workflow.
  3. Action: The workflow builds the React application and deploys the static files to Firebase Hosting using the command firebase deploy --only hosting.
  4. Result: The updated frontend is available at https://innerjourney-c007e.web.app.

Backend Deployment​

  1. Trigger: Code is pushed to the main branch in the GitHub repository.
  2. CI/CD Pipeline: GitHub Actions triggers a Google Cloud Build process defined in backend/cloudbuild.yaml.
  3. Action: Cloud Build:
    • Builds a Docker container image for the FastAPI application.
    • Pushes the image to Google Artifact Registry.
    • Deploys the new container version to Google Cloud Run using gcloud run deploy.
  4. Secrets: During deployment or at runtime, the Cloud Run service securely accesses necessary secrets (like firebase-credentials, gemini-api-key) stored in Google Cloud Secret Manager.
  5. Result: The updated backend API is available at https://innerjourney-backend-975065734812.europe-west1.run.app.

For detailed workflow configurations, please refer to the files in the GitHub repository: .github/workflows/ and backend/cloudbuild.yaml.