Your current Node.js version (v20.0.0) is too old. You need:
- Minimum: Node.js 20.19.0
- Recommended: Node.js 22.12.0 or later
Install latest Node.js:
- Download from https://nodejs.org/
- Or use nvm:
nvm install 22 && nvm use 22
Option A: Docker (Easiest)
# Just run this - no manual dependency installation needed!
docker-compose up --buildOption B: Local Development
Backend:
cd backend
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
uvicorn main:app --reloadFrontend (after updating Node.js):
cd frontend
npm install
npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Allow camera access when prompted by browser
- Click "Detect Cards" to analyze current frame
- Watch the count update in real-time via SSE
- Click "Reset Count" to start over
The app uses a generic YOLOv8n model as a placeholder. It will detect objects but NOT playing cards specifically.
To detect actual cards, you need to:
- Train a custom model on playing card dataset (see README.md)
- Place trained model (
your_model.pt) inbackend/folder - Update
backend/.env:MODEL_PATH=your_model.pt
Auto-generate route tree:
cd frontend
npm run dev # Generates routeTree.gen.ts automaticallyView API documentation:
- Visit http://localhost:8000/docs for interactive Swagger UI
- Or http://localhost:8000/redoc for ReDoc
Check backend logs:
docker logs card-detection-backend -fCheck frontend logs:
docker logs card-detection-frontend -fcard-detection/
├── frontend/app/ # Your React code here
│ ├── routes/ # Add new pages here
│ ├── components/ui/ # shadcn components
│ └── api/detection/ # API functions
├── backend/
│ ├── routers/ # Add new endpoints here
│ └── services/ # Business logic
└── docker-compose.yml # Start everything
# Start everything with Docker
docker-compose up
# Rebuild after changes
docker-compose up --build
# Stop all services
docker-compose down
# View logs
docker-compose logs -f
# Backend only (local)
cd backend && uvicorn main:app --reload
# Frontend only (local)
cd frontend && npm run dev
# Install new npm package
cd frontend && npm install <package-name>
# Install new Python package
cd backend && pip install <package-name>
# Then: pip freeze > requirements.txt- Train Card Detection Model (see README.md)
- Add more routes in
frontend/app/routes/ - Create custom components in
frontend/app/components/ - Add backend endpoints in
backend/routers/ - Deploy to cloud (AWS, GCP, Azure)
Node version error:
- Update to Node.js 22+ (see step 1 above)
Camera not working:
- Use HTTPS or localhost
- Check browser permissions
- Try Chrome or Firefox
Can't install dependencies:
- Delete
node_modules/and runnpm installagain - Delete
venv/and create fresh virtual environment
Docker issues:
- Run
docker-compose down -vto remove volumes - Run
docker system pruneto clean up
- Check README.md for detailed documentation
- Review
.claude/patterns.mdfor code patterns - Inspect existing code in
frontend/app/routes/index.tsx - Check FastAPI docs at
/docsendpoint
You're ready to go! 🚀
Start with: docker-compose up --build