A React and Vite app that analyzes text, chat-style conversations and chat screenshots with Google Gemini, and falls back to Groq automatically if a request fails. It returns overall sentiment, a six-emotion breakdown, keywords and per-participant summaries, and keeps your history locally in the browser.
A single "positive" or "negative" hides most of what is in a message, and chats involve more than one person.
A sentence can be mostly positive with some anger in it. Scores and an emotion breakdown show the mix, not just a label.
In a chat, each person has their own tone. The app scores each participant separately and summarizes the dynamic.
People often have a chat as an image, not text. The app accepts a screenshot and reads the visible messages.
Everything runs in the browser. The only external calls are to the Gemini API, or to Groq as the fallback.
The three tabs of the app and what each one gives you.
Single text or conversation mode. Overall sentiment badge, positive, neutral and negative score bars, six emotions, keyword chips and a one-sentence insight.
Previous analyses saved in the browser with sentiment badges and timestamps, with a button to clear them.
Total analyses, average positivity, most common sentiment, a distribution bar chart and a radial positivity chart.
Small and focused, with no server to run.
| Layer | Technology | Why |
|---|---|---|
| UI | React 18 + Vite | Fast development and a small production bundle; the Stats and Code tabs are lazy-loaded. |
| AI | Google Gemini Groq | Gemini handles text and images in one model, so screenshots need no separate OCR step. Groq is a second provider: if one fails or hits a rate limit, the app retries with the other. |
| Persistence | IndexedDB | History stays on the user's device; no accounts or database to maintain. |
| Charts | Recharts | Declarative charts for the distribution and positivity views. |
| Styling | CSS Modules | Scoped styles per component with a small global stylesheet. |
How the app gets reliable results from a language model.
The prompt embeds the exact output schema and states the rules: raw JSON only, scores as integers, and positive, neutral and negative must sum to 100. That makes the response something the UI can render directly.
The response is checked and normalized before it is shown or saved, so one odd model answer cannot break the charts or corrupt stored history.
Conversation mode asks for per-participant scores that each sum to 100 and a message-count estimate, which the single-text prompt does not need.
Saving to IndexedDB keeps the app free to host and keeps analysed text on the user's device.
Stats and Code load only when opened, which keeps the first load light.
The problems that come with putting a language model behind a UI.
Models drift from a format. A schema in the prompt, explicit rules and client-side normalization turn free-form generation into predictable data.
✓ Schema-in-prompt plus validationScreenshots can be blurry or cropped. The conversation prompt tells the model to use only the text it can identify confidently, and to still return one participant if only one speaker is visible.
✓ Rules for unclear imagesAPI quota errors are normal on a free tier. The app reads the retry delay from the error and shows "Try again in about N seconds" instead of a raw failure.
✓ Friendly retry guidanceResults are stored in IndexedDB in a fixed shape, so History and Stats always read the same structure.
✓ One normalized result shapeWhat the project shows about how I build AI features.
Honest notes on a client-side AI app.
The demo calls Gemini or Groq directly from the browser. For production use, the key should live behind a small serverless proxy with rate limiting, not in the client.
Scores come from a language model's judgement, not a trained classifier. They are good for exploration, and should not be treated as ground truth.
A serverless proxy, batch analysis of many texts, CSV export of history, and evaluation against a labelled dataset.
I'm open to full-time roles and project work in AI engineering, full-stack development, and backend systems.