Skip to content

Repository files navigation

Aeternity Playground

A browser-based IDE for writing, compiling, deploying, and testing Aeternity smart contracts in Sophia. Inspired by Solana Playground.

Features

  • Monaco editor with Sophia syntax highlighting, snippets, and live error markers
  • Compile and deploy contracts to testnet, mainnet, or a local devmode node
  • ACI-driven contract interaction UI (call, read, view results)
  • In-browser test runner with aeproject-compatible globals
  • Project management with templates (Hello World, Simple Storage, Fungible Token, NFT)
  • Share projects via unique URL
  • Wallet connect (Superhero) and built-in playground account

Architecture

aeternity-playground/
  apps/
    client/    React 18 + Vite + shadcn/ui + Monaco + xterm.js
    server/    NestJS + TypeORM + PostgreSQL
    shared/    Shared types and constants
  templates/   Contract project templates
  docker/      Devmode node & proxy config

Prerequisites

  • Node.js 22+
  • pnpm 10+
  • Docker & Docker Compose (for database and devmode node)

Local Development

# Install dependencies
pnpm install

# Start full dev stack (postgres + devmode node + server + client)
docker compose -f docker-compose.dev.yml up -d

# Or just database + devmode node, then run apps locally:
docker compose -f docker-compose.dev.yml up -d postgres aeternity-node aeternity-compiler aeternity-proxy
pnpm dev

Environment Variables

Copy .env.example to .env and configure:

Variable Description Default
DATABASE_HOST PostgreSQL host localhost
DATABASE_PORT PostgreSQL port 5432
DATABASE_NAME Database name aepg
DATABASE_USER Database user aepg
DATABASE_PASSWORD Database password (required)
TYPEORM_SYNC Auto-sync schema (true/false) false
PORT Server port 3001
NODE_ENV Environment development
CORS_ORIGIN Allowed CORS origin http://localhost:3000
COMPILER_URL Sophia compiler URL https://v8.compiler.aepps.com
NODE_URL Aeternity node URL https://testnet.aeternity.io
DEVMODE_NODE_URL Local devmode node (empty = disabled) (empty)
DEVMODE_COMPILER_URL Local devmode compiler (empty)

Docker Deployment

# Production (postgres + server + client behind external TLS)
cp .env.example .env   # fill in DATABASE_PASSWORD, CORS_ORIGIN, etc.
docker compose up -d   # exposes only port 80 for the client

# Local dev (full stack with devmode node and debug ports)
docker compose -f docker-compose.dev.yml up -d
# Client: http://localhost:3000
# Server: http://localhost:3001
# Devmode node: http://localhost:3004
# Swagger: http://localhost:3001/api/docs (non-production only)

Testing

# Unit tests
pnpm test

# Template tests (requires devmode node)
docker compose -f docker-compose.test.yml up -d
cd templates/hello-world && npm install && npx aeproject test
docker compose -f docker-compose.test.yml down

License

MIT

About

BETA: Quickly develop, deploy and test Sophia Contracts from browsers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages