Skip to content

Querio is a cutting edge application that provides an intuitive interface for interacting with AI powered document intelligence.

Notifications You must be signed in to change notification settings

paradocx96/querio-app

Repository files navigation

Querio

AI-Powered Document Intelligence Platform

Next.js React TypeScript TailwindCSS License

A modern, production-ready frontend for intelligent document querying powered by RAG (Retrieval-Augmented Generation) technology

Features β€’ Quick Start β€’ Documentation β€’ Contributing


πŸ“‘ Table of Contents


🎯 Overview

Querio is a cutting-edge frontend application that provides an intuitive interface for interacting with AI-powered document intelligence. Built with the latest web technologies, it features a stunning glassmorphism UI, real-time chat capabilities, semantic search, and comprehensive document management.

Key Highlights

  • 🎨 Modern Design - Beautiful glassmorphism UI with smooth animations
  • ⚑ Performance - Built with Next.js 16 for optimal speed and SEO
  • πŸ€– AI-Powered - Intelligent document querying using RAG technology
  • πŸ“± Responsive - Fully responsive design for all devices
  • πŸ”„ Real-time - Live updates and interactive chat interface
  • 🎭 Type-Safe - Full TypeScript implementation

✨ Features

πŸ“Š Dashboard

  • System overview with real-time statistics
  • Quick actions for common tasks
  • Visual analytics and metrics
  • API health monitoring

πŸ’¬ Chat Interface

  • Conversational AI with context awareness
  • Session management and history
  • Real-time message streaming
  • Markdown support for rich formatting

πŸ“„ Document Management

  • Drag-and-drop file upload
  • PDF document support
  • Document preview and metadata
  • Bulk upload capabilities
  • Delete and manage documents

πŸ” Semantic Search

  • AI-powered document search
  • Similarity-based results
  • Relevance scoring
  • Context-aware search results

πŸ“€ File Upload

  • Multi-file upload support
  • Drag-and-drop interface
  • Upload progress tracking
  • File type validation
  • Automatic document processing

πŸ”§ System Monitoring

  • API health status
  • Real-time statistics
  • Performance metrics
  • Connection monitoring

πŸ›  Tech Stack

Core Framework

Styling & UI

State Management

Data & API

File Handling

Utilities


πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js >= 18.0.0 (Download)
  • pnpm >= 8.0.0 (recommended) or npm >= 9.0.0
  • Querio API Backend running on http://localhost:8000

Installing pnpm (Recommended)

npm install -g pnpm

πŸš€ Quick Start

1️⃣ Clone the Repository

git clone https://github.com/paradocx96/querio-app.git
cd querio-app

2️⃣ Install Dependencies

pnpm install

3️⃣ Configure Environment

# Copy the example environment file
cp .env.local.example .env.local

# Edit .env.local with your configuration

4️⃣ Start Development Server

pnpm dev

The application will be available at http://localhost:3000


πŸ“ Project Structure

