Spaces:
Sleeping
Sleeping
@arac-hasar/web
Next.js 15 (App Router) frontend for the HasarΔ° β araΓ§ hasar tespiti MVP.
Stack
- Next.js 15 + React 18.3 + TypeScript (strict)
- Tailwind CSS 3.4 with shared preset from
@arac-hasar/ui - Shared UI components from
@arac-hasar/ui - Shared types from
@arac-hasar/types axiosfor backend calls (FastAPI on:8000)
Quick start
From the monorepo root:
pnpm install
pnpm --filter @arac-hasar/web dev
# or
pnpm dev:web
App will be available at http://localhost:3000.
Make sure the backend is running on :8000:
pnpm backend:dev
Environment
Copy .env.example to .env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000
# BACKEND_API_KEY=dev-secret # optional β used only by /api/inspect proxy
| Variable | Required | Purpose |
|---|---|---|
NEXT_PUBLIC_API_URL |
yes | Base URL of the FastAPI backend |
BACKEND_API_KEY |
no | Forwarded by /api/inspect (server) |
Routes
| Path | Description |
|---|---|
/ |
Landing β value props + CTA |
/inspect |
Multi-file upload + mode selection (sync / async) |
/results/[id] |
Inspection result with polling + part-centric UI |
/history |
Past inspections grid (falls back to demo data) |
/api/inspect |
Optional pass-through to backend POST /api/v1/inspect |
Scripts
| Script | Purpose |
|---|---|
pnpm dev |
Dev server (:3000) |
pnpm build |
Production build |
pnpm start |
Run prod server |
pnpm lint |
ESLint |
pnpm typecheck |
tsc --noEmit |
Backend endpoints consumed
POST /api/v1/inspectβ multipart upload, returnsinspection_id(queued)POST /api/v1/inspect/syncβ inline (β€ 5 images)GET /api/v1/inspect/{id}β status + result (polled every 2 s, max 60 s)GET /api/v1/inspectβ history list (paginated)GET /healthβ liveness probe (/healthzkept as alias)
Contract: packages/types/src/api.ts. Full reference: docs/API_GUIDE.md.
Folder layout
apps/web/
ββ app/
β ββ layout.tsx Root layout (Header, Footer, Inter font)
β ββ globals.css Tailwind + UI styles
β ββ page.tsx Landing
β ββ inspect/page.tsx Upload flow
β ββ results/[id]/page.tsx Result + polling
β ββ history/page.tsx History grid
β ββ api/inspect/route.ts Backend proxy
ββ components/ Web-only components
β ββ Header.tsx
β ββ Footer.tsx
β ββ PartList.tsx Part-centric list (damaged sorted + clean)
β ββ ResultsTabs.tsx 3 tabs (overview/parts/damages) + overlay
ββ lib/
β ββ api.ts Typed axios wrappers
β ββ use-inspection-polling.ts
ββ next.config.ts
ββ tailwind.config.ts
ββ tsconfig.json