- drizzle-orm installed
- @neondatabase/serverless installed
- @google/generative-ai installed
- drizzle-kit installed (dev)
- zod already present
- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
- CLERK_SECRET_KEY
- GEMINI_API_KEY
- WEATHER_API_KEY
- DATABASE_URL (fixed format)
- users table defined
- scene_analyses table defined
- analysis_artifacts table defined
- artifact_type enum defined
- Foreign key relationships set
- Gemini parser (fact extraction only)
- Risk analyzer (deterministic rules)
- Cost analyzer (qualitative)
- Weather service (Visual Crossing API)
- Planning insights (templates)
- POST /api/scene/analyze implemented
- Auth check with Clerk
- Input validation with Zod
- Error handling
- Database persistence
- Artifact storage
- BACKEND_DOCS.md (API reference)
- QUICK_START.md (setup guide)
- IMPLEMENTATION_SUMMARY.md (overview)
- Code comments throughout
npm installExpected output:
added X packages in Xs
npm run db:generateExpected output:
✓ Generating migrations...
✓ Migrations generated in ./drizzle
npm run db:pushExpected output:
✓ Applying migrations...
✓ Schema updated successfully
Verify in Neon Dashboard:
- Go to https://console.neon.tech
- Select your project
- Check Tables tab
- Confirm: users, scene_analyses, analysis_artifacts exist
npm run devExpected output:
▲ Next.js 16.1.6
- Local: http://localhost:3000
✓ Ready in Xs
Request:
POST /api/scene/analyze
{
"sceneDescription": "Interior office, single character at desk",
"sceneCategory": "Indoor",
"timeOfDay": "Day"
}Expected:
- ✅ Status: 200 OK
- ✅ Low risk signals
- ✅ Low cost pressure
- ✅ No weather data
- ✅ Indoor planning recommendations
Request:
POST /api/scene/analyze
{
"sceneDescription": "Park scene with children playing",
"sceneCategory": "Outdoor",
"timeOfDay": "Day",
"location": "Seattle, WA",
"month": "November"
}Expected:
- ✅ Status: 200 OK
- ✅ Weather dependency risk
- ✅ Weather feasibility data included
- ✅ Rain/wind averages
- ✅ Production recommendations
Request:
POST /api/scene/analyze
{
"sceneDescription": "Downtown car chase with explosions, crowds, and stunt drivers",
"sceneCategory": "Outdoor",
"timeOfDay": "Night",
"location": "New York, NY",
"month": "July"
}Expected:
- ✅ Status: 200 OK
- ✅ Multiple high-risk signals
- ✅ Multiplier applied (1.3x)
- ✅ High cost pressure
- ✅ Multiple cost drivers
- ✅ Detailed explanations
Request:
POST /api/scene/analyze
{
"sceneDescription": "Green screen studio, sci-fi spaceship interior",
"sceneCategory": "VFX"
}Expected:
- ✅ Status: 200 OK
- ✅ No weather data
- ✅ VFX-specific cost drivers
- ✅ Studio recommendations
- ✅ Post-production notes
Request:
POST /api/scene/analyze
{
"sceneDescription": "Outdoor park",
"sceneCategory": "Outdoor"
}Expected:
- ✅ Status: 400 Bad Request
- ✅ Error: "Outdoor scenes require both location and month"
- ✅ Detailed validation errors in response
Request: No Clerk token
Expected:
- ✅ Status: 401 Unauthorized
- ✅ Error: "Unauthorized"
SELECT * FROM users ORDER BY created_at DESC LIMIT 5;Expected: See user records with clerk_user_id
SELECT
id,
scene_description,
created_at,
final_analysis_json->>'sceneMetadata'
FROM scene_analyses
ORDER BY created_at DESC
LIMIT 5;Expected: See analysis records with full JSON
SELECT
artifact_type,
COUNT(*) as count
FROM analysis_artifacts
GROUP BY artifact_type;Expected:
gemini_parse | 5
risk_engine | 5
cost_engine | 5
weather_snapshot | 2 (only for outdoor scenes)
- Dependencies installed without errors
- Database migrations applied successfully
- Development server starts without crashes
- API accepts authenticated requests
- All test cases return expected responses
- Database records are created correctly
- Artifacts are stored for each analysis
- Error handling works as expected
Solution:
- Check .env.local exists
- Verify DATABASE_URL format (no 'psql' prefix)
- Restart dev server: Ctrl+C then
npm run dev
Solution:
- Verify Clerk is configured correctly
- Check user is logged in
- Inspect browser dev tools for auth token
- Verify Clerk middleware is active
Solution:
- Verify GEMINI_API_KEY in .env.local
- Check API quota at https://makersuite.google.com
- Test key with simple curl request
- Ensure key has Gemini API enabled
Solution:
- Verify WEATHER_API_KEY
- Check location format: "City, State" or "City, Country"
- Ensure month is spelled correctly (e.g., "January")
- Verify API quota at visualcrossing.com
Solution:
- Verify Neon database is active
- Check connection string format
- Test connection in Neon dashboard
- Ensure SSL mode is correct
- All dependencies installed
- Database migrated successfully
- Dev server running
- Tested all 3 scene categories (Indoor, Outdoor, VFX)
- Verified database records are created
- Prepared example requests in Postman/Thunder Client
- Reviewed BACKEND_DOCS.md to answer questions
- Can explain architecture decisions
- Can show database records in Neon dashboard
- Can demonstrate artifact storage
"We built a clean, deterministic backend that prioritizes explainability over complexity."
"Gemini only extracts facts from descriptions. All decisions use rule-based logic, making every recommendation auditable and explainable."
"Every analysis is stored with complete audit trail. We save intermediate outputs as artifacts so we can trace exactly how each decision was made."
"This isn't a prototype - it's production-quality code with proper error handling, validation, and type safety throughout."
"The modular architecture makes it easy to add new risk types, cost drivers, or analysis dimensions without breaking existing functionality."
Complete backend skeleton built for SceneGuard:
- ✅ Clean architecture
- ✅ Explainable decisions
- ✅ Complete auditability
- ✅ Production-ready quality
- ✅ Demo-ready functionality
Time to shine at the hackathon! 🌟