Skip to content

Add comprehensive setup and service account documentation#287

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-4abe6f4f-a662-4cc3-b6f0-d13bbcf601bb
Draft

Add comprehensive setup and service account documentation#287
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-4abe6f4f-a662-4cc3-b6f0-d13bbcf601bb

Conversation

Copilot AI commented Oct 3, 2025

Copy link
Copy Markdown

Overview

Addresses #[issue_number] by providing comprehensive documentation on setting up the ENGAGE-HF Firebase infrastructure from scratch, including detailed service account configuration and step-by-step user onboarding procedures.

Changes

New Documentation: SETUP.md

Created a comprehensive 607-line setup guide covering the complete deployment lifecycle:

Service Accounts (Core Addition)

  • Documents both service accounts used by the project:
    • Privileged Service Account (cloudfunctionsserviceaccount@[PROJECT_ID].iam.gserviceaccount.com) - used by sensitive operations like defaultSeed, customSeed, updateStaticData, deleteUser, enrollUser, and others
    • Default Service Account (limited-cloudfunction-sa@[PROJECT_ID].iam.gserviceaccount.com) - used by standard Cloud Functions
  • Provides complete IAM role requirements for each service account
  • Includes gcloud CLI commands for service account creation and role assignment

Setup Instructions

  • Prerequisites and initial Firebase project configuration
  • Step-by-step Firebase service enablement (Authentication, Firestore, Storage, Functions)
  • Local development environment setup
  • Configuration of secrets (Twilio, Web Frontend URL) using Firebase Secret Manager
  • SSO setup with cross-references to existing documentation
  • First-time and continuous deployment procedures

User Onboarding (Complete Flow)

  • Creating the first admin user (manual and invitation-based methods)
  • Setting up organization owners with SSO
  • Onboarding clinicians through the web dashboard
  • Complete patient onboarding workflow from invitation creation to app setup

Additional Sections

  • Initial data seeding for development and production environments
  • Testing procedures with emulators
  • Troubleshooting guide for common issues (build errors, permissions, secrets, deployment)

Updated: README.md

Added a prominent "Getting Started" section immediately after the project description that:

  • Directs new users to the comprehensive setup guide
  • Highlights key topics covered (Firebase configuration, service accounts, deployment, user onboarding)
  • Provides a clear entry point for teams setting up ENGAGE-HF for the first time

Why This Matters

Previously, teams setting up ENGAGE-HF Firebase had to piece together information from various sources and the codebase itself. This documentation provides:

  1. Security Clarity: Explicit documentation of which service accounts are used for which operations and why different permission levels are needed
  2. Complete Setup Path: A single source of truth from empty GCP project to functioning ENGAGE-HF deployment
  3. Onboarding Confidence: Clear procedures for creating the first admin and onboarding clinicians and patients
  4. Troubleshooting Support: Common issues and their resolutions documented upfront

Testing

  • ✅ Verified all service account references against source code
  • ✅ Confirmed internal documentation links are valid
  • ✅ Build and lint pass without issues
  • ✅ No code changes, documentation-only update
Original prompt

This section details on the original issue you should resolve

<issue_title>Service Account & Setup Documentation</issue_title>
<issue_description>### Problem

Currently, we do not provide any documentation on how to set up this project and which service accounts are used.

Solution

Create documentation on the setup and initial steps to start off with the project until the first clinicians/patients are ready to be onboarded.

Additional context

May include further changes to the setup procedure (including a function to setup the system initially when no Firestore objects are yet present).

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #185

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: pauljohanneskraft <15239005+pauljohanneskraft@users.noreply.github.com>
Copilot AI changed the title [WIP] Service Account & Setup Documentation Add comprehensive setup and service account documentation Oct 3, 2025
@codecov

codecov Bot commented Oct 3, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.12%. Comparing base (8624b3f) to head (ce541a4).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
- Coverage   82.43%   82.12%   -0.30%     
==========================================
  Files          91       91              
  Lines        3607     3607              
  Branches      894      894              
==========================================
- Hits         2973     2962      -11     
- Misses        600      637      +37     
+ Partials       34        8      -26     

see 12 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8624b3f...ce541a4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service Account & Setup Documentation

2 participants