Dashboard Setup
Deploy the Developer Dashboard to Vercel or your own infrastructure.
Prerequisites
- Node.js 18+
- pnpm
- Firebase project
- GitHub OAuth app (optional)
Quick Start
1. Clone the Repository
bash
git clone https://github.com/epinnock/scry-developer-dashboard.git
cd scry-developer-dashboard
pnpm install2. Configure Environment
Copy the example environment file:
bash
cp .env.local.example .env.localEdit .env.local:
bash
# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id
# CDN viewer base URL (scry-cdn-service)
# Used for Storybook "View" links and fetching coverage-report.json
# Examples:
# NEXT_PUBLIC_SCRY_VIEW_URL=http://localhost:8787
# NEXT_PUBLIC_SCRY_VIEW_URL=https://view.staging.example.com
# NEXT_PUBLIC_SCRY_VIEW_URL=https://view.example.com
NEXT_PUBLIC_SCRY_VIEW_URL=https://view.scrymore.com
# Optional: if NEXT_PUBLIC_SCRY_VIEW_URL points at localhost, the dashboard can fetch
# viewer resources through a same-origin Next.js API proxy:
# GET /api/view/<project>/<version>/coverage-report.json
# which proxies to this upstream.
SCRY_VIEW_PROXY_TARGET=http://localhost:8787
# Authentication (optional)
NEXT_PUBLIC_USE_AUTH=false3. Run Development Server
bash
pnpm devOpen http://localhost:3000 in your browser.
Firebase Setup
1. Create Firebase Project
- Go to Firebase Console
- Click "Add project"
- Follow the setup wizard
2. Enable Services
Enable the following Firebase services:
- Authentication - For user login
- Firestore - For data storage
- Storage - For file uploads (optional)
3. Get Configuration
- Go to Project Settings → General
- Scroll to "Your apps"
- Click "Add app" → Web
- Copy the configuration values
4. Configure Firestore Rules
javascript
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can read/write their own projects
match /projects/{projectId} {
allow read, write: if request.auth != null
&& resource.data.ownerId == request.auth.uid;
}
// Nested collections
match /projects/{projectId}/{document=**} {
allow read, write: if request.auth != null;
}
// Users collection
match /users/{userId} {
allow read, write: if request.auth != null
&& request.auth.uid == userId;
}
}
}GitHub Authentication
1. Create GitHub OAuth App
- Go to GitHub → Settings → Developer settings → OAuth Apps
- Click "New OAuth App"
- Fill in:
- Application name: Scry Dashboard
- Homepage URL:
http://localhost:3000(development) - Authorization callback URL: Check Firebase Console
2. Enable in Firebase
- Go to Firebase Console → Authentication
- Click "Sign-in method" tab
- Enable "GitHub"
- Enter Client ID and Client Secret from GitHub
- Copy the callback URL to your GitHub OAuth app
3. Enable Auth in Dashboard
bash
# .env.local
NEXT_PUBLIC_USE_AUTH=trueDeployment
Vercel (Recommended)
- Push your code to GitHub
- Go to Vercel
- Import your repository
- Add environment variables
- Deploy
Manual Deployment
bash
# Build
pnpm build
# Start production server
pnpm startDocker
dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
EXPOSE 3000
CMD ["pnpm", "start"]bash
docker build -t scry-dashboard .
docker run -p 3000:3000 --env-file .env.local scry-dashboardEnvironment Variables
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_FIREBASE_API_KEY | Yes | Firebase API key |
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN | Yes | Firebase auth domain |
NEXT_PUBLIC_FIREBASE_PROJECT_ID | Yes | Firebase project ID |
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET | Yes | Firebase storage bucket |
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID | Yes | Firebase sender ID |
NEXT_PUBLIC_FIREBASE_APP_ID | Yes | Firebase app ID |
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID | No | Firebase analytics ID |
NEXT_PUBLIC_SCRY_VIEW_URL | No | CDN viewer base URL (where scry-cdn-service is running). Defaults to https://view.scrymore.com |
SCRY_VIEW_PROXY_TARGET | No | Local upstream for /api/view/* proxy when the viewer URL is localhost (default: http://localhost:8787) |
NEXT_PUBLIC_USE_AUTH | No | Enable authentication (true/false) |
Verification
Check Firebase Connection
- Open the dashboard
- Check browser console for errors
- Try creating a project
Check Authentication
- Click "Sign in with GitHub"
- Complete OAuth flow
- Verify user appears in Firebase Console → Authentication
Troubleshooting
"Firebase: Error (auth/configuration-not-found)"
- Verify Firebase configuration values
- Check
NEXT_PUBLIC_FIREBASE_API_KEYis set correctly
"GitHub OAuth error"
- Verify callback URL matches in GitHub and Firebase
- Check Client ID and Secret are correct
"Permission denied" errors
- Update Firestore security rules
- Verify user is authenticated
Next Steps
- Firebase Config - Detailed Firebase setup
- API Keys - Managing API keys
- Architecture - System architecture