Deploy your TruthChain application to Vercel in just a few clicks!
-
Visit Vercel:
- Go to: https://vercel.com/
-
Sign up / Log in:
- Use GitHub account (recommended)
- Click "Continue with GitHub"
- Authorize Vercel
-
Click "Add New Project"
- Or go to: https://vercel.com/new
-
Import Git Repository:
- Click "Import Git Repository"
- Select "GitHub"
- Find
An8akki/truthchain - Click "Import"
Framework Preset:
- Vercel should auto-detect: Next.js
Root Directory:
- Set to:
frontend - Click "Edit" next to Root Directory
- Enter:
frontend
Build and Output Settings:
- Build Command:
npm run build(auto-detected) - Output Directory:
.next(auto-detected) - Install Command:
npm install(auto-detected)
Environment Variables:
- Skip for now (optional, can add later)
-
Click "Deploy"
- Vercel will start building
- Wait 2-3 minutes
-
Deployment Complete!
- You'll see: "Congratulations!"
- Your app is live!
-
Get Your URL:
- Format:
https://truthchain-xxx.vercel.app - Click "Visit" to see your live app
- Format:
npm install -g vercelvercel login- Choose your login method (GitHub recommended)
- Authorize in browser
# Navigate to project root
cd d:\BlockChain\TruthChain
# Deploy
vercel
# Follow prompts:
# - Set up and deploy? Yes
# - Which scope? Your account
# - Link to existing project? No
# - Project name? truthchain
# - Directory? ./frontend
# - Override settings? No# Deploy to production
vercel --prod{
"buildCommand": "cd frontend && npm install && npm run build",
"outputDirectory": "frontend/.next",
"devCommand": "cd frontend && npm run dev",
"installCommand": "cd frontend && npm install",
"framework": "nextjs",
"regions": ["iad1"]
}TruthChain/
βββ frontend/ β Root directory for Vercel
β βββ app/
β βββ components/
β βββ contexts/
β βββ lib/
β βββ public/
β βββ package.json
β βββ next.config.js
βββ contracts/
βββ scripts/
βββ vercel.json β Vercel configuration
βββ README.md
If you want to add environment variables on Vercel:
- Go to your Vercel dashboard
- Select your project
- Click "Settings"
- Click "Environment Variables"
Add these if needed:
NEXT_PUBLIC_CREATOR_REGISTRY_ADDRESS=0x...
NEXT_PUBLIC_TRUTHCHAIN_ADDRESS=0x...
NEXT_PUBLIC_NETWORK_NAME=polygonAmoy
NEXT_PUBLIC_CHAIN_ID=80002
NEXT_PUBLIC_RPC_URL=https://rpc-amoy.polygon.technology
NEXT_PUBLIC_PINATA_API_KEY=your_key
NEXT_PUBLIC_PINATA_SECRET_KEY=your_secret
NEXT_PUBLIC_PINATA_JWT=your_jwt
Note: For demo mode, these are optional!
-
Go to Project Settings:
- Click "Domains"
-
Add Domain:
- Enter your domain (e.g.,
truthchain.com) - Follow DNS configuration instructions
- Enter your domain (e.g.,
-
Vercel Provides:
- Free SSL certificate
- Automatic HTTPS
- Global CDN
-
Vercel Clones Your Repo
- From GitHub:
An8akki/truthchain
- From GitHub:
-
Installs Dependencies
- Runs:
npm installinfrontend/
- Runs:
-
Builds Your App
- Runs:
npm run build - Creates optimized production build
- Runs:
-
Deploys to CDN
- Distributes globally
- Enables edge caching
-
Provides URL
- Format:
https://truthchain-xxx.vercel.app - Or your custom domain
- Format:
Building...
β Compiled successfully
β Linting and checking validity of types
β Collecting page data
β Generating static pages (5/5)
β Finalizing page optimization
Route (app) Size First Load JS
β β / 5.2 kB 95 kB
β β /admin 8.1 kB 98 kB
β β /creator 12.3 kB 102 kB
β β /explore 7.8 kB 97 kB
β β /verify 9.5 kB 99 kB
β (Static) prerendered as static content
β Build completed successfully
-
Visit Your URL:
https://truthchain-xxx.vercel.app -
Test All Pages:
- Home:
/ - Verify:
/verify - Creator:
/creator - Explore:
/explore - Admin:
/admin
- Home:
-
Check Features:
- β Cosmos background loads
- β Navigation works
- β Creator registration works
- β Content upload works
- β Verification works
- β All features functional
-
Push to GitHub:
git add . git commit -m "Update feature" git push
-
Vercel Auto-Deploys:
- Detects push to
masterbranch - Automatically builds and deploys
- Updates live site in 2-3 minutes
- Detects push to
-
Preview Deployments:
- Every branch gets a preview URL
- Test before merging to master
- Code pushed to GitHub
-
vercel.jsoncreated - Frontend builds locally (
npm run build) - No build errors
- All features tested
- Vercel project created
- Root directory set to
frontend - Build completes successfully
- Deployment URL received
- Visit deployment URL
- Test all pages
- Verify features work
- Check console for errors
- Share with users!
Error: "Build failed"
Solution:
- Check build logs in Vercel dashboard
- Test build locally:
cd frontend npm run build - Fix any errors
- Push to GitHub
- Vercel will auto-redeploy
Error: "404 Not Found" on /creator, /verify, etc.
Solution:
- Ensure root directory is set to
frontend - Next.js should handle routing automatically
- Check
next.config.jsif exists
Error: "undefined" for environment variables
Solution:
- Add variables in Vercel dashboard
- Redeploy after adding variables
- Ensure variables start with
NEXT_PUBLIC_
Issue: App loads slowly
Solution:
- Vercel uses global CDN (should be fast)
- Check image optimization
- Enable caching headers
- Use Vercel Analytics to diagnose
- β Unlimited Deployments
- β Automatic HTTPS
- β Global CDN
- β Preview Deployments
- β Auto-scaling
- β 100GB Bandwidth/month
- β Serverless Functions
- β Analytics (optional)
- β‘ Edge Network: 70+ locations worldwide
- β‘ Fast Builds: 2-3 minutes average
- β‘ Instant Rollbacks: One-click revert
- β‘ Zero Downtime: Atomic deployments
- Projects: https://vercel.com/dashboard
- Deployments: https://vercel.com/deployments
- Settings: https://vercel.com/account
- Vercel Docs: https://vercel.com/docs
- Next.js on Vercel: https://vercel.com/docs/frameworks/nextjs
- CLI Reference: https://vercel.com/docs/cli
Add this to your README.md:
[](https://vercel.com/new/clone?repository-url=https://github.com/An8akki/truthchain&project-name=truthchain&repository-name=truthchain&root-directory=frontend)This creates a button that deploys your app with one click!
π Live URL: https://truthchain-xxx.vercel.app
π Deploy Time: 2-3 minutes
π Auto-Deploy: On every push to master
π Global CDN: 70+ edge locations
π Analytics: Built-in (optional)
π HTTPS: Automatic SSL
π° Cost: FREE (Hobby plan)
- Go to: https://vercel.com/new
- Import:
An8akki/truthchain - Set Root Directory:
frontend - Click: "Deploy"
- Wait: 2-3 minutes
- Done! Visit your live URL
-
Share Your URL:
- Post on social media
- Share with friends
- Add to portfolio
-
Monitor Performance:
- Check Vercel Analytics
- Monitor build times
- Track visitor stats
-
Keep Updating:
- Push to GitHub
- Vercel auto-deploys
- Always stay current
-
Add Custom Domain:
- Buy a domain
- Point DNS to Vercel
- Get professional URL
- Vercel Support: https://vercel.com/support
- Vercel Community: https://github.com/vercel/vercel/discussions
- Next.js Docs: https://nextjs.org/docs
π Your TruthChain app is ready to deploy to Vercel! π
Deploy Now: https://vercel.com/new
Last Updated: 2025-11-29
For TruthChain v1.0