Complete guide for setting up CorrelateAI Pro on GitHub with secure API key management and automated deployment.
This guide covers:
- ✅ Secure API key management
- ✅ GitHub Pages deployment
- ✅ Custom domain configuration
- ✅ Automated CI/CD pipeline
- ✅ Security best practices
- ✅ Project structure organization
- GitHub account
- FRED API key (Get one here)
- Basic Git knowledge
The repository follows modern conventions with organized directories:
correlateai-pro/
├── docs/ # Documentation (lowercase naming)
│ ├── api-setup.md # API configuration guide
│ ├── github-setup.md # This file
│ ├── quick-start.md # 5-minute setup
│ └── ...
├── scripts/ # Utility scripts
│ └── security-audit.sh # Security verification
├── data/ # Data schemas and references
└── src/ # Source code
📖 Full structure: See project-structure.md
- GitHub account
- FRED API key (Get one here)
- Basic Git knowledge
- Click "Fork" on the GitHub repository page
- Choose your GitHub account as the destination
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/random-data-correlat.git cd random-data-correlat
- Create a new repository on GitHub
- Clone this project and push to your new repo:
git clone https://github.com/victorsaly/random-data-correlat.git cd random-data-correlat git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git git push -u origin main
-
Navigate to Repository Settings:
- Go to your repository on GitHub
- Click Settings tab
- Select Secrets and variables → Actions
-
Add FRED API Key Secret:
- Click "New repository secret"
- Name:
VITE_FRED_API_KEY - Secret: Your FRED API key (e.g.,
1234567890abcdef1234567890abcdef) - Click "Add secret"
-
Verify Secret Added:
- You should see
VITE_FRED_API_KEYin your secrets list - The value will be hidden for security
- You should see
-
Create local environment file:
cp .env.example .env
-
Add your API key to
.env:VITE_FRED_API_KEY=your_actual_api_key_here VITE_APP_NAME=CorrelateAI Pro VITE_APP_VERSION=1.0.0
-
Verify
.envis gitignored (it should be by default):cat .gitignore | grep .env # Should show: .env
-
Go to Repository Settings:
- Click Settings tab
- Scroll down to Pages section
-
Configure Source:
- Source: "Deploy from a branch"
- Branch:
gh-pages(will be created automatically) - Folder:
/ (root)
-
Save Settings:
- Click Save
- GitHub will show your site URL (e.g.,
https://username.github.io/repository-name)
-
Add Custom Domain:
- In Pages settings, add your domain:
correlateai.yourdomain.com - Update
public/CNAMEfile if needed
- In Pages settings, add your domain:
-
Configure DNS (follow DNS_SETUP_GUIDE.md):
- Add CNAME record pointing to your GitHub Pages URL
The repository includes .github/workflows/deploy.yml that:
- Triggers: On every push to
mainbranch - Builds: React application with Vite
- Injects: API keys from GitHub Secrets
- Deploys: To GitHub Pages automatically
- Updates: Custom domain configuration
-
Make a small change (e.g., update README):
echo "# My CorrelateAI Pro" > README.md git add README.md git commit -m "Initial deployment setup" git push origin main
-
Monitor Deployment:
- Go to Actions tab in your repository
- Watch the "Deploy to GitHub Pages" workflow
- Should complete in 2-3 minutes
-
Verify Live Site:
- Visit your GitHub Pages URL
- Test data correlation generation
- Check for "Real Data" badges (confirms API working)
- API keys are in GitHub Secrets (not in code)
-
.envfile is gitignored (not committed) - No hardcoded secrets in source code
- HTTPS enabled on custom domain
- Rate limiting respected (FRED: 120/minute)
-
Search for potential secrets:
# These should return NO results: git log --all --grep="api.*key" -i git log --all --grep="secret" -i git log --all -S "VITE_FRED_API_KEY" --source --all
-
Check current code:
# Should only find environment variable usage: grep -r "VITE_FRED_API_KEY" src/ # Should show: import.meta.env.VITE_FRED_API_KEY
- Actions Tab: Monitor deployment status
- Deployment Logs: Check for API connection issues
- Pages Tab: Verify successful deployments
- FRED Console: Check your API usage at FRED My Account
- Rate Limits: Monitor for 120 requests/minute limit
- Error Handling: Check browser console for API errors
-
"API key not found" in production:
- ✅ Verify GitHub Secret name:
VITE_FRED_API_KEY - ✅ Check workflow file references the secret correctly
- ✅ Redeploy after adding secret
- ✅ Verify GitHub Secret name:
-
Build fails in GitHub Actions:
- ✅ Check Actions tab for detailed error logs
- ✅ Verify all dependencies are in
package.json - ✅ Test build locally:
npm run build
-
Custom domain not working:
- ✅ Check DNS propagation (can take up to 24 hours)
- ✅ Verify CNAME file contains correct domain
- ✅ Ensure SSL certificate is provisioned
-
API CORS errors:
- ✅ Should not occur (FRED supports browser CORS)
- ✅ If persistent, check browser network tab
- ✅ Verify API key format and validity
-
"FRED API key not found" locally:
- ✅ Verify
.envfile exists and has correct format - ✅ Restart development server after creating
.env - ✅ Check file is in project root directory
- ✅ Verify
-
CORS errors in development:
- ✅ Vite proxy should handle this automatically
- ✅ Use
npm run dev(notnpm start) - ✅ Check
vite.config.tsproxy configuration
After successful setup, you should see:
- ✅ Automated deployments from GitHub Actions
- ✅ Real economic data in correlations
- ✅ "Real Data" badges on generated correlations
- ✅ FRED/World Bank API data sources working
- ✅ Custom domain (if configured) resolving correctly
- API Key Rotation: Update GitHub Secret if needed
- Dependencies:
npm auditand updates - Domain: Renew custom domain if applicable
- Weekly: Check GitHub Actions for failed deployments
- Monthly: Review API usage in FRED dashboard
- Quarterly: Update dependencies and security patches
🎉 Your CorrelateAI Pro is now securely deployed with real economic data!
Live Site: Check your GitHub Pages URL API Status: Monitor in browser console Deployment: Automatic on every push to main