Skip to content

Kaushik2003/stacy-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

86 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŸ Stacy

The Future of Smart Contract Development is Here

A Revolutionary Web-Based IDE for Building, Compiling, and Deploying Stellar Smart Contracts


๐Ÿ”— Quick Links

Live Demo app.stacyide.xyz
Twitter @stacydotide
Analytics Dashboard View Data

๐Ÿš€ Quick Start โ€ข โœจ Features โ€ข ๐Ÿ—๏ธ Architecture โ€ข ๐Ÿ“š Documentation โ€ข ๐Ÿค Contributing


๐ŸŽฏ What is Stacy?

Stacy IDE is not just another code editorโ€”it's a complete development environment that brings the power of blockchain development to your browser. Built for the Stellar network, it eliminates the complexity of local setup and lets you focus on what matters: building amazing smart contracts.

Shown at: Stellar Monthly Builder Challenge, Stellar Builder Camp (IEM Kolkata), Hacktropica (Asansol Engineering College)

๐ŸŽจ Why Stacy IDE?

Stacy simplifies smart contract development with these core benefits:

  • Zero Setup Required - No Rust installation, no CLI tools, just pure browser-based development
  • Real-Time Compilation - Watch your code compile with live streaming logs
  • AI-Powered Development - Integrated Stella RAG AI assistant with Stellar documentation knowledge
  • Instant Deployment - Deploy to Stellar testnet with one click via Freighter wallet
  • GitHub Native - Push code, create repos, manage projects without leaving the IDE
  • TypeScript Binding Generation - Auto-generate TypeScript bindings for your contracts
  • Isolated Sandboxes - Each project runs in its own secure Docker container

๐Ÿ“Š Key Highlights

๐Ÿ“ˆ Metrics Dashboard

Metrics Dashboard

Real-time analytics tracking compilation times, deployment success rates, and AI usage patterns.

๐Ÿ–ฅ๏ธ Monitoring Server

Monitoring Server

Live server health monitoring with performance metrics and resource utilization.

๐Ÿค– AI Dashboard

AI Server

AI assistant analytics and usage tracking with RAG integration insights.

Data Indexing

Supabase-backed event streaming with PostgreSQL Materialized Views that pre-aggregate analytics data:

  • Views: mv_daily_ai_usage, mv_user_stats, mv_top_events
  • Tables: ai_interactions, sessions, events
  • Access: Real-time hooks with Row-Level Security (RLS) policies
  • Refresh: Auto-refreshed via refresh_analytics_views() cron (recommended hourly)

Table of Contents


โœจ Features

๐Ÿ”ง Core IDE Features

Feature Description
Monaco Editor Industry-standard code editor with IntelliSense, syntax highlighting, and multi-language support
Real-Time Compilation WebSocket-based compilation with live log streaming using BullMQ + Redis
WASM Output Automatic WASM binary generation and hex encoding
Multi-File Support Work with complex projects, not just single files
File Tree Explorer Visual file navigation with create/edit/delete operations
Smart Stub Detection AI identifies incomplete code and suggests implementations

๐Ÿค– AI-Powered Development

Integrated Stella RAG enables intelligent development assistance:

  • Context-Aware Responses - Automatically includes relevant documentation for accurate answers
  • Intelligent Code Generation - AI can create, update, and delete files based on natural language
  • Smart Keyword Detection - Only queries RAG for Stellar-related questions (faster responses)
  • Structured JSON Responses - AI provides both explanations and executable code changes
  • Stella RAG Integration - Trained on official Stellar & Soroban documentation

๐Ÿ”— Stellar Network Integration

Direct blockchain integration for seamless deployment:

  • Freighter Wallet Connection - Seamless integration with Stellar's most popular wallet
  • Testnet Deployment - Deploy contracts to Stellar testnet with gas fee estimation
  • Contract Interaction - Invoke contract methods directly from the IDE
  • TypeScript Bindings - Auto-generate client SDKs for your contracts
  • XDR Support - View and work with transaction XDR

๐Ÿ™ GitHub Integration

Full GitHub support for version control and collaboration:

  • OAuth Authentication - Secure GitHub login
  • Repository Management - Create new repos, push code, manage projects
  • Branch Support - Work with different branches
  • Commit History - Track your development progress
  • Multi-Repo Workspace - Switch between projects seamlessly

๐Ÿš€ Backend Infrastructure

