This is a minimal AI-integrated web application that takes a user prompt, generates a short AI-created video using the Vadoo AI API, and displays the result in the browser.
Built with FastAPI for the backend and vanilla HTML/CSS/JS for the frontend. Deployed publicly on Render.
- Prompt to Video – Enter text and get a generated short video (5–10 seconds+ depending on API).
- Vadoo API Integration – Uses the
generate_videoendpoint. - Webhook Support – Receives video completion callbacks from Vadoo.
- Polling Fallback – UI polls backend
/job-statusfor updates. - Bonus Features:
- Loading spinner while video is generating
- Prompt template enhancement (
cinematic, high qualityappended automatically) - Video history so users can rewatch
- Caching to avoid API rate-limit hits (optional)
.
├── backend/
│ ├── main.py # FastAPI backend
│ ├── requirements.txt # Backend dependencies
│ └── .env # Environment variables (NOT committed to GitHub)
│
├── frontend/
│ ├── index.html # Main UI
│ ├── style.css # Basic styles
│ └── script.js # API calls, UI updates
│
├── README.md
└── LICENSE
Create a .env file in backend/ with:
VADOO_API_KEY=your_vadoo_api_key_here
BACKEND_BASE_URL=https://<your-render-service>.onrender.comImportant:
- Do not commit
.envto GitHub. - On Render, set these in Environment → Environment Variables.
-
Clone the repo
git clone https://github.com/adityawalture/Text-to-Video-webapp.git cd ai-video-webapp -
Install backend dependencies
cd backend pip install -r requirements.txt -
Run FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
-
Open frontend locally
- Open
frontend/index.htmlin your browser. - Make sure
BACKEND_URLinscript.jspoints tohttp://localhost:8000.
- Open
- Push code to GitHub.
- Create a Web Service in Render:
- Root Directory:
backend - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn main:app --host 0.0.0.0 --port 10000
- Root Directory:
- Set
VADOO_API_KEYandBACKEND_BASE_URLin Render Environment. - Deploy.
- Set Webhook URL in Vadoo dashboard:
https://<your-render-service>.onrender.com/webhook/vadoo - App url: https://adityawalture.github.io/Text-to-Video-webapp/frontend/
-
User Prompt
- Enter text in UI → POST to
/generate-video.
- Enter text in UI → POST to
-
Video Generation
- Backend sends request to Vadoo API with API key.
- Returns
job_idto frontend.
-
Webhook Update
- Vadoo calls
/webhook/vadoowhen video is ready. - Backend stores
video_urlin memory/cache.
- Vadoo calls
-
Frontend Polling
- UI calls
/job-status?job_id=...until status is"complete". - Displays video player with generated video.
- UI calls
You can simulate a completed job:
curl -X POST https://<your-render-service>.onrender.com/webhook/vadoo -H "Content-Type: application/json" -d '{"vid":"test-123","status":"complete","url":"https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4"}'Then:
curl "https://<your-render-service>.onrender.com/job-status?job_id=test-123"- Vadoo free tier has limited generations — you may hit
"Generation limits over"errors. - The mock video fallback allows UI testing without consuming credits.
- No API keys are stored in the frontend — all calls go through the backend.