Chat Analyzer is a privacy-first web application designed to analyze ChatGPT chat history files (.json or .txt). It provides users with deep insights into their communication patterns, emotional sentiment, and key discussion topics.
The application operates entirely in the browser (Frontend-Only), ensuring that your personal chat data is never stored on an external server. AI analysis is performed by directly connecting to the OpenAI API from your browser.
- Frontend Framework: React
- Routing:
react-router-dom - Styling: Tailwind CSS (Custom "Neo-Brutalism" design system)
- Animations: Framer Motion
- Data Visualization: Recharts
- Icons: Lucide React
- State Management & Data Fetching: TanStack Query (
@tanstack/react-query) - API Integration: Direct OpenAI API calls via
fetch - Persistence: Browser
localStorage
This application uses a Serverless / Frontend-Only architecture:
- Input: User uploads a chat history file.
- Processing: File is parsed locally in the browser.
- Analysis: The app sends a request to OpenAI's API (using your personal API key) to generate insights.
- Storage: Analysis results are saved to
localStoragein your browser. - Visualization: The app reads from
localStorageto display dashboards and charts.
Security Note: Your OpenAI API key is stored in a .env file. Since this is a client-side app, ensure you do not expose this key if deploying to a public URL. This setup is best suited for local usage.
- Functionality:
- Accepts
.json(ChatGPT export) or.txtfiles. - Parses chat history client-side.
- Intelligently samples messages to fit context windows.
- Sends sampled data to OpenAI via
apiClientto generate:- Top Topics (with keywords)
- Sentiment Breakdown
- Key Insights
- Improvement Suggestions
- Behavioral Patterns
- Saves results to
localStorage.
- Accepts
- Functionality:
- Displays a high-level overview of the analysis.
- Visualizations:
- Sentiment Pie Chart.
- Top Topics Bar Chart.
- Stats: Total messages, peak activity time, top topics count.
- Insights: Lists key insights and behavioral patterns (recurring themes).
- Allows switching between different analysis results.
- Functionality:
- Lists all identified topics from the analysis.
- Search functionality to filter topics.
- Visual "mentions" bar for each topic.
- Navigates to
TopicDetailon click.
- Functionality:
- Deep dive into a specific topic.
- Shows sentiment specific to that topic.
- Filters global insights, suggestions, and themes to show only those relevant to the selected topic.
- Functionality:
- Focuses on actionable improvement.
- Categorizes suggestions by priority (High, Medium, Low).
- AI Action Plans: Users can click "Get Action Plan" on any suggestion to generate a detailed, step-by-step guide using the LLM.
/
├── .env # API Key configuration
├── src/
│ ├── api/
│ │ └── apiClient.js # Client-side API logic (OpenAI + LocalStorage)
│ ├── components/
│ │ ├── ui/ # Reusable UI components (Button, Input, Alert)
│ │ └── SocialShare.jsx
│ ├── pages/
│ │ ├── Dashboard.jsx
│ │ ├── Insights.jsx
│ │ ├── TopicDetail.jsx
│ │ ├── Topics.jsx
│ │ └── Upload.jsx
│ ├── App.jsx # Router configuration
│ ├── main.jsx # Entry point
│ └── utils.js # Utility functions
└── Entities/
└── ChatAnalysis.json # Schema definition (reference)
- Install Dependencies:
npm install
- Configure API Key:
- Create a
.envfile in the root directory. - Add your OpenAI API key:
VITE_OPENAI_API_KEY=sk-...
- Create a
- Run Locally:
npm run dev