Skip to content

Codex723/soroban-quest

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Soroban Quest

Soroban Quest

A gamified, backendless learning platform for Soroban smart contracts on Stellar.

Learn to build smart contracts through epic quests โ€” no wallet, no installation, no backend.

MIT License Vite React Stellar

๐Ÿš€ Live Demo ยท ๐Ÿ“– Documentation ยท ๐Ÿ› Report Bug ยท โœจ Request Feature


โœจ Overview

Soroban Quest is an open-source, fully client-side educational platform that teaches developers how to write Soroban smart contracts on the Stellar network through a gamified RPG-style quest system.

Inspired by Node Guardians, the platform provides:

  • ๐ŸŽฎ RPG quest narrative โ€” immersive story-driven missions
  • โŒจ๏ธ In-browser code editor โ€” Monaco Editor with Rust syntax highlighting
  • ๐Ÿงช Instant validation โ€” AST-based pattern matching (no compilation server needed)
  • ๐Ÿ† XP, levels & badges โ€” full progression system
  • ๐Ÿ—บ๏ธ Visual learning path โ€” SVG mission map with progress tracking
  • ๐Ÿ’พ Offline-first โ€” all progress saved in localStorage

Zero backend. Zero cost. Open โ†’ Code โ†’ Learn โ†’ Win.


๐ŸŽฏ Features

๐Ÿ•น๏ธ Gamified Learning

Feature Description
7 Progressive Missions From "Hello Soroban" to multi-signature contracts
XP System Earn 100โ€“400 XP per mission with exponential leveling
10 Rank Titles Progress from Initiate to Stellar Sovereign
8 Achievement Badges Unlock milestones like First Contract and Completionist
Hint System Progressive hints when you're stuck

โŒจ๏ธ In-Browser IDE

  • Monaco Editor โ€” the same editor that powers VS Code
  • Rust syntax highlighting with Soroban SDK awareness
  • Pre-loaded code templates for every mission
  • Solution reveal for learning by example

๐Ÿงช Smart Validation Engine

