π Setup Guide
Complete guide to set up AlgoChronicle with automatic GitHub integration
β οΈPrerequisites
- β’A GitHub account
- β’A Firebase account (free tier is sufficient)
- β’Basic knowledge of Git and command line
1
Firebase Setup
Create a Firebase Project
- Go to Firebase Console
- Click "Add Project" and follow the wizard
- Disable Google Analytics (optional for this project)
Enable Firestore Database
- In your Firebase project, go to Build β Firestore Database
- Click "Create database"
- Choose "Start in production mode"
- Select your preferred region
Get Firebase Admin Credentials
- Go to Project Settings β Service Accounts
- Click "Generate new private key"
- Save the JSON file securely (you'll need it for environment variables)
Note: Keep your Firebase credentials secure. Never commit them to Git!
2
Create DSA Problems Repository
Repository Setup
- Create a new GitHub repository (e.g., "dsa-problems")
- Clone it to your local machine
- Create a folder structure for your problems
Recommended Folder Structure
dsa-problems/ βββ 001-two-sum/ β βββ README.md β βββ solution.py β βββ solution.java β βββ solution.cpp βββ 002-add-two-numbers/ β βββ README.md β βββ solution.py βββ ...
README.md Format (YAML Frontmatter)
--- dayNumber: 1 title: Two Sum platform: LeetCode link: https://leetcode.com/problems/two-sum/ difficulty: Easy pattern: Hash Table approach: Use hash map to store complements optimized: O(n) bruteforce: O(nΒ²) space: O(n) date: 2025-10-23 --- ## Problem Description Your notes here...
3
Configure GitHub Webhook
Add Webhook to Your Repository
- Go to your dsa-problems repository on GitHub
- Navigate to Settings β Webhooks β Add webhook
- Set Payload URL:
https://your-domain.vercel.app/api/github-webhook - Content type:
application/json - Which events: Select "Just the push event"
- Active: β Checked
- Click "Add webhook"
Success: Your webhook is now configured! Every time you push to GitHub, AlgoChronicle will automatically update.
4
Deploy to Vercel
Vercel Deployment
- Fork or clone the AlgoChronicle repository
- Go to Vercel and sign in
- Click "Add New Project"
- Import your AlgoChronicle repository
- Add environment variables (see below)
- Click "Deploy"
Required Environment Variables
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=firebase-adminsdk@...
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n..."
NEXT_PUBLIC_SITE_URL=https://your-app.vercel.app
5
Test Your Setup
Add Your First Problem
- Create a folder in your dsa-problems repo (e.g.,
001-two-sum) - Add a README.md with YAML frontmatter (see format above)
- Add your solution files (solution.py, solution.java, solution.cpp)
- Commit and push to GitHub
- Check your AlgoChronicle website - your problem should appear!
Pro Tip: Check GitHub Webhooks β Recent Deliveries to see if the webhook fired successfully.
π§Troubleshooting
Problem not showing on website?
- β’ Check webhook delivery in GitHub (Settings β Webhooks)
- β’ Verify environment variables in Vercel
- β’ Check Vercel function logs for errors
- β’ Hard refresh your browser (Ctrl+Shift+R)
Webhook failing?
- β’ Ensure Firebase Admin credentials are correct
- β’ Check that FIREBASE_PRIVATE_KEY includes quotes and newlines
- β’ Verify Firestore is enabled in Firebase Console