Skip to content

9059Rohith/Report_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 AI-Powered Chatbot Report Generator

A full-stack chatbot conversation analysis platform built with React + Vite frontend and Node.js backend. Generate insightful reports from chatbot conversations using Groq API with LLaMA models, featuring secure authentication, real-time analytics, and flexible export options.

✨ Features

  • πŸ€– AI-Powered Analysis - Leverages Groq API with LLaMA models for intelligent conversation insights
  • πŸ“Š Comprehensive Reports - Generate detailed analytics from chatbot conversation
  • πŸ” Secure Authentication - User authentication and authorization system
  • ⚑ Fast Performance - Built with Vite for lightning-fast development and production builds
  • πŸ’¬ Interactive Chat Interface - Real-time chatbot interaction and testing
  • πŸ“ Multiple Export Options - Export reports in various formats (PDF, CSV, JSON)
  • πŸ’Ό Enterprise Ready - Suitable for analytics, research, and business intelligence
  • 🐘 PostgreSQL Database - Robust data storage with organized models and migrations

πŸ› οΈ Tech Stack

Frontend

  • Framework: React 18
  • Build Tool: Vite
  • Styling: CSS3 / Tailwind CSS
  • Routing: React Router
  • State Management: React Context / Redux (if applicable)

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: PostgreSQL
  • ORM: Sequelize / Prisma
  • API: RESTful architecture
  • Authentication: JWT / Session-based

AI & Analytics

  • AI Provider: Groq API
  • Models: LLaMA (via Groq)
  • Processing: Natural Language Processing (NLP)

πŸ“‹ Prerequisites

Before you begin, ensure you have:

  • Node.js (v18 or higher)
  • PostgreSQL (v14 or higher)
  • npm or yarn package manager
  • Groq API key (Get one here)

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/chatbot-report-generator.git
cd chatbot-report-generator

2. Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Create .env file
cp .env.example .env

Backend .env Configuration:

# Server Configuration
PORT=5000
NODE_ENV=development

# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=chatbot_reports
DB_USER=your_db_username
DB_PASSWORD=your_db_password

# Groq API Configuration
GROQ_API_KEY=your_groq_api_key_here

# JWT Secret (generate a random string)
JWT_SECRET=your_jwt_secret_key

# CORS Configuration
FRONTEND_URL=http://localhost:5173

Initialize Database:

# Create PostgreSQL database
createdb chatbot_reports

# Run migrations
npm run migrate

# (Optional) Seed database with sample data
npm run seed

Start Backend Server:

npm run dev
# Server runs on http://localhost:5000

3. Frontend Setup

# Open new terminal and navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Create .env file
cp .env.example .env

Frontend .env Configuration:

# API Configuration
VITE_API_URL=http://localhost:5000/api
VITE_GROQ_API_KEY=your_groq_api_key_here

Start Frontend Development Server:

npm run dev
# Application runs on http://localhost:5173

4. Access the Application

Open your browser and navigate to:

http://localhost:5173

πŸ“– Usage Guide

1. User Authentication

  • Register a new account or login with existing credentials
  • Secure JWT-based authentication

2. Chat Interface

  • Test your chatbot in real-time
  • View conversation history
  • Export chat transcripts

3. Generate Reports

  • Navigate to the Report Page
  • Select conversation data to analyze
  • Choose analysis type (sentiment, topics, performance)
  • Click "Generate Report" to process with AI

4. View Analytics

  • Access comprehensive dashboards
  • View visualizations and metrics
  • Track trends over time

5. Export Data

  • Download reports in PDF format
  • Export raw data as CSV
  • API integration for automated exports

πŸ—οΈ Project Structure