Production-ready infrastructure with scalability:

  • Dockerized Compilation - Isolated environments for secure builds
  • WebSocket Communication - Real-time bidirectional communication via Socket.IO
  • Job Queuing - BullMQ-powered compilation queue for scalability
  • Redis Pub/Sub - Streaming logs from workers to clients
  • Python Binding Generator - Stellar CLI integration for TypeScript binding generation
  • Container Orchestration - Docker Compose for easy deployment

๐Ÿ’Ž Advanced Features

Account Abstraction & Smart Wallet

  • Smart Wallet with Custom Auth - User-deployed contract-based wallet with custom authentication logic (multi-sig, social recovery, or custom rules)
  • Flexible Authorization - Contracts define custom authorization schemes and transaction policies for programmable account control

๐Ÿ—๏ธ Architecture

Architecture Diagram

Stellar IDE's Distributed Microservices Architecture

๐Ÿงฉ System Overview

graph LR
    A[Next.js Frontend] -->|WebSocket| B[API Gateway]
    B -->|Job Queue| C[Redis/BullMQ]
    C -->|Process| D[Compilation Worker]
    D -->|Logs| C
    C -->|Stream| B
    B -->|Logs| A
    E[GitHub API] <-->|OAuth| A
    F[Stellar Network] <-->|Deploy| A
    G[Freighter Wallet] <-->|Sign| A
    H[Stella RAG API] <-->|Context| A
Loading

๐Ÿ“ฆ Technology Stack

Frontend

Layer Technology
Framework Next.js 14 with App Router
Language TypeScript 5.0
UI Library React 18
Styling Tailwind CSS + shadcn/ui
Editor Monaco Editor (VS Code engine)
State Management React Context + Custom Hooks
Real-Time Socket.IO Client
AI Integration Groq SDK + Stella RAG
Blockchain Stellar SDK, Freighter API

Backend

Layer Technology
Runtime Node.js 20 + Python 3.11
API Framework Express.js
Real-Time Socket.IO
Job Queue BullMQ
Cache/Message Broker Redis
Compilation Rust (cargo) + Stellar CLI
Containerization Docker + Docker Compose
Bindings Generator Stellar CLI binding generator

๐Ÿš€ Quick Start

Prerequisites

Before you begin, ensure you have the following installed:

  • Docker Desktop - Required for compilation
  • Node.js 18+ and pnpm - For frontend development
  • Freighter Wallet - For contract deployment (browser extension)

Option 1: Docker Setup (Recommended)

# Clone the repository
git clone https://github.com/yourusername/stellar-ide-backend-hosted.git
cd stellar-ide-backend-hosted

# Start backend services
cd vide-backend
docker-compose up -d

# Verify services are running
docker-compose ps

# Start frontend
cd ../frontend
pnpm install
pnpm dev

Visit https://localhost:3000 ๐ŸŽ‰

Option 2: Local Development

For local development without full Docker:

# Backend (Redis only)
cd vide-backend
docker-compose up -d redis
pnpm install
pnpm dev

# Frontend
cd ../frontend
pnpm install
pnpm dev:https  # HTTPS required for Freighter wallet

โš™๏ธ Configuration

Frontend Environment Variables

Create frontend/.env.local:

NEXT_PUBLIC_SOCKET_URL=http://localhost:8000
NEXT_PUBLIC_GITHUB_CLIENT_ID=your_github_oauth_app_id
GITHUB_CLIENT_SECRET=your_github_oauth_secret
GROQ_API_KEY=your_groq_api_key
STELLA_RAG_API_KEY=your_stella_rag_key  # Optional, has fallback
GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_key  # For Gemini model

Backend Environment Variables

Create vide-backend/.env:

REDIS_HOST=localhost
REDIS_PORT=6379
PORT=8000

๐Ÿ“š Documentation

Getting Started

Architecture & Design

Integration Guides

Infrastructure & Deployment


๐ŸŽฎ Usage Examples

๐Ÿ“ Create Your First Contract

Step-by-step guide to create and deploy your first smart contract:

  1. Start a New Project - Click "New Project" in the IDE
  2. Write Your Contract - Use the Monaco editor with Rust syntax highlighting
  3. Compile - Hit "Compile" to build your WASM binary
  4. Deploy - Connect Freighter wallet and deploy to testnet
  5. Interact - Use the generated TypeScript bindings to call your contract

๐Ÿค– Use AI Assistant

Example: Ask the AI to generate a counter contract:

