Skip to content

Repository files navigation

ToneLens — Read Between the Lines.

ToneLens is an AI-powered web application that helps users understand how their written messages are likely to be perceived before they hit Send.

Instead of simply analyzing sentiment, ToneLens identifies the tone behind a message, highlights the exact phrases influencing that tone, explains how different audiences might interpret it, and suggests a rewritten version that better matches the user's intended communication style.


🌐 Live Demo

🚀 https://tonelens-git-main-itselodies-projects.vercel.app/


✨ Features

  • 🔍 AI-powered tone analysis
  • 🎯 Phrase-level highlighting with explanations
  • 👥 Audience perception analysis
    • Boss
    • Friend
    • Professor
  • 😊 Emotion detection
  • 📊 Tone breakdown
    • Confidence
    • Passive-Aggression
    • Urgency
  • ✍️ AI-powered message rewriting
    • More Neutral
    • Warmer
    • More Assertive
  • 📱 Fully responsive design
  • ⚡ Fast and modern Next.js application

🛠 Tech Stack

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS 4
  • Google Gemini API
  • Vercel

📂 Project Structure

src/
│
├── app/
│   ├── api/
│   │   ├── analyze/
│   │   └── rewrite/
│   ├── globals.css
│   ├── layout.tsx
│   └── page.tsx
│
├── components/
│   ├── Header
│   ├── Hero
│   ├── MessageInput
│   ├── AnalyzeButton
│   ├── LoadingState
│   ├── HighlightedMessage
│   ├── ToneBreakdown
│   ├── AudienceCards
│   ├── RewriteSection
│   ├── ErrorCard
│   └── Footer
│
├── hooks/
│
├── services/
│
├── types/
│
└── utils/

🚀 Getting Started

Clone the repository

git clone https://github.com/itselodie/tonelens.git

Navigate into the project

cd tonelens

Install dependencies

npm install

Create an environment file

Create a file named:

.env.local

Add your Gemini API key:

GEMINI_API_KEY=YOUR_GEMINI_API_KEY

Start the development server

npm run dev

Open:

http://localhost:3000

🧠 How It Works

  1. Enter a message.
  2. ToneLens sends the message securely to the Gemini API.
  3. The AI analyzes:
    • Overall tone
    • Emotion
    • Confidence
    • Passive-aggression
    • Urgency
  4. Important phrases are highlighted with explanations.
  5. The same message is interpreted from different perspectives:
    • Boss
    • Friend
    • Professor
  6. Users can generate a rewritten version with a different tone while preserving the original meaning.

🔒 Security

  • API keys remain server-side.
  • Sensitive credentials are managed through environment variables.
  • No API keys are exposed to the client.

🎯 Future Improvements

  • Conversation thread analysis
  • More audience perspectives
  • Tone history
  • Copy-to-clipboard functionality
  • Export analysis as PDF
  • Multi-language support

👩‍💻 Author

Hira Fatima

GitHub: https://github.com/itselodie

LinkedIn: https://www.linkedin.com/in/itshirafatima

Portfolio: https://hira-portfolio-portfolio.vercel.app/


📄 License

This project is licensed under the MIT License.


⭐ If you found this project interesting, consider giving it a star!

About

An AI-powered communication assistant that analyzes message tone, highlights perception-driving phrases, and suggests audience-aware rewrites before you hit send.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages