Skip to content

epam/statgpt-portal-frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StatGPT Portal Frontend

Frontend codebase for StatGPT portals. StatGPT is an SDMX-driven platform for statistical organizations allowing to query, transform, analyze, visualize, and interpret statistical data using natural language interface. This repository providing reusable libraries and application example for building StatGPT Portals. The application features a conversational interface powered by the DIAL API, optimized for working with SDMX data.

License: MIT React Typescript Next Nx

πŸ“‹ Table of Contents

✨ Main Features

  • Modular Nx workspace with reusable libraries
  • Example application for rapid prototyping
  • Integration with Apis: SDMX and DIAL APIs
  • Advanced UI components for data exploration and sharing
  • Conversation Management: Create, read, update, and delete conversations
  • Real-time Messaging: Stream responses from LLM models using Server-Sent Events
  • Monorepo Architecture: Organized with Nx for scalable development
  • Authentication Support: NextAuth.js integration for secure user authentication

πŸ—οΈ Architecture Overview

This project uses:

  • Next.js with App Router for the frontend framework
  • Nx Monorepo for project organization and tooling
  • TypeScript for type safety
  • Tailwind CSS for styling
  • DIAL API for LLM backend integration
  • React for building UI components
  • NextAuth.js for authentication (optional)

πŸš€ Getting Started

πŸ› οΈ Prerequisites

  • Node.js >= 22.19.0
  • npm >= 11.0.0
  • DIAL API access (for backend integration)

πŸ“¦ Installation

Clone the repository and install dependencies:

git clone https://github.com/epam/statgpt-portal-frontend.git
cd statgpt-portal-frontend
npm install

▢️ Running Applications

To start a development server for an application (e.g., portals-example):

nx serve portals-example

Replace portals-example with the desired app name.

πŸ—οΈ Building Libraries

To build a library:

nx build <library-name>

πŸ—οΈ Project Structure

apps/
  portals-example/           # Example portal application
  ...
libs/
  conversation-view/         # Advanced conversation view components
  share-conversation/        # Conversation sharing utilities
  dial-toolkit/              # DIAL API integration toolkit
  sdmx-toolkit/              # SDMX API integration toolkit
  ...

πŸ§‘β€πŸ’» Development

Prerequisites

  • Node.js >= 22.19.0
  • npm >= 11.0.0
  • Git

Development Setup

  1. Fork and Clone

    git clone https://github.com/epam/statgpt-portal-frontend.git
    cd statgpt-portal-frontend
  2. Install Dependencies

    npm install
  3. Set up environment variables.

    Create a .env file in the application directory:

    # DIAL API Configuration
    DIAL_API_URL=https://your-dial-api-endpoint.com
    DIAL_API_VERSION=your-dial-api-version
    DIAL_API_KEY=your-api-key
    DEFAULT_MODEL="ADD_VALUE_HERE"
    
    # SDMX API Configuration
    SDMX_API_URL=https://your-sdmx-api-endpoint.com
  4. Start Development Environment

    # Start Vite dev server
    npm run start

    Once the server is up and running, open http://localhost:4200 in your browser to view the application.

🎨 Styling

The project uses Tailwind CSS with a custom theme configuration:

  • Primary colors: Blue palette (CSS variables)
  • Secondary colors: Slate/gray palette
  • Custom animations: fade-in, slide-up, pulse-slow
  • Custom spacing: Extended spacing scale
  • Font families: Inter (sans), JetBrains Mono (mono)

See tailwind.config.js for the complete configuration.

πŸ“š Libraries

You can find libraries with detailed documentation in the libs/ directory:

@statgpt/conversation-list

React components for managing conversation history.

@statgpt/conversation-view

React components for chat interface.

@statgpt/dial-toolkit

DIAL Api client library.

@statgpt/download-panel

React components for downloading SDMX data.

@statgpt/sdmx-toolkit

SDMX Api client library.

@statgpt/share-conversation

Utilities for sharing conversations via link or QR code.

@statgpt/shared-toolkit

Shared TypeScript interfaces.

@statgpt/ui-components

Reusable React components.

πŸ§ͺ Testing

The project uses Jest for testing:

# Run all tests
npm run test

# Run tests for specific app/lib
npm run nx test portals-example
npm run nx test dial-toolkit

πŸ”— Related Resources

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Code style guidelines
  • Testing requirements
  • Pull request process

πŸ”’ Security

If you discover a security vulnerability, please refer to our Security Policy.

πŸ“„ License

MIT - see the LICENSE file for details.

πŸ”— Related Projects

  • AI-DIAL - Entrypoint for all AI Dial projects

Made by EPAM Systems

`

About

StatGPT Portal Frontend

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5