Interactive lab for exploring gradient-domain image editing and simple synthetic-image detection. The Python backend handles gradient computation, Poisson-based reconstruction, and lightweight analysis; the Next.js frontend focuses on visualization and user interaction.
backend/— FastAPI service with gradient ops, Poisson solver, and analysis utilitiesfrontend/— Next.js App Router UI (lab, analyzer, about)Docs/— architecture, frontend, and backend guides (English)
Requirements: Python 3.11+ recommended.
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r backend/requirements.txtRun the API (auto-creates static folders on startup):
uvicorn backend.main:app --reload --port 8000The app mounts static assets at /static and exposes routes for image upload, gradient computation, reconstruction, and analysis.
Requirements: Node.js 18+ (Next.js 16) and npm.
cd frontend
npm install
npm run dev -- --port 3000Configuration:
- API base URL:
NEXT_PUBLIC_API_URL(defaults tohttp://localhost:8000). Set it in.env.localinsidefrontend/if the backend runs elsewhere.
Main routes:
/— intro and entry points/lab— gradient editing lab (upload, view dx/dy, edit, reconstruct)/analyzer— synthetic analyzer (compare gradients/heatmaps, show scores)/about— short backgrounder
POST /api/images— upload an image, returnsimageIdand dimensionsGET /api/gradients?imageId=...— compute dx/dy and visualizationsPOST /api/reconstruct— send edited gradients and receive reconstructed image URLPOST /api/analyze— get simple gradient-based scores and optional heatmap
Docs/Architecture.md— high-level system viewDocs/Backend.md— backend design and API detailsDocs/Frontend.md— frontend routing, components, and UX guidance


