Vercel Deployment Setup
This document contains all information related to the Vercel deployment configuration for the LBH Educate Phase 1 planning site.
Current Status
✅ Deployment is live and configured
The project is currently deployed and operational. The following configuration has been completed:
- Repository connected to Vercel
- Build configuration set via
vercel.json - Password protection enabled via client-side authentication
- Auto-deploy from GitHub
mainbranch enabled
Architecture Overview
File Structure
/ (root)
├── login.html # Password authentication page
├── auth-check.js # Client-side auth verification script
├── build.js # Static site generator
├── vercel.json # Vercel configuration
├── package.json # Dependencies (marked for build)
├── planning/ # Phase 1 working files
│ ├── docs/ # Planning documentation
│ ├── workflows/ # Visual workflow diagrams
│ └── resources/ # Skills/behaviors CSV data
└── public/ # Generated output (gitignored)
How It Works
- Build Process: On deployment, Vercel runs
npm run build - Static Generation:
build.jsreads fromplanning/docsandplanning/workflows - Output: Generates static HTML/CSS site in
public/ - Authentication: Client-side SHA-256 password verification on first visit
- Session Management: sessionStorage maintains authentication during browser session
- Deployment: Changes pushed to
maintrigger automatic rebuild and redeploy
Configuration Files
vercel.json
{
"buildCommand": "npm run build",
"outputDirectory": "public",
"cleanUrls": true,
"trailingSlash": false
}
package.json (relevant scripts)
{
"scripts": {
"build": "node build.js",
"dev": "live-server public --port=8080 --open=/"
}
}
Password Protection
Mechanism
The site uses client-side password authentication with SHA-256 hashing:
- Login Page (
login.html): Presents password input form - Hash Verification: User password is hashed using SHA-256 and compared to stored hash
- Session Storage: On successful login,
sessionStorage.setItem('lbh_auth', 'true')is set - Auth Check Script (
auth-check.js): Included on all protected pages, redirects to login if not authenticated - Logout Button: Appears on all protected pages, clears session and returns to login
Security Considerations
- Password hash is visible in client-side code (stored in
login.html) - Security relies on password complexity rather than hash secrecy
- Current password is 24 characters with high entropy
- SHA-256 hash:
681b2985d0e09c79e699c1b73c39f153015919176d75893d598d1099ea6e5d6e - Session persists only during browser tab lifetime (sessionStorage)
- Appropriate for private planning documentation shared with team members
- HTTPS enforced by Vercel by default
Changing the Password
To update the password:
- Generate new SHA-256 hash:
echo -n "your-new-password" | shasum -a 256 - Update the hash in
login.html:const validHash = 'YOUR_NEW_HASH_HERE'; - Commit and push to trigger redeploy
Build Process Details
What Gets Built
The build.js script performs the following:
- Copy Workflows: Recursively copies
planning/workflows/topublic/workflows/ - Copy Auth Files: Copies
login.htmlandauth-check.jstopublic/ - Convert Markdown: Processes all
.mdfiles inplanning/docs/phase-1/and rootREADME.md - Generate HTML: Creates individual HTML pages for each markdown doc with auth-check script included
- Create Index: Builds homepage with cards linking to workflows and docs
- Compile Styles: Generates unified
styles.cssfor all pages
Generated Files
public/
├── index.html # Homepage with navigation cards
├── login.html # Password authentication page
├── auth-check.js # Auth verification script
├── styles.css # Unified stylesheet
├── docs/
│ ├── README.html # Project README
│ ├── 01-User-Experience.html
│ ├── 02-Database-Model.html
│ ├── 03-Frontend-Components.html
│ ├── 04-Controller-Scripts.html
│ ├── 05-Questions.html
│ └── 06-Vercel-Setup.html
└── workflows/
├── index.html # Workflow list
├── css/ # Workflow styles
└── diagrams/ # Individual diagrams
Deployment Workflow
Automatic Deployment
Every commit to main triggers:
- Vercel detects push via GitHub integration
- Pulls latest code from repository
- Runs
npm install(installsmarkeddependency) - Executes
npm run build(generatespublic/directory) - Deploys contents of
public/to CDN - Updates live site (typically within 30-60 seconds)
Manual Redeploy
From Vercel dashboard:
- Go to project → Deployments
- Click "..." menu on any deployment
- Select "Redeploy"
Collaboration
For Team Members
Both you and your collaborators can:
- Clone the repository
- Make changes to
planning/docs/orplanning/workflows/ - Commit and push to
main - Vercel automatically rebuilds and deploys
Local Preview
Before pushing:
npm run build # Generate public/ directory
npm run dev # Preview at http://localhost:8080
On first visit to local preview, you'll be prompted for the password.
Technical Notes
Dependencies
- marked: Markdown to HTML converter (installed during build)
- live-server: Local development server (dev dependency, not used in production)
Gitignore
The following are excluded from version control:
public/- Generated on each buildnode_modules/- Installed during build.vercel/- Vercel CLI metadata
Authentication Implementation
The authentication system uses:
- Web Crypto API (
crypto.subtle.digest) for SHA-256 hashing - sessionStorage for maintaining login state during browser session
- JavaScript redirects for protecting pages
- All pages except
login.htmlincludeauth-check.jswhich runs on page load
Troubleshooting
Build Fails
Check that:
planning/docs/phase-1/exists and contains.mdfilesplanning/workflows/existsbuild.jshas correct pathslogin.htmlandauth-check.jsexist at root level
Password Not Working
- Verify the password hash in
login.htmlis correct - Clear browser sessionStorage (or open incognito/private window)
- Check browser console for JavaScript errors
- Ensure you're entering the exact password (case-sensitive)
Authentication Loop (Keeps Redirecting to Login)
- Check that sessionStorage is enabled in browser
- Verify
auth-check.jsis being loaded correctly - Check browser console for errors
- Try clearing all site data and logging in again
Changes Not Appearing
- Confirm commit was pushed to
mainbranch - Check Vercel dashboard for build status
- Wait 30-60 seconds for CDN cache invalidation
- Hard refresh browser (Cmd+Shift+R / Ctrl+Shift+R)
- If authenticated, logout and login again to clear sessionStorage
Future Considerations
As the project evolves:
- Consider adding staging environment (preview deployments)
- Implement server-side authentication if security requirements increase
- Add analytics to track documentation usage
- Set up custom domain if desired
- Consider moving to OAuth or more robust auth system for production app