You: "Create a simple counter contract with increment and decrement functions"
AI: *Generates complete Soroban contract with proper structure*

The AI can:

  • Generate complete contracts from descriptions
  • Fix bugs and optimize code
  • Explain Stellar-specific concepts
  • Update multiple files simultaneously
  • Detect and implement stub functions

๐Ÿ”— Generate TypeScript Bindings

Using the IDE terminal:

stellar contract bindings typescript \
  --wasm target/wasm32v1-none/release/counter.wasm \
  --output-dir ./bindings

Using the WebSocket API:

const response = await fetch("/api/bindings", {
  method: "POST",
  body: JSON.stringify({ wasmHex: compiledWasmHex }),
});

๐Ÿšข Deployment

Production Deployment

Build and deploy production images using Docker Compose:

# Build production images
docker-compose -f docker-compose.prod.yml build

# Start services
docker-compose -f docker-compose.prod.yml up -d

# Check logs
docker-compose logs -f

Pre-Deployment Checklist

Before deploying to production, ensure:

  • Redis persistence is configured
  • SSL certificates are installed
  • Production environment variables are set
  • Docker swarm is enabled for scaling (optional)
  • Monitoring stack is deployed (Prometheus/Grafana recommended)

๐Ÿค Contributing

We welcome contributions! Help us improve Stacy IDE for the Stellar community.

How to Contribute

  1. Fork the Repository - Create your own fork of the project
  2. Create a Feature Branch - Use git checkout -b feature/amazing-feature
  3. Commit Your Changes - Write clear commit messages: git commit -m 'Add amazing feature'
  4. Push to Your Branch - Push changes: git push origin feature/amazing-feature
  5. Open a Pull Request - Submit your PR for review

Development Guidelines

  • Follow TypeScript best practices and maintain type safety
  • Write tests for all new features
  • Update documentation to reflect changes
  • Follow the existing code style and patterns
  • Keep PRs focused and atomic (one feature per PR)
  • Include descriptive commit messages

๏ฟฝ Project Status

Completed Features

  • โœ… Core IDE functionality
  • โœ… Real-time compilation
  • โœ… Stellar testnet deployment
  • โœ… GitHub integration
  • โœ… AI assistant with RAG
  • โœ… TypeScript binding generation
  • โœ… Docker containerization

Planned Features

  • ๐Ÿšง Mainnet deployment (coming soon)
  • ๐Ÿšง Multi-user collaboration (planned)
  • ๐Ÿšง VSCode extension (planned)

Security Assessment

Category Score Status
Secrets 100% โœ… No Keys committed to git
API 100% โœ… Rate limiting, CSRF, no open CORS
WebSocket 100% โœ… Auth implemented, Message validation
Sandbox 80% โš ๏ธ No seccomp/AppArmor, Docker socket secured
CI/CD 65% โš ๏ธ No branch protection, Scanning enabled

๐Ÿ› Troubleshooting

Compilation Fails

Check the status and logs:

# Check Docker container status
docker-compose ps

# View worker logs
docker-compose logs compiler

# Restart services
docker-compose restart

Freighter Connection Issues

Ensure the following:

  • You're using HTTPS (required for wallet interaction)
  • Freighter extension is installed and unlocked
  • You're on Stellar testnet
  • Wallet permissions are granted to the application

WebSocket Connection Fails

Check your configuration:

  • Verify NEXT_PUBLIC_SOCKET_URL environment variable
  • Ensure backend is running on correct port
  • Check CORS configuration in backend
  • Verify firewall isn't blocking WebSocket connections

๐Ÿ“„ License

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


๐Ÿ™ Acknowledgments

We're grateful to the following projects and organizations:

  • Stellar Development Foundation - For the amazing Soroban platform
  • Freighter Team - For the best Stellar wallet integration
  • Monaco Editor Team - For the incredible code editor
  • shadcn/ui - For beautiful and accessible UI components
  • All Contributors - For making this project better every day

โญ Support Stacy IDE

If you find Stacy IDE helpful, please consider:

  • โญ Starring the repository on GitHub
  • ๐Ÿ”— Sharing it with the Stellar community
  • ๐Ÿ› Reporting bugs and requesting features
  • ๐Ÿ’ป Contributing code and documentation

๐ŸŒŸ Built with โค๏ธ for the Stellar Community

Report a Bug โ€ข Request a Feature โ€ข Discussion Board

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors