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.
- β¨ Main Features
- ποΈ Architecture Overview
- π Getting Started
- ποΈ Project Structure
- π§βπ» Development
- π¨ Styling
- π Libraries
- π§ͺ Testing
- π Related Resources
- π€ Contributing
- π Security
- π License
- π Related Projects
- 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
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)
- Node.js >= 22.19.0
- npm >= 11.0.0
- DIAL API access (for backend integration)
Clone the repository and install dependencies:
git clone https://github.com/epam/statgpt-portal-frontend.git
cd statgpt-portal-frontend
npm install
To start a development server for an application (e.g., portals-example
):
nx serve portals-example
Replace portals-example
with the desired app name.
To build a library:
nx build <library-name>
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
...
- Node.js >= 22.19.0
- npm >= 11.0.0
- Git
-
Fork and Clone
git clone https://github.com/epam/statgpt-portal-frontend.git cd statgpt-portal-frontend
-
Install Dependencies
npm install
-
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
-
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.
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.
You can find libraries with detailed documentation in the libs/
directory:
React components for managing conversation history.
React components for chat interface.
DIAL Api client library.
React components for downloading SDMX data.
SDMX Api client library.
Utilities for sharing conversations via link or QR code.
Shared TypeScript interfaces.
Reusable React components.
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
- DIAL API Documentation
- Next.js Documentation
- NX Documentation
- Tailwind CSS
- NextAuth.js Documentation
We welcome contributions! Please see our Contributing Guide for details on:
- Code style guidelines
- Testing requirements
- Pull request process
If you discover a security vulnerability, please refer to our Security Policy.
MIT - see the LICENSE file for details.
- AI-DIAL - Entrypoint for all AI Dial projects
Made by EPAM Systems
`