Encorp AI is an AI-powered slide generator that takes user input prompts and generates structured presentations using Gemini AI. It supports both PDF and PPT export functionalities.
Screen.Recording.2025-03-16.at.5.09.44.PM.mov
- AI-Powered Slide Generation: Uses Gemini AI to process prompts and create structured slides.
- Redis-Based Job Queue: Ensures efficient task management and processing.
- Golang Worker Service: Polls tasks from Redis and interacts with Gemini AI.
- Node.js Backend: Handles authentication and API requests.
- Export Options: Supports PDF (via jsPDF) and PPT (via pptgenx).
Before setting up this project, ensure you have the following installed:
-
Node.js (v18.0.0 or later)
-
Go (v1.20 or later)
-
PostgreSQL (v14 or later) for the database - Get PostgreSQL Connection URL from Supabase or Just start a local postgres container
-
Git for cloning the repository
-
Gemini API key - Sign up at Google AI Studio to obtain your API key
-
Environment variables:
- For backend: Create a
.env
file in the backend directory with:DATABASE_URL=postgresql://username:password@localhost:5432/db REDIS_URL=redis://localhost:6379 NODE_ENV=dev JWT_SECRET=your_jwt_secret PORT=8000
- For Go worker: Create a
.env
file in the Go-worker directory with:GEMINI_API_KEY=your_gemini_api_key REDIS_ADDR=localhost:6379 REDIS_PASSWORD=
- For backend: Create a
- User Input & Authentication: Users input prompts through the Next.js frontend. Authentication is handled via the Node.js backend with an Auth DB.
- Task Queueing & Notification: The backend pushes the prompt to a Redis queue and publishes a notification to the Redis Pub/Sub channel.
- Event-Driven Processing: The Golang worker receives instant notification when new tasks arrive and processes them immediately.
- Gemini AI Processing: The Golang worker calls the Gemini API, processes the response, and pushes the structured JSON output back to Redis.
- Status Updates: The worker updates job status in Redis at each stage (processing, completed, failed).
- Polling Mechanism: The frontend polls the backend API until the job is complete.
- Slide Preview: The JSON response is used to render a preview of the slides with both bullet points and descriptive paragraphs.
- Export Options: Users can export slides as:
- PDF (via jsPDF)
- PPT (via pptgenx)
- S3/Cloudinary Uploads: Enable users to upload generated PPT files to cloud storage.
- Image Support in PDFs: Enhance PDF generation by including images (currently omitted due to high costs of image generation models).
- Frontend: Next.js (React-based)
- Backend: Node.js (Express.js)
- Queue Management: Redis
- Worker Service: Golang
- AI Model: Gemini AI
- Storage (Upcoming Feature): S3/Cloudinary
- Exports: jsPDF, pptgenx
- Frontend: Vercel
- Node.js Backend: AWS EC2
- Golang Worker: AWS EC2
-
Clone the repository:
git clone https://github.com/Rudra-Sankha-Sinhamahapatra/Encorp-AI
-
Install dependencies:
cd backend && npm install cd frontend && npm install
-
Start the Redis server.
-
Run the backend:
cd backend && npm run dev
-
Run the frontend:
cd frontend && npm run dev
-
Run the Golang worker service:
Development mode:
cd Go-worker && go run ./src/main.go
OR
Build and run:
cd Go-worker go mod tidy go build -o worker ./src/main.go ./worker
- Real-time Processing: Tasks are processed immediately without polling delays
- Resource Efficiency: Worker remains idle until tasks arrive, reducing CPU and Redis load
- Reliability: Multiple safeguards ensure tasks are never lost
- Scalability: Multiple workers can subscribe to the same notification channel
Feel free to open issues and submit pull requests for new features or improvements!
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Rudra Sankha Sinhamahapatra