βοΈ 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β
- Trigger: Code is pushed to the
mainbranch in the GitHub repository. - CI/CD Pipeline: GitHub Actions automatically triggers a workflow.
- Action: The workflow builds the React application and deploys the static files to Firebase Hosting using the command
firebase deploy --only hosting. - Result: The updated frontend is available at
https://innerjourney-c007e.web.app.
Backend Deploymentβ
- Trigger: Code is pushed to the
mainbranch in the GitHub repository. - CI/CD Pipeline: GitHub Actions triggers a Google Cloud Build process defined in
backend/cloudbuild.yaml. - 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.
- 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. - 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.