This project automates the process of sorting and filtering company emails to their respective departments using AI-powered classification — such as Finance, Human Resources, and others. It combines a Django backend with a React frontend, and uses Celery with Redis for asynchronous email processing.
- 🔍 Automatically classifies incoming emails into departments
- 📨 Email fetching and display in the UI
- 📁 Filters by department: HR, Finance, etc.
- ⚙️ Django REST Framework for backend APIs
- 🌐 Modern React interface
- 🔁 Background processing via Celery & Redis
- Backend: Django, Django REST Framework
- Frontend: React + Vite
- Task Queue: Celery
- Broker: Redis
# Create virtual environment
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
# backend working directory
cd backend
# Install dependencies
pip install -r requirements.txt
# Run migrations
python manage.py migrate
# Start Redis server (in another terminal)
redis-server
# Start Celery worker (in another terminal)
celery -A backend worker --loglevel=info
# Run Django server
python manage.py runservercd frontend
npm install
npm run devYour React app should now be running on http://localhost:5173
email-department-filter/
├── backend/ # Django project
│ ├── email_automation/ # Email filter API logic
│ ├── ai_tools # Django settings
│ └── ...
├── frontend/ # React application
│ ├── src/
│ └── ...
└── assets/ # UI screenshots for README
---
## 🛡️ Environment Variables
You should create a `.env` file in the backend directory to include the following:
```env
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY=google client key
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = google secret key
GEMINI_API_KEY = gemeni api key
Do not commit this file to version control.
PRs and issues are welcome! If you'd like to contribute, please fork the repo and submit a pull request.