Total time about 30 mins
Prompt:
Scaffold a monorepo project with backend and frontend directories.
Requirements:
- Backend should be a FastAPI service (latest version).
- Use "uv" as the dependency manager and package installer for Python.
- Include two endpoints:
- GET /health → returns {"status": "ok"}
- POST /upload → accepts a file upload (e.g., multipart/form-data) and returns filename + size.
- Place the FastAPI service inside the `backend` directory with proper project structure:
- backend/
- app/
- main.py
- routes/
- pyproject.toml (configured for uv)
- README.md
- Frontend directory can remain empty for now (placeholder).
- Add clear instructions in the README.md for installing dependencies with uv and running the FastAPI app.
- Use context7 to fetch the latest FastAPI documentation and best practices.
Total time about 20 mins
What it does: Sets up a Vite React (JS) app in frontend/ with Tailwind and shadcn/ui so we have a modern UI foundation.
Prompt:
Scaffold a React app in
frontend/using Vite (JavaScript template). Configure Tailwind (tailwind.config.jscontent forindex.htmlandsrc/**/*.{js,jsx}, add@tailwind base; @tailwind components; @tailwind utilities;tosrc/index.css). Install tailwindcss@^3.4.0,postcss, andautoprefixer. Install shadcn/ui prerequisites (clsx,tailwind-merge,lucide-react), add Button, Input, Progress, Toaster undersrc/components/ui/, and mount<Toaster />at app root. Verifynpm run devrenders a styled sample.
Acceptance Criteria:
- Project runs from
frontend/withdev,build,previewscripts. - Tailwind utilities render correctly in a sample component.
- shadcn/ui
Button,Progress,Toasterare available viasrc/components/ui/*. -
<Toaster />mounted once at root; no console errors.
What it does: Adds React Router and a dedicated /upload page to host the image uploader.
Prompt:
Add
react-router-dom. Wrap the app in<BrowserRouter>. Create a route/uploadthat renderssrc/pages/UploadPage.jsx. InUploadPage.jsx, show a heading “Image Upload” and placeholder text. Keep<Toaster />global.
Acceptance Criteria:
- Navigating to
/uploadrendersUploadPage.jsx. - No hydration/console warnings.
- Toaster still visible globally across routes.
Total time about 10 mins
What it does: Lets users choose one or more images and shows the chosen files in the UI.
Prompt:
In
UploadPage.jsx, implement a hidden<input type="file" accept="image/*" multiple />triggered by a shadcnButton(“Select Images”). Store selected files in state and render a list (filename + human-readable size). Show an empty state when none selected. Reject or warn for non-image files.
Acceptance Criteria:
- Users can select multiple images and see filenames + sizes.
- Non-image files are blocked or clearly warned.
- Empty state visible when no files selected.
- Button/input accessible via keyboard with proper label/aria-label.
Total time about 30 mins
What it does: Provides an upload helper that posts multipart/form-data to the backend and reports progress.
Prompt:
Create
src/lib/api.jsexportinguploadImages(files, onProgress). Useaxiosto POSTFormDatato${import.meta.env.VITE_API_BASE_URL ?? ""}/api/upload. Append each file asfiles[]. UseonUploadProgressto emit integer percent (0–100) to the callback. Add a top-of-file comment documenting the request contract (multipart,files[]) and support both single/multi files.
Acceptance Criteria:
-
uploadImages(files, onProgress)exists and returns parsed response data. - Progress callback receives 0–100 during upload.
- Uses
VITE_API_BASE_URLwhen present; otherwise relative/api/upload. - Body is
multipart/form-datawithfiles[].
What it does: Wires the UI to call the API helper, shows a progress bar, and notifies success/failure.
Prompt:
In
UploadPage.jsx, add a shadcnButton“Upload” that callsuploadImages(selectedFiles, setProgress). Disable if no files or while uploading. Show a shadcnProgresscomponent bound to progress state. On success: toast “Upload complete”, reset selected files and progress to 0. On error: toast a short failure message and restore UI to idle.
Acceptance Criteria:
- Clicking “Upload” triggers backend call and animates progress.
- Success toast shown; files/progress reset.
- Failure toast shown; UI re-enabled for retry.
- Duplicate submissions prevented during in-flight uploads.
What it does: Polishes the page’s look, ensures accessibility, and documents how to run/integrate.
Prompt:
Style
/uploadwith a centered card layout (max-w, padding, rounded corners, subtle shadow) using Tailwind + shadcn/ui. Ensure visible focus states and proper labels/aria-labels for all interactive elements. Addfrontend/README.mdwith environment setup (VITE_API_BASE_URL=http://localhost:8000), quick-start commands, and a final acceptance checklist. (Optional) Add drag-and-drop with previews if time allows.
Acceptance Criteria:
- Modern, clean page consistent with Tailwind + shadcn/ui.
- Keyboard navigation and focus states verified; inputs labeled.
-
frontend/README.mdincludes env config and acceptance checklist. - (Optional) Drag-and-drop with previews works without breaking basic flow.
-
/uploadpage exists and is reachable. - Users can select and upload one or multiple images.
- Uploads hit backend and show progress + success/failure feedback.
- Page uses shadcn/ui components and app is bootstrapped with Vite under
frontend/.