letscodedanish / Email-Classifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a Next.js

What it does

a web application that allows users to log in using Google OAuth, fetch their last X emails from Gmail, and classify them into different categories using OpenAI GPT-4o. -User Authentication: Allow users to log in using Google OAuth.

-Fetch Emails: Fetch the user's emails from Gmail using the Gmail API.

-Classify Emails: Use OpenAI GPT to classify emails into important, Promotional, social, marketing, and spam categories.

Note: For classifying the emails we are using OpenAI api but the twist is its not working for classification, some function of it are not being supported So I directly made the axios request to 3.5gpt-turbp endpoint. While deploying this app it is facing some build issues, I'll be fixing it in some time, I tends to use CloudFlare Workers(hono.js) for it. If some want to fix some issues while Classifying the emails feel free to Contrinute.

Tech Stack

Frontend: Used Next.js with TypeScript and Tailwind, or any CSS framework of your choice Backend: Framework’s API routes or separate backend using Express.js, Koa, or Feather.js. and Langchain.js Authentication: Use Google OAuth for user authentication. API Integration: Integrate with the Gmail API to fetch emails and OpenAI GPT for email classification.

What I aim to use in future(Tech Integration)

  • Turborepo
  • Cloudflare Workers(hono.js)
  • Rate Limiting
  • Docker
  • Postgess as database(with connection pooling)

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

Building and Running the Docker Container

Build the Docker Image:

docker build -t email-classifier.

Run the Docker Container:

docker run -p 3000:3000 email-classifier

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About


Languages

Language:TypeScript 93.4%Language:CSS 3.2%Language:JavaScript 2.7%Language:Dockerfile 0.8%