Get your VerifyAI database up and running in 5 minutes!
- Go to your Supabase project dashboard: https://supabase.com/dashboard
- Click on SQL Editor in the left sidebar
- Click New Query
- Open
/home/user/VerifyAI/lib/supabase/schema.sql - Copy all the content (Ctrl+A, Ctrl+C)
- Paste into the Supabase SQL Editor
- Click Run (or press Ctrl+Enter)
- Wait for "Success" message
- Click Table Editor in the left sidebar
- You should see 7 tables:
- users
- queries
- search_results
- user_sessions
- query_feedback
- api_usage
- saved_searches
The .env.local file has already been created with your credentials:
cat .env.localYou should see:
NEXT_PUBLIC_SUPABASE_URL=https://allfsdplvrifxbcbmmvg.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_ROLE_KEY=...Dependencies are already installed! Verify:
npm list @supabase/supabase-js @supabase/ssrStart your development server:
npm run devPerform a search in the application, then check your Supabase dashboard:
- Go to Table Editor
- Click on queries table
- You should see your search query recorded!
Your database is now live and saving data automatically.
Every time someone searches:
- ✅ Query is saved to
queriestable - ✅ Search results saved to
search_resultstable - ✅ API usage tracked in
api_usagetable
All automatically, no additional code needed!
Want to do more? Check out:
- DATABASE_SETUP.md - Complete setup guide
- lib/db/README.md - How to use database functions
- lib/db/examples.ts - Copy-paste code examples
- IMPLEMENTATION_SUMMARY.md - Full technical details
You've already run the schema. This is fine! Skip Step 1.
Check .env.local exists and has all three variables. Restart your dev server:
# Stop the server (Ctrl+C)
npm run dev- Make sure you restarted the dev server after creating
.env.local - Check the browser console for errors
- Verify Supabase credentials are correct
import { getQueryHistory } from '@/lib/db/queries'
const history = await getQueryHistory(userId, { limit: 20 })import { saveQuery } from '@/lib/db/queries'
const query = await saveQuery({
user_id: userId,
query_text: 'What is AI?',
query_type: 'web',
sources_count: 5,
was_successful: true,
})import { getTodayStats } from '@/lib/db/queries'
const stats = await getTodayStats()
console.log(`Total queries today: ${stats?.total_queries}`)- Check the error in browser console
- Check Supabase dashboard logs
- Review DATABASE_SETUP.md troubleshooting section
- Check lib/db/README.md for function details
You now have a production-ready database tracking all your searches and API usage!
Total Setup Time: ~5 minutes Difficulty: Easy Next Step: Explore the documentation files to learn more!