This backend application is built using FastAPI and is designed to generate videos based on user-defined topics and backgrounds. It integrates multiple AI services for text generation, audio synthesis, image creation, and subtitle generation. The application handles various tasks, including cleaning text, formatting subtitles, and generating video files using FFmpeg.
- Clone the repository:
git clone https://github.com/LohiyaH/VidCraft cd shorty
- Install the required dependencies:
pip install -r backend/requirements.txt
- Set up environment variables in a
.env
file:GEMINI_API_KEY=<your-gemini-api-key> ELEVENLABS_API_KEY=<your-elevenlabs-api-key> HUGGINGFACE_API_KEY=<your-huggingface-api-key>
- Run the FastAPI application:
uvicorn backend.main:app --reload
- Access the API documentation at
http://localhost:8000/docs
.
- cd frontend
- npm install
- npm run dev
-
POST
/api/generate-video
- Request Body:
{ "topic": "string", "background": "string" }
- Response:
{ "videoUrl": "string" }
- Request Body:
-
GET
/api/test
- Returns a simple test message.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.