This guide will get you from zero to a fully functional MVP with real database, file uploads, and authentication.
-
Create a Supabase account at https://supabase.com
-
Create a new project:
- Click "New Project"
- Choose a project name (e.g., "trustlessid")
- Set a strong database password (save it!)
- Choose a region close to you
- Click "Create new project"
-
Run the schema:
- Wait for project to finish setup (~2 min)
- Go to SQL Editor in the left sidebar
- Click "New Query"
- Copy the entire contents of
supabase-schema.sqlfrom this project - Paste and click "Run"
- You should see "Success. No rows returned"
-
Get your API keys:
- Go to Settings → API
- Copy these two values:
Project URL→NEXT_PUBLIC_SUPABASE_URLanon/publickey →NEXT_PUBLIC_SUPABASE_ANON_KEY
- Go to Settings → API → Service Role Key (click "Reveal")
- Copy
service_rolekey →SUPABASE_SERVICE_ROLE_KEY ⚠️ Never share this key publicly!
- Copy
-
Create a Cloudinary account at https://cloudinary.com
- Sign up for free (no credit card required)
-
Get your API credentials:
- Go to Settings → Account
- Copy these three values:
Cloud Name→NEXT_PUBLIC_CLOUDINARY_CLOUD_NAMEAPI Key→CLOUDINARY_API_KEYAPI Secret→CLOUDINARY_API_SECRET
-
Copy the example env file:
cp .env.example .env.local
-
Edit
.env.localwith your credentials:# Supabase NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key SUPABASE_SERVICE_ROLE_KEY=your-service-role-key # Cloudinary NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your-cloud-name CLOUDINARY_API_KEY=your-api-key CLOUDINARY_API_SECRET=your-api-secret # JWT Secret (generate a random 32+ character string) JWT_SECRET=your-super-secret-random-string-min-32-chars # App URL NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Generate a JWT secret:
- Run this in your terminal:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" - Copy the output and paste it as
JWT_SECRET
- Run this in your terminal:
-
Install dependencies:
npm install
-
Start development server:
npm run dev
-
Open the app:
- Visit http://localhost:3000
- You should see the landing page!
-
Test the flow:
- Click "Get Started"
- Sign up with any email (e.g.,
test@example.com) - Upload a test document (PDF or image)
- Complete the identity creation wizard
- Verify your credential on the
/verifypage
After setup, verify everything is working:
- Landing page loads at http://localhost:3000
- Can create account with email
- Dashboard shows user profile
- Can upload a document file
- AI verification completes successfully
- Fraud detection runs
- Credential is issued with hash
- Can verify credential on
/verifypage - Data persists in Supabase (check the dashboard)
The following tables are created in Supabase:
| Table | Purpose |
|---|---|
users |
User profiles (linked to Supabase auth) |
documents |
Uploaded identity documents |
credentials |
Issued blockchain credentials |
verification_results |
AI verification results |
fraud_results |
Fraud detection results |
activity_logs |
User activity timeline |
To see your data in Supabase:
- Go to Table Editor in Supabase dashboard
- Select any table (e.g.,
users) - You'll see all records created through the app
- Check that your Supabase schema was run successfully
- Verify
NEXT_PUBLIC_SUPABASE_URLandANON_KEYare correct - Check Supabase Logs for errors
- Verify Cloudinary credentials in
.env.local - Check file size (max 10MB) and type (PDF, JPEG, PNG)
- Check Cloudinary dashboard for upload logs
- Ensure
JWT_SECRETis at least 32 characters - Restart the dev server after changing
.env.local
# Kill process on port 3000
lsof -ti:3000 | xargs kill -9
# Then restart: npm run dev- Supabase database integration
- JWT-based authentication
- Cloudinary file upload
- PostgreSQL schema with RLS policies
- Database CRUD operations
-
POST /api/auth/login- JWT auth -
GET/POST /api/documents- Document management -
GET/POST /api/credentials- Credential issuance -
GET /api/verify- Public verification -
POST /api/ai/analyze- AI verification (mock, ready for real API) -
POST /api/ai/fraud-detection- Fraud detection (mock, ready for real API) -
POST /api/upload- File upload to Cloudinary
- Login/Signup with loading states
- Dashboard with real data
- Create Identity with file upload
- Public Verification page
Replace mock AI with real APIs:
- Google Cloud Vision API for document analysis
- AWS Rekognition for text extraction
- Onfido for identity verification
- Deploy smart contract to Polygon Mumbai testnet
- Store credential hashes on-chain
- Update
/api/credentialsto write to blockchain
- Add rate limiting
- Implement proper error boundaries
- Add monitoring/logging (Sentry, LogRocket)
- Set up CI/CD pipeline
- Docs: https://supabase.com/docs
- Discord: https://discord.supabase.com
- Docs: https://nextjs.org/docs
- Discord: https://discord.gg/nextjs
Once setup is complete, here's the demo flow:
-
Landing Page (http://localhost:3000)
- Show hero section
- Scroll through features
-
Create Account
- Use
demo@example.com - Instant signup
- Use
-
Create Identity
- Fill basic details
- Upload a test document (any PDF/image)
- Watch AI verification (1.5s delay)
- Watch fraud detection (2s delay)
- Get credential with blockchain hash
-
Verify Credential
- Go to
/verify - Enter the credential ID
- Show trust score and privacy notice
- Go to
Total time: ~3 minutes
Good luck with your MVP! 🚀
If you run into any issues, check the troubleshooting section or reach out to the team.