A Django-based web application that uses the Gemini API to provide text summarization and style-based text rewriting capabilities. Features user authentication and history tracking.
- Text Summarization: Condense long texts into concise summaries
- Text Rewriting: Rewrite content in different styles:
- Casual
- Formal
- Creative
- Academic
- Business
- User Authentication:
- Secure signup and login
- User-specific processing history
- History Tracking:
- View all your past text processing operations
- Clear history functionality
- Modern UI: Responsive dark-themed interface
- Real-time Processing: Asynchronous API calls with loading indicators
- Backend: Django 5.1.6, Django REST Framework
- Frontend: HTML5, CSS3, JavaScript, Bootstrap 5
- Database: MongoDB
- Authentication: Django Authentication System
- API Integration: Gemini API (using the Gemini-1.5-flash)
- Development: Python 3.11+
Before you begin, ensure you have the following installed:
- Python 3.11 or higher
- pip (Python package manager)
- A Gemini API key
-
Clone the repository:
git clone https://github.com/RahulRmCoder/AI-Text-Processing-Application.git cd AI-Text-Processing-Application -
Create and activate a virtual environment:
python -m venv venv # On Windows .\venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.envfile in the root directory and add your Groq API key:GEMINI_API_KEY=your_api_key_here -
Apply migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
-
Open your browser and navigate to:
http://127.0.0.1:8000/ -
Create an account or login to access all features.
ai_summarizer/
├── ai_summarizer/ # Main project settings
│ ├── __init__.py
│ ├── asgi.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── summarizer/ # App directory
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py # Form definitions for web UI
│ ├── migrations/
│ ├── models.py # Data models including ChatHistory
│ ├── serializers.py # DRF serializers
| ├── services.py
│ ├── templates/ # HTML templates
│ │ ├── summarizer/ # App-specific templates
│ │ │ ├── index.html # Main app template
│ │ │ ├── login.html # Authentication templates
│ │ │ ├── signup.html
│ │ │ └── history.html # User history page
| | └── base.html # Base template with dark theme
│ ├── tests.py
│ ├── urls.py # App URL configurations
│ └── views.py # API and view controllers
├── .env # Environment variables (not tracked in git)
├── .gitignore
├── manage.py
- URL:
/api/summarize/ - Method: POST
- Request Body:
{ "text": "Your long text to summarize here..." } - Response:
{ "summary": "Summarized version of the text..." }
- URL:
/api/rewrite/ - Method: POST
- Request Body:
{ "text": "Your text to rewrite here...", "style": "casual|formal|creative|academic|business" } - Response:
{ "rewritten_text": "The rewritten text in the specified style..." }
- URL:
/api/history/ - Method: GET
- Authentication: Required
- Response: List of user's processing history entries
- Home:
/- Main text processing interface - Login:
/login/- User login page - Signup:
/signup/- New user registration - History:
/history/- View processing history (requires login) - Logout:
/logout/- Log out current user
- Edit the CSS in the
<style>section of thebase.htmlfile to customize the appearance - The application uses a dark theme by default, but this can be changed
- Update the
index.htmltemplate to include new options in the style selector - Modify the
RewriteSerializerinserializers.pyto validate the new styles - Test with the Groq API to ensure it can handle the new style requests
- The application displays timestamps in your local timezone
- You can modify the timezone in
settings.pyusing theTIME_ZONEsetting
For production deployment:
- Set
DEBUG = Falseinsettings.py - Configure a production-ready web server (e.g., Nginx, Apache)
- Use a WSGI server like Gunicorn
- Ensure your
.envfile with the API key is securely set up - Consider using HTTPS for secure API communication
- For production, consider using a more robust database like PostgreSQL
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.




