Skip to content

XuanNguyen-UET/HEX-LITE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hex Lite

A lightweight web-based data notebook for Python and SQL code execution, inspired by Hex.

🏗️ Architecture

hex_lite/
├── backend/          # FastAPI + Python (IPython kernel, DuckDB)
├── frontend/         # Next.js + React + TypeScript
└── docs/             # Documentation

🚀 Quick Start

Prerequisites

  • Python 3.12+ (with uv package manager recommended)
  • Node.js 20+ (with pnpm package manager)
  • PostgreSQL 15+ (for metadata storage)
  • Docker (optional, for running PostgreSQL)

Backend Setup

cd backend

# Create virtual environment with uv
uv venv
source .venv/bin/activate  # Linux/Mac
# .venv\Scripts\activate   # Windows

# Install dependencies
uv pip install -e .

# Copy environment file
cp .env.example .env
# Edit .env with your database credentials

# Start PostgreSQL (using Docker)
docker-compose up -d

# Run database migrations
alembic upgrade head

# Start backend server
uvicorn app.main:app --reload --port 8000

Frontend Setup

cd frontend

# Install dependencies
pnpm install

# Start development server
pnpm dev

Access the Application

🔧 Environment Variables

Backend (backend/.env)

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/hex_lite

# Security
ENCRYPTION_KEY=your-fernet-key-here

# CORS
CORS_ORIGINS=http://localhost:3000

# Optional
DEBUG=true
SQL_LOG_LEVEL=WARNING

Frontend (frontend/.env.local)

NEXT_PUBLIC_API_URL=http://localhost:8000

📚 Features

  • ✅ Python code execution via IPython kernel
  • ✅ SQL query execution via DuckDB
  • ✅ Multiple database connections (PostgreSQL, MySQL, SQLite)
  • ✅ CSV/Parquet/Excel file upload
  • ✅ Notebook persistence
  • ✅ Session isolation (each notebook = separate kernel)
  • ✅ Admin dashboard

🛠️ Tech Stack

Backend

  • FastAPI
  • SQLAlchemy + Alembic
  • IPython/Jupyter Client
  • DuckDB
  • PostgreSQL

Frontend

  • Next.js 14 (App Router)
  • React 19
  • TypeScript
  • Tailwind CSS
  • CodeMirror 6
  • Zustand

📝 License

MIT

About

A lightweight web-based data notebook for Python and SQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors