Welcome to the server-side of our Upload AI project! This is where all the heavy lifting happens, from processing video uploads to generating AI-powered transcriptions and more. While the frontend might be the face of our project, this backend is the brain and the brawn.
- Node.js and Fastify: For crafting our server and API with speed and efficiency.
- Prisma: Our go-to ORM for handling database interactions smoothly.
- Zod: For robust validation, making sure our data is in good shape.
- OpenAI's GPT: Powers the AI transcriptions and interactions.
To get this backend up and running:
- Clone this repo:
git clone https://github.com/diogoazevedoo/upload-ai-api- Install the dependencies (make sure you've got Node.js installed):
cd upload-ai-api
pnpm install- Create a
.envfile in the root of the project with the following content:
DATABASE_URL="file:./dev.db"
OPENAI_KEY="your_openai_api_key_here"
This setup uses SQLite for ease of testing, and you'll need to fill in your OpenAI API key.
- Run the Prisma migration to set up your database schema:
pnpm prisma migrate dev- Seed your database with prompt templates:
pnpm prisma db seed- Fire up the server:
pnpm run devHere's what you can do with our backend API:
| Route | Method | Description |
|---|---|---|
/videos |
POST | Upload a video file for processing. |
/videos/:videoId/transcription |
POST | Generate a transcription for a given video. |
/prompts |
GET | Retrieve all prompts/questions for AI interaction. |
/ai/complete |
POST | Get AI-generated responses based on video content and prompts. |
Want to add more features or tweak the existing ones? The code's all yours! Dive into the src folder to explore and expand. The routes directory will be your roadmap to understanding and enhancing how the backend serves the frontend.
Your ideas and contributions are welcome! Whether it's bug fixes, new features, or improvements to the documentation, feel free to fork this repo and send over your pull requests.
Got questions or ideas? Let's chat! Reach out to me on Linkedin