ObjectAI is a full-stack object-detection workspace built with Next.js, FastAPI, MongoDB, and Ultralytics YOLO. It supports secure sign-in, image uploads, live webcam detection, labeled training-data intake, health monitoring, and per-user activity history.
- Next.js 15 App Router for the product UI and route handlers
- FastAPI for the Python inference service
- MongoDB + Mongoose for users and history logs
- Ultralytics YOLO for object detection
- Tailwind CSS + shadcn/ui for the interface
- Secure cookie-based authentication
- Single-image object detection with confidence threshold control
- Live webcam detection with frame sampling
- Labeled dataset intake for future custom-model training
- Searchable history filtered by type and status
- Health endpoint that reports web, database, and model readiness
npm installCopy .env.example to .env.local and update the values:
MONGODB_URI=mongodb://127.0.0.1:27017/objectAI
JWT_SECRET=replace-me-with-a-long-random-string
PYTHON_BACKEND_URL=http://127.0.0.1:8000
ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
YOLO_MODEL=yolo11n.ptnpm run setup-backendnpm run dev:allOr run them separately:
npm run dev
npm run dev:backendOpen http://localhost:3000/auth/register, create an account, then go to http://localhost:3000/detect.
npm run dev: start the Next.js appnpm run dev:backend: start the FastAPI appnpm run dev:all: run frontend and backend togethernpm run lint: run ESLintnpm run build: run the production buildnpm run setup-backend: create the Python virtualenv and install backend dependencies
POST /api/auth/registerPOST /api/auth/loginPOST /api/auth/logoutGET /api/auth/checkPOST /api/detectPOST /api/detect-framePOST /api/trainGET /api/historyGET /api/health
- The training tab currently collects and forwards labeled image batches. It does not launch automated model training jobs on its own.
- Large image previews are skipped when history rows are stored to avoid unnecessary MongoDB bloat.
- The Python backend defaults to
python-backend/yolo11n.pt, but you can override that withYOLO_MODEL.
The current production checks used for this repo are:
npm run lint
npm run build
python -m py_compile python-backend/app/main.py