querio-app/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ layout.tsx               # Root layout with sidebar
β”‚   β”œβ”€β”€ page.tsx                 # Dashboard page
β”‚   β”œβ”€β”€ globals.css              # Global styles & design tokens
β”‚   β”œβ”€β”€ chat/                    # Chat interface
β”‚   β”‚   └── page.tsx
β”‚   β”œβ”€β”€ documents/               # Document management
β”‚   β”‚   └── page.tsx
β”‚   β”œβ”€β”€ upload/                  # File upload
β”‚   β”‚   └── page.tsx
β”‚   β”œβ”€β”€ search/                  # Semantic search
β”‚   β”‚   └── page.tsx
β”‚   └── system/                  # System monitoring
β”‚       └── page.tsx
β”‚
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ chat/                    # Chat-specific components
β”‚   β”‚   β”œβ”€β”€ chat-interface.tsx
β”‚   β”‚   └── chat-message.tsx
β”‚   β”œβ”€β”€ dashboard/               # Dashboard components
β”‚   β”‚   β”œβ”€β”€ stat-card.tsx
β”‚   β”‚   β”œβ”€β”€ quick-query.tsx
β”‚   β”‚   └── quick-action-link.tsx
β”‚   β”œβ”€β”€ documents/               # Document components
β”‚   β”‚   β”œβ”€β”€ document-card.tsx
β”‚   β”‚   β”œβ”€β”€ document-list.tsx
β”‚   β”‚   └── file-upload.tsx
β”‚   β”œβ”€β”€ search/                  # Search components
β”‚   β”‚   β”œβ”€β”€ search-interface.tsx
β”‚   β”‚   └── search-result-card.tsx
β”‚   β”œβ”€β”€ layout/                  # Layout components
β”‚   β”‚   └── sidebar.tsx
β”‚   └── ui/                      # Reusable UI components
β”‚       β”œβ”€β”€ button.tsx
β”‚       β”œβ”€β”€ input.tsx
β”‚       β”œβ”€β”€ textarea.tsx
β”‚       β”œβ”€β”€ card.tsx
β”‚       β”œβ”€β”€ badge.tsx
β”‚       β”œβ”€β”€ alert.tsx
β”‚       β”œβ”€β”€ modal.tsx
β”‚       └── loading.tsx
β”‚
β”œβ”€β”€ api/                         # API integration
β”‚   └── rest/
β”‚       └── base-api.ts         # Axios instance & endpoints
β”‚
β”œβ”€β”€ hooks/                       # Custom React hooks
β”‚   └── (custom hooks here)
β”‚
β”œβ”€β”€ lib/                         # Utilities & types
β”‚   β”œβ”€β”€ types.ts                # TypeScript type definitions
β”‚   └── utils.ts                # Utility functions
β”‚
β”œβ”€β”€ utils/                       # Helper utilities
β”‚   └── sidebar-utils.ts        # Sidebar navigation config
β”‚
β”œβ”€β”€ public/                      # Static assets
β”‚
β”œβ”€β”€ .env.local.example          # Environment variables template
β”œβ”€β”€ next.config.js              # Next.js configuration
β”œβ”€β”€ tailwind.config.js          # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json               # TypeScript configuration
└── package.json                # Dependencies & scripts

πŸ” Environment Variables

Create a .env.local file in the root directory:

# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:8000

# Optional: Add additional configuration as needed
# NEXT_PUBLIC_ANALYTICS_ID=your_analytics_id

Environment Variable Reference

Variable Description Default Required
NEXT_PUBLIC_API_URL Backend API base URL http://localhost:8000 Yes

Note: Variables prefixed with NEXT_PUBLIC_ are exposed to the browser.


πŸ’» Development

Available Scripts

# Start development server (with hot reload)
pnpm dev

# Build for production
pnpm build

# Start production server
pnpm start

# Run ESLint
pnpm lint

# Type check
pnpm type-check

Development Tips

  1. Hot Reload - Changes are automatically reflected in the browser
  2. Type Safety - TypeScript catches errors during development
  3. API Proxy - Configure proxy in next.config.js if needed
  4. Component Development - Use the component structure for consistency

Code Style

This project follows industry-standard practices:

  • TypeScript for type safety
  • Functional Components with hooks
  • Client Components marked with 'use client'
  • Proper Error Handling with try-catch and error boundaries
  • Responsive Design using Tailwind breakpoints

🎨 Design System

Color Palette

The application uses a carefully crafted color system:

/* Primary Colors */
--accent-primary: #06b6d4    /* Cyan */
--accent-secondary: #22d3ee   /* Light Cyan */
--purple-primary: #a855f7     /* Purple */
--purple-secondary: #c084fc   /* Light Purple */

/* Background */
--bg-primary: #0a0a0f        /* Deep Navy */
--bg-secondary: #12121a       /* Dark Navy */
--bg-tertiary: #1a1a25        /* Medium Navy */

/* Glass Effects */
--glass-bg: rgba(255, 255, 255, 0.03)
--glass-border: rgba(255, 255, 255, 0.08)

