Complete walkthrough from zero to functional prototype in ~30 minutes.
- Python 3.10+ (check with
python3 --version) - Node.js 16+ (optional, if using Next.js instead of plain HTML)
- Git (for version control)
- API Keys:
- OpenAI (
https://platform.openai.com) — GPT-5.6 (vision + language)
- OpenAI (
cd /home/samarine/Desktop/coding
mkdir -p cradleAI
cd cradleAI
# Or if using git:
# git clone https://github.com/your-team/cradleAI.git
# cd cradleAIcd backend
# Create venv
python3 -m venv venv
# Activate
source venv/bin/activate # macOS/Linux
# or
venv\Scripts\activate # Windowspip install -r requirements.txt
# This installs:
# - FastAPI + Uvicorn (server)
# - SQLAlchemy + SQLite (database)
# - OpenCV (video processing)
# - librosa (audio features)
# - openai (GPT-5.6 vision + language)❗ Note: Depending on your system, some packages (OpenCV, librosa) may require additional dependencies:
macOS:
brew install ffmpeg libsndfileLinux (Debian/Ubuntu):
sudo apt-get install ffmpeg libsndfile1Windows: Most packages include pre-built wheels; FFmpeg must be installed separately.
# Copy example
cp .env.example .env
# Edit .env with your keys
nano .env
# or
code .env # VS CodeRequired:
OPENAI_API_KEY=sk-... (GPT-5.6)
DATABASE_URL=sqlite:///./cradle_ai.db
CORS_ORIGINS=http://localhost:3000,http://localhost:8000,http://localhost:8001,http://localhost:5173
# FastAPI will auto-create tables on first startup
# OR manually:
python -c "from app.database.db import init_db; init_db()"python app/main.py
# Or with auto-reload:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000✅ Success: Visit http://localhost:8000/docs (Swagger UI)
cd ../frontend
# Python 3
python -m http.server 8001
# Or Python 2
python -m SimpleHTTPServer 8001✅ Success: Visit http://localhost:8001
If you prefer a modern JS framework:
# Create Next.js app
npx create-next-app@latest --typescript
# Copy our design into app/page.tsx
# Update API calls to use Next.js fetch
# npm run dev- Visit
http://localhost:8001(frontend) - Click "Choose file" → Select a short MP4 (30s–2min)
- Watch progress in browser console
In a separate terminal:
cd backend
# Watch for processing logs
tail -f /tmp/cradle_ai.log # or wherever your logs go# View SQLite directly
sqlite3 cradle_ai.db
# Inside SQLite:
.tables # List tables
SELECT COUNT(*) FROM videos; # Check uploads
SELECT * FROM analyses LIMIT 1; # View results
.quit-
Prepare repo (if using GitHub):
git init git add . git commit -m "Initial commit" git push origin main
-
Create Render service:
- Go to
https://render.com - "New" → "Web Service"
- Connect GitHub repo
- Settings:
- Build Command:
pip install -r backend/requirements.txt - Start Command:
cd backend && uvicorn app.main:app --host 0.0.0.0 --port 10000
- Build Command:
- Environment: Add env vars (OPENAI_API_KEY, etc.)
- Deploy
- Go to
-
Test:
curl https://your-service.onrender.com/health
-
Update API endpoint in
frontend/js/api.js:const API_BASE = 'https://your-service.onrender.com';
-
Deploy:
- Go to
https://vercel.com - Import project
- Set Framework: None (static files)
- Deploy
- Go to
Issue: ModuleNotFoundError: No module named 'cv2'
Fix:
pip install opencv-python --upgradeIssue: ffmpeg not found
Fix: Install ffmpeg for your OS (see prerequisites)
Issue: CORS error in browser console
Fix:
- Check backend is running:
curl http://localhost:8000/health - Verify
CORS_ORIGINSin.envincludes frontend URL - Restart backend after changing
.env
Issue: 401 Unauthorized from OpenAI
Fix:
- Verify key in
.env(check for typos, leading/trailing spaces) - Test key directly:
curl -H "Authorization: Bearer YOUR_KEY" https://api.openai.com/v1/models - Regenerate key if needed
Terminal 1 — Backend:
cd backend && source venv/bin/activate && python app/main.pyTerminal 2 — Frontend:
cd frontend && python -m http.server 8001Terminal 3 — Git (optional):
cd /path/to/cradleAI && git statusTerminal 4 — Debug:
curl http://localhost:8000/api/videos- Backend running locally without errors
- Frontend loads at
http://localhost:8001 - Can drag & drop video → status updates
- Analysis completes without crashing
- Results dashboard populates
- API keys not committed to repo (in .env, ignored by git)
- UI works on mobile (responsive CSS)
- No console errors
- README updated with your team info
- Deployed to Render + Vercel (or similar)
- Run a 5–30 second sample video through the full upload flow with a real API key.
- Implement the GPT-5.6 summary generator (
generate_summaryis the last remaining stub). - Fill the README Codex Session ID, truthful Codex contribution notes, team names, and demo URL.
- Share the private repository with the two hackathon judging addresses.
- Verify the demo on a clean machine before submitting.
- FastAPI docs:
https://fastapi.tiangolo.com - OpenAI API:
https://platform.openai.com/docs - OpenCV:
https://docs.opencv.org - Render deployment:
https://render.com/docs - Vercel deployment:
https://vercel.com/docs
Good luck! You've got 6 days. Ship it! 🚀