Blog Post: Converting Videos into Technical Blog Posts
TextTriangleAI is a project designed to generate technical blog posts from various sources such as YouTube videos, YouTube shorts, local videos, and audio files (with a 30 MB limit). It leverages the Google Gemini AI API for language model tasks and AssemblyAI API for speech-to-text functionality.
The frontend is built with Next.js, Shadcn/UI, Tailwind CSS, and Highlight.js to render Markdown files into a web interface. On the backend i had build using Node.js, Express, JWT, MongoDB, and AssemblyAI Api, Google Gemini API, youtube-transcript packages are utilized.
- User registration and sign-in with error handling.
- Admin analytics: blog post generation, total hours processed.
- Content uploads: YouTube URLs, YouTube Shorts, MP4 videos, MP3 audio (max 30 MB).
- Credit check: Verify user credits before generating blog posts and manage available time for processing.
- AI-generated blog posts: view, edit, delete, save.
- Automatic code extraction from videos, audios and youtube url.
- Features: Word count, character count, dynamic table of contents, semantic analysis.
- Rendering: Markdown format with Next.js for a user-friendly interface.
- Transcription services:
- YouTube:
youtube-transcript
unofficial package. - Video/audio: AssemblyAI's speech-to-text API.
- YouTube:
- Google Gemini API: Transform transcriptions into blog posts.
- Frontend: Next.js, Shadcn/UI, Tailwind CSS, Highlight.js
- Backend: Node.js, Express.js, MongoDB
- AI APIs: Google Gemini AI API (for language model tasks), AssemblyAI API (for speech-to-text)
- YouTube Transcription:
youtube-transcript
(unofficial package for transcribing YouTube videos) - Authentication: JWT (JSON Web Tokens)
Make sure you have the following installed:
- Node.js (version 18 or higher)
- npm (Node Package Manager)
- MongoDB Installed Locally or Mongodb Cloud
- Google GeminiAI Api key & AssemblyAI Api key
- Clone the repository from [git clone https://github.com/bakkeshks/TextTriangleAI.git].
- Navigate to the project directory.
- Install dependencies using
npm install
. - Set up MongoDB and configure the connection string in the backend.
- Obtain API keys for Google Gemini AI and AssemblyAI and configure them in the backend.
- Run the backend server using
node app.js
(for development). - Run the frontend server using
npm run dev
in thefrontend
directory. - Access the application at
http://localhost:3000
in your web browser.
Clone the TextTriangleAI repository from GitHub:
git clone https://github.com/your-username/TextTriangleAI.git
cd TextTriangleAI/backend
Install the necessary dependencies using npm:
npm install
Add Gemini AI, AssemblyAI, JWT (random no) to a .env file in the root of the backend directory and add the following environment variables:
ASSEMBLYAI_API_KEY=your_assemblyai_api_key_here
GEMINIAI_API_KEY=your_geminiapi_api_key_here
JWT_SECRET=7c6f1f6e064d6f9f9f4b2e6faa1d57e4
MONGODB_URI=mongodb://localhost:27017/videotoblog
Adjust the values for ASSEMBLYAI_API_KEY, GEMINIAI_API_KEY, MONGODB_URI and JWT_SECRET with your actual API keys and JWT secret.
Make sure the MongoDB URI (uri) matches your local MongoDB setup or your cloud database URL.
To run the backend server locally, use the following command:
node app.js
This starts the Node.js server.
When you first run the project, an admin user will be created automatically:
Username: admin@gmail.com
Password: Admin@1103
This is initialized by initializeAdmin.js located in the utils folder.
To access the /analytics route, you need to log in using the following credentials:
Username: admin@gmail.com
Password: Admin@1103
This route provides insights such as the number of users who generated blog posts, total hours processed, and other user metrics.
cd TextTriangleAI/frontend
Install the necessary dependencies using npm:
npm install
Add url to .env file in the root of the frontend directory and add the following content:
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000
This sets the base URL for API requests. Adjust NEXT_PUBLIC_API_BASE_URL if your backend server runs on a different port or domain.
To run the development server locally, use the following command:
npm run dev
This starts the Next.js development server on http://localhost:3000.
To build the project for production, run:
npm run build
This command builds the application for production usage. You can then deploy the contents of the out directory to your hosting provider.
- Ensure that API rate limits and usage quotas are respected to avoid service interruptions.
- I had used Google Gemini 1.5 Flash for Text Generation (Rate Limit Free tier: 15 Request & 1 million token per minute)
- I had used AssemblyAI speech to text api to transcribe media into text (Rate Limit Free Account: 5 concurrent users and 100 Hours free transcribe of speech to text api for free account).
- I had used youtube-transcript to extract transcript from a youtube video. This package use unofficial YTB API so it can be broken over the time. use Youtube data API
- This project is developed with handling small number of users not suitable for production
This project is licensed under the [MIT] License - see the LICENSE file for details.