/* Text */
--text-primary: #f8fafc       /* White */
--text-secondary: #94a3b8     /* Gray */
--text-tertiary: #64748b      /* Muted Gray */

/* Status Colors */
--success: #10b981            /* Green */
--warning: #f59e0b            /* Orange */
--error: #ef4444              /* Red */

Typography

Components

Glass Card

<div className="glass-card">
  {/* Translucent card with backdrop blur */}
</div>

Gradient Button

<Button variant="primary" leftIcon={<Icon />}>
  Click Me
</Button>

Animated Elements

All interactive elements include smooth animations using Framer Motion.


πŸ”Œ API Integration

The frontend integrates with the Querio backend API:

Endpoint Categories

Category Endpoints Description
System /api/health, /api/stats Health checks and statistics
Documents /api/documents/* Document CRUD operations
Upload /api/documents/upload, /api/documents/bulk-upload File upload endpoints
Query /api/query Document querying
Chat /api/chat/* Chat sessions and messages
Search /api/search/* Semantic search

API Client

The API client is configured in api/rest/base-api.ts:

import { API_BASE_URL } from '@/api/rest/base-api';

// Base URL is configured via environment variable
// Default: http://localhost:8000

Error Handling

All API calls include comprehensive error handling:

  • Network errors
  • Timeout errors (60 seconds)
  • Server errors with detailed messages
  • Automatic error notifications via toast

πŸ— Building for Production

Create Production Build

# Build the application
pnpm build

# The output will be in the .next directory

Build Output

The build process creates optimized static pages:

Route (app)                    Size
β”Œ β—‹ /                         (Static)
β”œ β—‹ /chat                     (Static)
β”œ β—‹ /documents                (Static)
β”œ β—‹ /search                   (Static)
β”œ β—‹ /system                   (Static)
β”” β—‹ /upload                   (Static)

Production Server

# Start production server
pnpm start

# Server runs on http://localhost:3000

Performance Optimizations

  • βœ… Code splitting
  • βœ… Image optimization
  • βœ… CSS minification
  • βœ… JavaScript minification
  • βœ… Static page generation
  • βœ… React Server Components
  • βœ… Automatic font optimization

🚒 Deployment

Vercel (Recommended)

Deploy with Vercel

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Other Platforms

Netlify

# Build command
pnpm build

# Publish directory
.next

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]

Environment Variables

Remember to configure NEXT_PUBLIC_API_URL in your deployment platform.


🀝 Contributing

We welcome contributions! Please follow these steps:

1. Fork the Repository

Click the "Fork" button at the top right of this page.

2. Clone Your Fork

git clone https://github.com/paradocx96/querio-app.git
cd querio-app

3. Create a Branch

git checkout -b feature/amazing-feature

4. Make Changes

  • Follow the existing code style
  • Add tests if applicable
  • Update documentation as needed

5. Commit Changes

git add .
git commit -m 'Add some amazing feature'

6. Push to Branch

git push origin feature/amazing-feature

7. Open Pull Request

Go to your fork on GitHub and click "New Pull Request"

Development Guidelines

  • βœ… Use TypeScript for type safety
  • βœ… Follow component structure conventions
  • βœ… Write meaningful commit messages
  • βœ… Test your changes thoroughly
  • βœ… Update README if adding features
  • βœ… Ensure build passes (pnpm build)

πŸ“„ License

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

MIT License

Copyright (c) 2024 Navinda Chandrasiri

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

πŸ™ Acknowledgments

  • Next.js Team - For the amazing framework
  • Vercel - For hosting and deployment platform
  • Tailwind Labs - For Tailwind CSS
  • Framer - For Framer Motion
  • Lucide Icons - For beautiful icons

πŸ“ž Support


⭐ Star us on GitHub if you find this project useful!

Built with ❀️ by paradocx96

Website β€’ Documentation β€’ Blog β€’ Twitter

⬆ Back to Top

About

Querio is a cutting edge application that provides an intuitive interface for interacting with AI powered document intelligence.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published