Since compiling Rust in the browser is not feasible without a backend, Soroban Quest uses an innovative AST-based pattern matching engine that validates:

  • โœ… Function signatures (fn name, parameters, return types)
  • โœ… Soroban attributes (#[contract], #[contractimpl])
  • โœ… Storage operations (env.storage().instance().get/set)
  • โœ… Type usage (Address, Symbol, Vec, Map)
  • โœ… Access control patterns (require_auth())
  • โœ… Syntax correctness (balanced braces/parentheses)

๐Ÿ“Š Progress Management

  • localStorage persistence โ€” progress survives browser restarts
  • JSON export/import โ€” back up and restore your journey
  • Full reset โ€” start fresh anytime

๐Ÿ—บ๏ธ Mission Roadmap

Chapter 1: The Foundations
  โ”œโ”€โ”€ ๐ŸŸข Mission 1 โ€” The First Contract      (100 XP)
  โ””โ”€โ”€ ๐ŸŸข Mission 2 โ€” Greetings Protocol      (150 XP)

Chapter 2: The Vault
  โ”œโ”€โ”€ ๐ŸŸก Mission 3 โ€” The Counter Vault       (200 XP)
  โ””โ”€โ”€ ๐ŸŸก Mission 4 โ€” Guardian Ledger         (250 XP)

Chapter 3: Advanced Protocols
  โ”œโ”€โ”€ ๐Ÿ”ด Mission 5 โ€” Token Forge             (300 XP)
  โ”œโ”€โ”€ ๐Ÿ”ด Mission 6 โ€” The Time Lock           (350 XP)
  โ””โ”€โ”€ ๐Ÿ”ด Mission 7 โ€” Multi-Party Pact        (400 XP)

Total: 1,750 XP available


๐Ÿš€ Quick Start

Prerequisites

  • Node.js v18+
  • npm (included with Node.js)

Installation

# Clone the repository
git clone https://github.com/JafetCHVDev/soroban-quest.git
cd soroban-quest

# Install dependencies
npm install

# Start the development server
npm run dev

Open http://localhost:5173/ in your browser and begin your quest! โš”๏ธ

Production Build

# Generate static files
npm run build

# Preview the build
npm run preview

The dist/ folder contains a fully static site โ€” deploy it anywhere (Vercel, Netlify, GitHub Pages, Cloudflare Pages, etc.).


๐Ÿ—๏ธ Architecture

soroban-quest/
โ”œโ”€โ”€ index.html                  # Entry point
โ”œโ”€โ”€ vite.config.js              # Vite configuration
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.jsx                # React bootstrap
โ”‚   โ”œโ”€โ”€ App.jsx                 # Router setup
โ”‚   โ”œโ”€โ”€ index.css               # Design system (~800 lines)
โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”œโ”€โ”€ Home.jsx            # Landing page with starfield animation
โ”‚   โ”‚   โ”œโ”€โ”€ MissionMap.jsx      # SVG learning path + mission cards
โ”‚   โ”‚   โ”œโ”€โ”€ MissionDetail.jsx   # Editor + story + terminal
โ”‚   โ”‚   โ””โ”€โ”€ Profile.jsx         # Stats, badges, export/import
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ””โ”€โ”€ Navbar.jsx          # Navigation with live XP display
โ”‚   โ”œโ”€โ”€ systems/
โ”‚   โ”‚   โ”œโ”€โ”€ gameEngine.js       # XP, levels, badges logic
โ”‚   โ”‚   โ”œโ”€โ”€ storage.js          # localStorage + export/import
โ”‚   โ”‚   โ”œโ”€โ”€ codeValidator.js    # Pattern matching engine
โ”‚   โ”‚   โ”œโ”€โ”€ testRunner.js       # Test orchestration
โ”‚   โ”‚   โ””โ”€โ”€ missionLoader.js    # Mission data access
โ”‚   โ””โ”€โ”€ data/
โ”‚       โ””โ”€โ”€ missions.js         # 7 mission definitions
โ””โ”€โ”€ docs/
    โ””โ”€โ”€ logo.svg                # Project logo

Tech Stack

Layer Technology
Framework React 18
Build Tool Vite 6
Code Editor Monaco Editor
Routing React Router DOM (HashRouter)
Markdown react-markdown
Persistence localStorage
Styling Vanilla CSS with custom properties

๐ŸŽจ Design

  • Dark space RPG theme with deep blues and neon accents
  • Glassmorphism cards with backdrop blur
  • Glow effects on interactive elements
  • Animated starfield on the landing page
  • Terminal-style output with typewriter animation
  • Responsive down to mobile viewports
  • Typography: Orbitron (display), Inter (body), JetBrains Mono (code)

๐Ÿค Contributing

Contributions are welcome! Here are some ways you can help:

Adding New Missions

Missions are defined in src/data/missions.js. Each mission object includes:

{
  id: 'unique-id',
  title: 'Mission Title',
  chapter: 1,
  order: 1,
  difficulty: 'beginner', // beginner | intermediate | advanced
  xpReward: 100,
  story: '# Markdown story content...',
  learningGoal: 'One-line description',
  template: '// Starter code...',
  solution: '// Reference solution...',
  checks: [
    { type: 'has_function', name: 'my_fn', params: ['env'], message: 'Error message' },
    // ... more validation checks
  ],
  hints: ['Hint 1', 'Hint 2'],
  conceptsIntroduced: ['concept1', 'concept2'],
}

Validation Check Types

Type Description
has_function Checks for function with specific name/params
returns_type Validates function return type
has_attribute Checks for Rust attributes
contains_pattern Pattern exists in code
no_pattern Pattern must NOT exist
uses_type Checks for type usage
storage_operation Validates storage get/set/has/remove
has_struct Checks for struct definition
has_import Validates use/import statements
balanced_braces Syntax validation

Development Workflow

# Fork & clone
git clone https://github.com/JafetCHVDev/soroban-quest.git

# Create a feature branch
git checkout -b feat/new-mission

# Make your changes and test
npm run dev

# Build and verify
npm run build

# Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ™ Acknowledgments


Built with โšก for the Stellar ecosystem

โฌ† Back to top

About

A gamified, backendless learning platform for Soroban smart contracts on Stellar. Write, test, and master Soroban in your browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 77.8%
  • CSS 21.4%
  • HTML 0.8%