@@ -4,6 +4,7 @@ A modern, real-time web dashboard built with Next.js to display participant onbo
44
55## Features
66
7+ - ** Authentication** : Secure Google OAuth SSO with domain restriction (@vectorinstitute .ai)
78- ** Real-time Status Tracking** : Displays live participant onboarding status fetched from Firestore
89- ** Clean, Polished UI** : Modern, responsive design with dark mode support
910- ** Summary Statistics** : Shows total participants, onboarded count, completion percentage
@@ -53,18 +54,24 @@ services/onboarding-status-web/
5354 npm install
5455 ```
5556
56- 2 . Set environment variables:
57+ 2 . Set up environment variables:
5758 ``` bash
58- export GCP_PROJECT_ID=coderd
59- export FIRESTORE_DATABASE_ID=onboarding
59+ cp .env.example .env
6060 ```
6161
62+ Then edit ` .env ` and fill in the required values:
63+ - Get Google OAuth credentials from [ Google Cloud Console] ( https://console.cloud.google.com/apis/credentials )
64+ - Generate a session secret: ` openssl rand -base64 32 `
65+ - Set your GitHub token with appropriate permissions
66+
62673 . Run the development server:
6368 ``` bash
6469 npm run dev
6570 ```
6671
67- 4 . Open [ http://localhost:3000 ] ( http://localhost:3000 ) in your browser
72+ 4 . Open [ http://localhost:3000/onboarding ] ( http://localhost:3000/onboarding ) in your browser
73+
74+ 5 . Sign in with a Vector Institute Google account (@vectorinstitute .ai)
6875
6976## Deployment
7077
@@ -120,15 +127,34 @@ cd /path/to/aieng-platform
120127
121128## Environment Variables
122129
130+ ### Required
123131- ` GCP_PROJECT_ID ` : Google Cloud Project ID (default: ` coderd ` )
124132- ` FIRESTORE_DATABASE_ID ` : Firestore database ID (default: ` onboarding ` )
133+ - ` GITHUB_TOKEN ` : GitHub personal access token for API access
134+ - ` NEXT_PUBLIC_GOOGLE_CLIENT_ID ` : Google OAuth client ID
135+ - ` GOOGLE_CLIENT_SECRET ` : Google OAuth client secret
136+ - ` SESSION_SECRET ` : Secret for encrypting session cookies (generate with: ` openssl rand -base64 32 ` )
137+
138+ ### Optional
139+ - ` NEXT_PUBLIC_APP_URL ` : Full application URL (default: ` http://localhost:3000 ` )
140+ - ` REDIRECT_URI ` : OAuth callback URL (default: ` ${NEXT_PUBLIC_APP_URL}/onboarding/api/auth/callback ` )
141+ - ` ALLOWED_DOMAINS ` : Comma-separated list of allowed email domains (default: ` vectorinstitute.ai ` )
125142- ` PORT ` : Port to run the server on (default: ` 8080 ` )
126143
127144## API Endpoints
128145
146+ ### Authentication Endpoints
147+
148+ - ` GET /api/auth/login ` - Initiates Google OAuth flow
149+ - ` GET /api/auth/callback ` - Handles OAuth callback and creates session
150+ - ` POST /api/auth/logout ` - Destroys user session
151+ - ` GET /api/auth/session ` - Returns current session information
152+
153+ ### Data Endpoints
154+
129155### GET /api/participants
130156
131- Returns participant onboarding status and summary statistics.
157+ Returns participant onboarding status and summary statistics. Requires authentication.
132158
133159** Response:**
134160``` json
@@ -174,10 +200,12 @@ Returns participant onboarding status and summary statistics.
174200
175201## Security
176202
177- - Uses Google Cloud service account authentication for Firestore access
178- - Runs as non-root user in Docker container
179- - Follows Cloud Run security best practices
180- - CORS configured for API routes
203+ - ** OAuth 2.0 Authentication** : Secure Google OAuth with PKCE flow
204+ - ** Session Management** : HTTP-only cookies with encrypted sessions using iron-session
205+ - ** Domain Restriction** : Only @vectorinstitute .ai email addresses can access
206+ - ** Firestore Access** : Service account authentication for database access
207+ - ** Container Security** : Runs as non-root user in Docker
208+ - ** CORS Configuration** : Properly configured API routes
181209
182210## Performance
183211
@@ -206,6 +234,15 @@ If the Docker build fails:
2062342 . Check that the ` public ` directory exists
2072353 . Verify Node.js version compatibility
208236
237+ ### Authentication Issues
238+
239+ If you can't sign in:
240+ 1 . Verify Google OAuth credentials are correct
241+ 2 . Ensure redirect URI is registered in Google Cloud Console
242+ 3 . Check that your email domain (@vectorinstitute .ai) is in ALLOWED_DOMAINS
243+ 4 . Verify SESSION_SECRET is at least 32 characters
244+ 5 . Check browser console for errors
245+
209246### Firestore Connection Issues
210247
211248If the dashboard can't fetch data:
0 commit comments