chatbot-report-generator/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/              # Configuration files
β”‚   β”œβ”€β”€ controllers/         # Route controllers
β”‚   β”œβ”€β”€ middleware/          # Express middleware
β”‚   β”œβ”€β”€ models/              # Database models (Sequelize/Prisma)
β”‚   β”œβ”€β”€ routes/              # API routes
β”‚   β”œβ”€β”€ node_modules/        # Backend dependencies
β”‚   β”œβ”€β”€ package.json         # Backend dependencies
β”‚   └── server.js            # Main server file
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/              # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # Reusable React components
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ AboutPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ContactPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ HomePage.jsx
β”‚   β”‚   β”‚   └── ReportPage.jsx
β”‚   β”‚   β”œβ”€β”€ services/        # API service functions
β”‚   β”‚   β”œβ”€β”€ App.jsx          # Main App component
β”‚   β”‚   └── index.css        # Global styles
β”‚   β”œβ”€β”€ node_modules/        # Frontend dependencies
β”‚   └── package.json         # Frontend dependencies
β”‚
└── README.md                # This file

πŸ”‘ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout
  • GET /api/auth/me - Get current user

Chat

  • GET /api/chat/history - Get chat history
  • POST /api/chat/message - Send chat message
  • DELETE /api/chat/:id - Delete conversation

Reports

  • GET /api/reports - Get all reports
  • POST /api/reports/generate - Generate new report
  • GET /api/reports/:id - Get specific report
  • DELETE /api/reports/:id - Delete report
  • GET /api/reports/:id/export - Export report

πŸ“Š Report Types

The system can generate various types of analytical reports:

  • Sentiment Analysis - Understand user emotions and satisfaction levels
  • Topic Extraction - Identify common themes, issues, and discussion points
  • Performance Metrics - Analyze response times, resolution rates, and effectiveness
  • User Engagement - Track conversation patterns, duration, and drop-off points
  • Intent Classification - Categorize user queries and request types
  • Conversation Flow - Visualize dialogue paths and decision trees

πŸ”§ Available Scripts

Backend Scripts

npm run dev          # Start development server with nodemon
npm start            # Start production server
npm run migrate      # Run database migrations
npm run seed         # Seed database with sample data
npm test             # Run backend tests

Frontend Scripts

npm run dev          # Start Vite development server
npm run build        # Build for production
npm run preview      # Preview production build
npm run lint         # Run ESLint
npm test             # Run frontend tests

πŸ”’ Security Features

  • JWT-based authentication
  • Password hashing with bcrypt
  • SQL injection prevention through ORM
  • CORS configuration
  • Rate limiting on API endpoints
  • Input validation and sanitization
  • Environment variable protection

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Coding Standards

  • Follow ESLint configuration
  • Write meaningful commit messages
  • Add comments for complex logic
  • Update documentation as needed
  • Write tests for new features

πŸ› Troubleshooting

Common Issues

Database Connection Error

# Check PostgreSQL is running
sudo service postgresql status

# Verify database credentials in .env file

Port Already in Use

# Change PORT in backend/.env to different port
# Update VITE_API_URL in frontend/.env accordingly

Groq API Rate Limits

  • Free tier has usage limits
  • Consider upgrading plan for production use
  • Implement request queuing for high traffic

πŸ—ΊοΈ Roadmap

  • User authentication system
  • Real-time chat interface
  • AI-powered report generation
  • Export functionality
  • Real-time conversation monitoring dashboard
  • Multi-language support for reports
  • Advanced visualization with Chart.js/D3.js
  • Integration with Slack, Discord, Telegram
  • Custom report templates builder
  • Scheduled automated reports via email
  • WebSocket support for real-time updates
  • Mobile app (React Native)

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“§ Support & Contact

For questions, suggestions, or issues:

πŸ™ Acknowledgments

  • Groq - For providing ultra-fast LLM inference
  • Hugging Face - For LLaMA model hosting
  • Vite - For blazing fast build tooling
  • PostgreSQL - For robust database support
  • The React and Node.js communities

πŸ“Έ Screenshots

Add screenshots of your application here once available

🌟 Show Your Support

If you find this project useful, please consider:

  • ⭐ Starring the repository
  • 🍴 Forking for your own use
  • πŸ“’ Sharing with others
  • πŸ’° Sponsoring the project

Built with ❀️ for better chatbot analytics and insights

Made possible by Groq API, React, and the open-source community

About

πŸ§ πŸ’¬ AI-powered **Chatbot Report Generator** built with ⚑Vite + React, 🐘PostgreSQL, and πŸ€—Hugging Face LLaMA. Generates insightful chatbot conversation reports with secure API integration, fast performance, and export options for analytics, research, and enterprise use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors