Skip to content

Conversation

@sandeepsalwan1
Copy link
Owner

@sandeepsalwan1 sandeepsalwan1 commented Sep 17, 2025

Add a full-stack FastAPI web application with a video upload UI and AI behavior analysis, along with Docker and Render deployment configurations.


Open in Cursor Open in Web


Summary by cubic

Build a full-stack FastAPI app for uploading animal videos and generating a behavior report. Adds a simple web UI, a single API endpoint, and Docker/Render configs for easy deployment.

  • New Features

    • FastAPI app with static UI at / and POST /api/analyze (multipart form field: video).
    • Accepts mp4/mov/avi/mkv, samples frames with OpenCV, returns JSON { "report": string }.
    • Simple upload UI with status, error handling, and output textarea.
    • CORS enabled; temp file handling and basic validation.
  • Deployment

    • Dockerfile (python:3.11-slim, installs ffmpeg, exposes 8000).
    • render.yaml for one-click deployment; requires env var OPENAI_API_KEY.
    • README quickstart for local run and Docker usage.
    • Adds requirements-web.txt and a focused .dockerignore.

Co-authored-by: salwansandeep5 <[email protected]>
@cursor
Copy link

cursor bot commented Sep 17, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@sandeepsalwan1
Copy link
Owner Author

@cursor make it so it's easy to deploy and the ui is unique and looks great

@cursor
Copy link

cursor bot commented Sep 17, 2025

I completely redesigned the app/static/index.html page, implementing a modern dark theme with a two-column grid layout for improved aesthetics and organization. I also significantly enhanced the user experience for video uploads, adding drag-and-drop functionality and a video preview.

  • I completely overhauled the styling in app/static/index.html with a new dark theme, custom fonts, and a responsive two-column grid layout, replacing the previous basic design.
  • I implemented a new interactive "dropzone" (#dropzone) for video uploads, supporting drag-and-drop functionality and a dedicated file input.
  • I added a video preview element (<video id="vid">) to display the selected video before analysis, improving user feedback.
  • I introduced separate "Choose Video", "Analyze", and "Clear" buttons, along with a dynamic status display that includes a loading spinner.
  • I refactored the JavaScript logic to manage file selection, preview, and analysis state more robustly using functions like setFile(), setStatus(), and reset().

1 task completed

  • Restyle UI with unique, polished design and UX enhancements
  • Add health endpoint and dotenv support to backend
  • Update analysis to stable OpenAI image_url content format
  • Add docker-compose.yml and .env.example for easy local deploy
  • Adjust render.yaml to use healthz path
  • Update README with compose and one-click deploy notes
    Open in Cursor Open in Web

Learn more about Cursor Agents

@sandeepsalwan1
Copy link
Owner Author

@cursor make sure u can deploy it on vercel

@cursor
Copy link

cursor bot commented Sep 17, 2025

I made some changes to the Next.js client and the Edge API route to ensure the application is ready for deployment on Vercel. I fixed a TypeScript type error and adjusted the client to send only 12 downscaled frames to stay within Vercel's request size limits. After these modifications, I verified that the Next.js app builds cleanly.

To deploy the application, you can import the repository into Vercel, set the Root Directory to web, add your OPENAI_API_KEY as an environment variable, and then deploy. Alternatively, you can use the one-click deployment link provided in the README.


Open in Cursor Open in Web

Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants