A modern, responsive frontend application for a RAG (Retrieval-Augmented Generation) LLM system focused on NJ UI modernization, with integrated feedback collection and US Web Design System (USWDS) compliance.
- Chat Interface: Clean, modern chat UI with real-time message display
- Text Input: Multi-line text input for asking questions
- AI Responses: Simulated LLM responses with source citations
- Feedback System: Thumbs up/down rating system for responses
- Positive Feedback: Thumbs up stores question, answer, and rating
- Negative Feedback: Thumbs down triggers additional feedback modal
- Detailed Feedback: Text input for describing what was wrong
- Database Storage: Mock database operations for all feedback data
- USWDS Compliance: Follows US Web Design System guidelines and color schemes
- Responsive Design: Works on desktop and mobile devices
- Loading States: Visual feedback during AI processing
- Conversation History: Persistent chat history during session
- Modern UI: Built with Tailwind CSS, USWDS fonts, and Lucide React icons
The application includes comprehensive mock data to demonstrate functionality:
- "What is UI modernization?"
- "How to modernize legacy UI?"
- "What are accessibility requirements?"
- "Best practices for responsive design"
- "How to implement design system?"
- Text Content: Realistic AI-generated responses
- Source Citations: Simulated knowledge base sources
- Fallback Responses: Generic responses for unmatched questions
- Node.js (v16 or higher)
- npm or yarn package manager
-
Install Dependencies
npm install
-
Start Development Server
npm start
-
Open Browser Navigate to
http://localhost:3000
npm run build
src/
├── components/
│ ├── ChatInterface.js # Main chat UI component
│ ├── MessageBubble.js # Message display component
│ ├── FeedbackButtons.js # Thumbs up/down buttons
│ └── FeedbackModal.js # Negative feedback modal
├── utils/
│ └── mockData.js # Mock LLM responses & database
├── App.js # Main application component
├── index.js # React entry point
└── index.css # Global styles & Tailwind
The application simulates storing feedback data with this structure:
{
question: "User's question",
answer: "AI response content",
feedbackType: "thumbsUp" | "thumbsDown",
feedbackText: "Additional feedback (for thumbs down)",
timestamp: "ISO timestamp",
table: "feedback_logs"
}
- Manages conversation state and message flow
- Handles user input and AI responses
- Integrates feedback collection
- Thumbs up/down rating buttons
- Triggers feedback collection workflow
- Visual feedback states
- Appears when thumbs down is clicked
- Collects detailed feedback text
- Shows original question and answer for context
- Uses Tailwind CSS for consistent design
- Custom color scheme in
tailwind.config.js
- Responsive breakpoints for mobile/desktop
- Modify
src/utils/mockData.js
to add new responses - Update database simulation functions
- Add new conversation examples
- Replace mock functions with real API calls
- Update response handling for actual LLM output
- Implement real database operations
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
npm start
- Start development servernpm test
- Run test suitenpm run build
- Build for productionnpm run eject
- Eject from Create React App
- ESLint configuration for code quality
- Prettier for consistent formatting
- Component-based architecture
- Functional components with hooks
- Real API Integration: Connect to actual RAG LLM backend
- User Authentication: User accounts and conversation history
- Advanced Feedback: Rating scales, categories, and analytics
- Export Features: Download conversation logs and feedback data
- Multi-language Support: Internationalization for global users
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.