A React-based admin interface for managing person data and sending personalized emails through a chat interface.
- Chat Interface: Admin can add person information through natural language chat
- Person Database View: Table display of all persons in the system
- Real-time Communication: Send messages to backend for processing
- Responsive Design: Modern UI with Tailwind CSS
- Chat-style UI with message input and send functionality
- Displays conversation history with admin and backend messages
- Handles loading states and error messages
- Auto-scrolls to latest messages
- Renders individual chat messages
- Different styling for admin vs backend messages
- Shows timestamp for each message
- Displays table of all persons in the database
- Refresh functionality to reload data
- Loading and error states
- Responsive table design
- API functions for backend communication
sendChatMessage(): POST chat messages to backendgetPersonList(): GET list of persons from database
- Install dependencies:
npm install- Start the development server:
npm run dev- Make sure your backend server is running on port 3001 (or update the API_BASE_URL in
src/api/api.js)
- Navigate to the "Chat Interface" tab
- Type natural language messages to add person information
- Example: "Add John Doe, email: john@example.com, age: 30"
- The backend will process the message and respond
- Navigate to the "Person Database" tab
- View all persons currently in the system
- Use the "Refresh" button to reload data
- Table shows: Name, Email, Age, Phone, Added Date
The frontend expects the following backend endpoints:
POST /api/chat- Send chat messagesGET /api/persons- Get list of persons
Update the API_BASE_URL in src/api/api.js if your backend runs on a different port.
- React 19
- Tailwind CSS
- Vite
- Fetch API for HTTP requests
- Run
npm run devfor development server - Run
npm run buildfor production build - Run
npm run lintfor code linting