This application is designed to process incoming emails efficiently using a combination of the Gmail API, Groq API, TypeScript, and Redis Queue and Workers. It follows a streamlined workflow:
- Email Ingestion: Retrieves new emails from a specified Gmail inbox using the Gmail API via OAuth.
- Groq Processing: Sends each retrieved email to the Groq API for natural language processing and analysis. Groq generates a comprehensive response based on the email's content.
- Response Queueing: Adds the generated response to a Redis queue for efficient and scalable processing.
- Email Sending: Workers consume messages from the Redis queue, crafting new email messages based on the Groq-generated responses. These messages are then sent using appropriate email delivery methods.
- TypeScript
- Gmail API
- Groq API
- Redis
- Docker (for Redis)
bash git clone https://github.com/yourusername/your-repo-name.git
bash npm i
- Create client_id , client_secret in gmail at Gmail Cloud .
- Refer this: BlogLink
- Get GLOQ Secret from : Gloq Console
bash tsc -b
- Option 1:
- Run Docker Compose Ensure Docker Compose is installed.
- Run bash
docker-compose up -d
to start the Redis container and the application. - Run bash
node dist/index.js
to start the application.
- Option 2:
- Set up Redis locally
- Install Redis locally.
- Configure your Redis host and port in the environment variables.
- Run bash
node dist/index.js
to start the application.