NewsMate-Client Tailwind Templates

Newsmate Client

Frontend for NewsMate, a real-time news chatbot interface built with React, Vite, and Tailwind CSS. Supports session-based chat, markdown-rendered responses, and API integration with a RAG-powered backend using Gemini and Qdrant for intelligent news retrieval and conversation history.

πŸ—žοΈ NewsMate β€” Client (Frontend)

NewsMate is a responsive, modern web client built using React, Vite, and Tailwind CSS. It provides a conversational interface for querying the latest news, backed by a powerful Retrieval-Augmented Generation (RAG) system running on the server.

This frontend communicates with the backend via REST APIs and WebSockets, maintains per-session histories, and renders chatbot responses in markdown.

πŸš€ Features

  • πŸ’¬ Real-time chatbot UI with session-based history.
  • πŸ” Automatic reconnection and error feedback using sonner.
  • πŸ“¦ API communication via axios.
  • 🧩 Dynamic layouts with react-resizable-panels.
  • 🧭 Client-side routing with react-router-dom.
  • 🎨 Styled using Tailwind CSS and tailwindcss-animate.
  • πŸ–‹οΈ Markdown-based response rendering via react-markdown.

πŸ“ Project Structure

client/
β”œβ”€β”€ components/       # Reusable UI components
β”œβ”€β”€ pages/            # Route-specific views
β”œβ”€β”€ services/         # API utilities (axios)
β”œβ”€β”€ App.jsx           # Main app wrapper with routing
└── main.jsx          # Entry point

πŸ› οΈ Setup & Development

Prerequisites

  • Node.js β‰₯ 18
  • pnpm / yarn / npm

Install dependencies

npm install

Run in development mode

npm run dev

Build for production

npm run build
Preview production build
```bash
npm run preview

πŸ”— Client-Server Communication

The frontend interacts with the backend via the following endpoints:
| Route | Method | Description | | -------------- | ------ | --------------------------------- | | /chat | POST | Send user message to Gemini + RAG | | /history/:id | GET | Retrieve session chat history | | /reset | POST | Clear a session’s Redis cache |

🧠 Noteworthy Design Decisions

  • Session-based architecture: All conversations are scoped by session ID, enabling persistent and personalized history.
  • Markdown rendering: Gemini’s markdown responses are rendered using react-markdown for rich formatting.
  • Component separation: Layout and chat logic are modular to allow scalability and reuse.
  • Resilient UX: Errors, reconnect attempts, and loading states are handled gracefully.

🚧 Potential Improvements

  • Add authentication support for persistent user identities.
  • Implement advanced message formatting (code blocks, citations).
  • Introduce message streaming (Gemini-compatible) for real-time replies.
  • Add dark mode toggle and user preferences.

Top categories

Loading Svelte Themes