Skip to content

Krishnam2411/Cpplify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

104 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cpplify

Interactive C++ Notebook Platform β€” Jupyter-level usability for C++ developers, educators, and researchers.

License: MIT Docker

Why Cpplify?

C++ developers lack the interactive development experience that Python enjoys with Jupyter. Cpplify solves this with:

  • πŸš€ Instant Setup β€” Single Docker command gets you started
  • πŸ“ Multi-cell C++ β€” State persists across cells, just like Jupyter notebooks
  • πŸ” Cloud-backed β€” Auth via GitHub, notebooks saved to Azure Blob Storage
  • ⚑ Real-time Execution β€” Powered by Cling C++ interpreter

Quick Start

Prerequisites

  • Docker 20.10+ & Docker Compose v2+
  • Node.js 18+ (for frontend dev)

Development

# 1. Clone and configure
cp backend/.env.example backend/.env   # Fill in Supabase & Azure credentials
cp frontend/.env.example frontend/.env

# 2. Start backend (Docker with hot-reload)
docker compose -f docker-compose.dev.yml up --watch

# 3. Start frontend (separate terminal)
cd frontend && bun install && bun run dev

Production

docker compose -f docker-compose.yml up --build

Features

Feature Status
Code cells with C++ execution βœ… Complete
Markdown/text cells βœ… Complete
GitHub OAuth (Supabase) βœ… Complete
Cloud notebook storage (Azure Blob) βœ… Complete
Auto-save notebooks βœ… Complete
Kernel state persistence across cells βœ… Complete
Library magic commands (%use boost) πŸ“‹ Planned
CUDA cell support πŸ“‹ Planned
Real-time collaboration πŸ“‹ Planned

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              React Frontend (Vite + TypeScript)           β”‚
β”‚         Monaco Editor β€’ Supabase Auth β€’ Auto-save        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚ REST API + Bearer JWT (ES256)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Go Backend (chi router + IoC)                β”‚
β”‚    Auth Middleware β€’ Kernel Manager β€’ Notebook CRUD       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Kernel  β”‚ Supabase  β”‚  Supabase    β”‚  Azure Blob         β”‚
β”‚ (Cling) β”‚ Auth/JWKS β”‚  PostgreSQL  β”‚  Storage            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Docker Container (Miniconda + Cling)           β”‚
β”‚              Go + Air (hot-reload) β€’ Python 3            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

cpplify/
β”œβ”€β”€ backend/                      # Go backend server
β”‚   β”œβ”€β”€ cmd/server/main.go        # Composition root (IoC wiring)
β”‚   β”œβ”€β”€ internal/
β”‚   β”‚   β”œβ”€β”€ api/                  # Handlers, router, auth middleware
β”‚   β”‚   β”œβ”€β”€ auth/                 # Supabase JWKS JWT validation
β”‚   β”‚   β”œβ”€β”€ config/               # Environment variable loading
β”‚   β”‚   β”œβ”€β”€ domain/               # Interfaces & models
β”‚   β”‚   β”œβ”€β”€ kernel/               # Cling process lifecycle manager
β”‚   β”‚   └── storage/              # Supabase metadata + Azure Blob
β”‚   β”œβ”€β”€ .env                      # Backend configuration
β”‚   └── supabase_schema.sql       # Database schema
β”œβ”€β”€ frontend/                     # React notebook UI
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/kernelApi.ts      # API client with JWT injection
β”‚   β”‚   β”œβ”€β”€ contexts/             # Auth context (Supabase)
β”‚   β”‚   β”œβ”€β”€ pages/                # Dashboard, Notebook, Auth
β”‚   β”‚   └── components/notebook/  # Cell components
β”‚   └── .env                      # Frontend configuration
β”œβ”€β”€ kernel/
β”‚   └── kernel_wrapper.py         # Python bridge: Go ↔ Cling REPL
β”œβ”€β”€ docs/                         # Documentation
β”œβ”€β”€ Dockerfile.dev                # Development container
β”œβ”€β”€ docker-compose.dev.yml        # Dev compose (hot-reload + watch)
└── docker-compose.yml            # Production compose

API Endpoints

All /api routes require Authorization: Bearer <supabase-jwt>.

Endpoint Method Description
/health GET Health check
/api/session POST Create kernel session
/api/session/{id} DELETE Terminate session
/api/session/{id}/reset POST Reset kernel state
/api/execute POST Execute C++ code
/api/notebooks GET List user notebooks
/api/notebooks POST Create notebook
/api/notebooks/{id} GET Get notebook content
/api/notebooks/{id} PUT Update (auto-save)
/api/notebooks/{id} DELETE Delete notebook

Cloud Services

Service Purpose
Supabase GitHub OAuth + metadata storage (PostgreSQL)
Azure Blob Notebook file storage (.cly JSON format)
Azure Container Instances Backend deployment (planned)

Development

Docker Development (Recommended)

# Start with hot-reload
docker compose -f docker-compose.dev.yml up --watch

# View logs
docker compose -f docker-compose.dev.yml logs -f

# Enter container shell
docker exec -it cpplify-dev bash

# Restart after config changes
docker compose -f docker-compose.dev.yml restart

Development Workflow

  1. Run docker compose -f docker-compose.dev.yml up --watch
  2. Edit Go code locally β†’ air auto-rebuilds inside the container
  3. Edit frontend locally β†’ Vite HMR applies changes instantly
  4. Access frontend at http://localhost:5173, backend at http://localhost:8080

Environment Setup

Backend (backend/.env):

PORT=8080
SUPABASE_URL=https://<project>.supabase.co
SUPABASE_ANON_KEY=<anon-key>
SUPABASE_SERVICE_KEY=<service-role-key>
AZURE_STORAGE_CONNECTION_STRING=<connection-string>
AZURE_STORAGE_CONTAINER=cpplify-notebooks

Frontend (frontend/.env):

VITE_SUPABASE_URL=https://<project>.supabase.co
VITE_SUPABASE_ANON_KEY=<anon-key>
VITE_API_URL=http://localhost:8080

Local Native Development (Advanced)

Only use this if you need IDE debugging for the Go backend and have Cling installed locally.

cd backend
KERNEL_PATH="cling" go run cmd/server/main.go

Roadmap

Phase Scope Status
Phase 1 Frontend + Backend + Kernel + Auth + Storage βœ… Complete
Phase 2 Library integration, export, polish 🚧 Next
Phase 3 CUDA/GPU support, profiling πŸ“‹ Planned
Phase 4 Multi-user, real-time collaboration πŸ“‹ Planned

Contributing

We welcome contributions! Please see docs/CONTRIBUTING.md.

License

MIT License β€” see docs/LICENSE for details.


Cpplify β€” Interactive C++ for everyone πŸš€

About

Interactive C++ for everyone

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors