Skip to content

kompojs/kompo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

147 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Kompo Logo

Code orchestration for web3.

Deploy modular adapters. Own your code.

Version License Twitter Discord


Why Kompo?

Building web3 apps today means starting from scratch every time.

You spend 40-60% of your time on boilerplate:

  • Setting up wallet connections (RainbowKit, SIWE, session management)
  • Configuring indexers (Ponder, The Graph, custom event listeners)
  • Managing RPC providers (Alchemy, Infura, fallbacks)
  • Handling multi-chain logic (contract addresses, chain routing)
  • Generating types from ABIs and schemas

And when you want to switch providersβ€”you refactor everything.

Kompo eliminates the boilerplate while keeping you 100% in control.


What is Kompo?

A code orchestration framework for TypeScript web3 developers.

Built on Hexagonal Architecture (Ports & Adapters), Kompo lets you:

  • Declare your stack once in a single config file.
  • Deploy modular adapters directly into your codebase.
  • Swap providers anytime without refactoring.

The Terraform of web3 code. Declare once, swap providers anytime.

Think: Terraform for your application code, not your infrastructure.

Infrastructure as Code democratized cloud deployment. Code as a Service democratizes web3 development.


What You Get

✨ Pre-Built Adapters 🎯 Production Patterns πŸš€ Templates Included
Wallet: RainbowKit + SIWE Type-safe contract interactions NFT Marketplace
Indexing: Ponder, The Graph Multi-chain configuration DAO Governance
RPC: Alchemy, Infura, QuickNode Error handling & retries DeFi Dashboard
Storage: Pinata, Arweave Rate limiting & caching Cross-chain yield aggregator
Database: Postgres, Neon Session management

⚑ Quick Start

1. Create a project

pnpm create kompo@latest my-awesome-app
cd my-awesome-app

2. Choose your stack (interactive CLI)

? Select authentication strategy
  β†’ Wallet + session (SIWE + NextAuth)

? Select indexing provider
  β†’ Ponder

? Select chains
  β†’ Ethereum
  β†’ Polygon
  β†’ Arbitrum

βœ“ Stack configured! 5 adapters installed.
βœ“ Types generated from ABIs.
βœ“ Ready to build.

3. Start building

pnpm dev

What you have:

  • βœ… Typed multi-chain wallet connection
  • βœ… Smart contract indexing configured
  • βœ… RPC provider setup with fallbacks
  • βœ… Production patterns included
  • βœ… Ready to ship

Time Saved (Real Numbers)

Task Manual Kompo
Wallet + session setup 4-6 hours 2 minutes
Multi-chain config 2-4 weeks 10 minutes
Indexer setup 3-5 hours 5 minutes
Type generation 2-3 hours 30 seconds
MVP dApp 8-12 weeks 2-3 days

πŸ›οΈ Core Architecture

Hexagonal Architecture separates business logic from infrastructure concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Your Core Logic (Pure TS)        β”‚
β”‚  (business rules, no dependencies)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Ports (Interfaces / Contracts)     β”‚
β”‚  (what your core needs)             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Adapters (Implementations)         β”‚
β”‚  (how you get it: Alchemy, Ponder)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Change an adapter (e.g., Alchemy β†’ Infura) β†’ everything else works unchanged.

Example: Swap RPC Providers

Before (3+ hours of refactoring):

// Old code using Alchemy
import { Alchemy, Network } from "alchemy-sdk";
const alchemy = new Alchemy({ apiKey: process.env.ALCHEMY_KEY });
const balance = await alchemy.core.getBalance(address);

After (1 line of config):

// kompo.config.json
{
  "adapters": {
    "rpc-provider": {
      "port": "rpc",
      "engine": "infura"
    }
  }
}
// Your code stays the same
import { rpc } from "@/composition";
const balance = await rpc.getBalance(address);

πŸš€ Use Cases Built With Kompo

NFT Marketplace (Ethereum + Polygon)

pnpm kompo add template nft-marketplace

Pre-built: Wallet connection, Contract interaction (mint, list, buy), Multi-chain contract management, Event indexing.

DAO Governance (Multi-chain)

pnpm kompo add template dao

Pre-built: Member voting, Proposal execution, Cross-chain quorum, Treasury management.

DeFi Dashboard (10+ chains)

pnpm kompo add template defi-dashboard

Pre-built: Token balance aggregation, Swap routing, Staking positions, Cross-chain liquidity.


πŸ—οΈ Key Features

πŸš€ Ship Faster

  • Pre-configured adapters for wallet auth, indexing, RPC.
  • Multi-chain setup in one file (kompo.config.json).
  • CLI scaffolds production patterns in seconds.

πŸ”„ Zero Vendor Lock-In

  • Change RPC providers with 1 line of config.
  • Swap indexers without touching your code.
  • Add new chains to existing contracts instantly.
  • Own 100% of your codebase (it's all in your repo).

🎯 Type-Safe End-to-End

  • TypeScript types generated from smart contract ABIs.
  • Full autocomplete for contract methods and events.
  • Compile-time validation prevents runtime errors.

πŸ› οΈ Production-Ready

  • Error handling and retry logic included.
  • RPC rate limiting and caching built-in.
  • Server-side signing patterns.
  • OpenTelemetry integration for monitoring.

πŸ’» Tech Stack

  • Framework: Next.js (extensible to Remix, NestJS, Express)
  • Runtime: TypeScript + Node.js
  • CLI: Powerful generator for scaffolding and code generation
  • Architecture: Hexagonal (Ports & Adapters)
  • Web3 Libraries: Viem, RainbowKit, Ponder, Alchemy SDK

🚦 Status: Beta

Kompo is currently in Beta (v0.1.0).

  • βœ… Fully functional and used in production
  • βœ… APIs stable and well-documented
  • πŸ”„ Adding new adapters and templates regularly
  • ⚠️ Expect occasional breaking changes as we move toward v1.0

πŸ“– Getting Started

1. Create a project

pnpm create kompo@latest my-app
cd my-app

2. Add an adapter

# Example: Add a Ponder Indexer
pnpm kompo add port indexer --domain blockchain
pnpm kompo add adapter ponder --port indexer --domain blockchain

3. Wire it up

# Generates the composition layer
pnpm kompo wire blockchain --app my-app

4. Configuration (kompo.config.json)

Kompo uses a central JSON configuration file (libs/config/kompo.config.json) to manage your architecture.

{
  "project": {
    "name": "my-app",
    "org": "acme"
  },
  "domains": {
    "blockchain": {
      "ports": ["indexer"]
    }
  },
  "adapters": {
    "indexer-ponder": {
      "port": "indexer",
      "engine": "ponder",
      "path": "libs/adapters/indexer-ponder"
    }
  },
  "apps": {
    "apps/my-app": {
      "ports": {
        "indexer": "indexer-ponder"
      }
    }
  }
}

5. Usage in Your App

Once wired, Kompo generates a type-safe composition layer. You simply import the domain.

// src/app/page.tsx
// Import the wired domain from the composition layer
import { blockchain } from '@/composition';

export default async function Dashboard() {
  // Access your adapters through the domain interface
  const updates = await blockchain.indexer.getLatestUpdates();

  return (
    <div>
      {updates.map(u => <div key={u.id}>{u.hash}</div>)}
    </div>
  );
}

πŸ—ΊοΈ Roadmap (Next 90 Days)

βœ… In Progress

  • QuickNode and Ankr RPC adapters
  • DAO governance template
  • Enhanced error handling and logging
  • Security best practices guide

πŸ“‹ Coming Soon (Feb-Mar)

  • Subgraph integration improvements
  • Cross-chain transaction orchestration helpers
  • Architecture review credits system

πŸ€” Exploring (Q1 2026)

  • AI-assisted code generation
  • VSCode extension for adapter management
  • Kompo Cloud for team configuration sharing

❓ FAQ

Is Kompo production-ready? Yes. It's currently used in production by teams building dApps. We're in Beta (v0.1.0) as we refine APIs and add more adapters. Expect to ship to mainnet confidently.
How is Kompo different from Scaffold-ETH? Scaffold-ETH is great for learning and quick prototypes. Kompo is built for professional developers building production apps. Kompo focuses on architecture, type safety, and zero vendor lock-in.
How is Kompo different from Thirdweb/Moralis? Thirdweb and Moralis are managed platforms (SaaS). You use their APIs and get locked into their services. Kompo is a framework. You own your code, your infrastructure, your choices. You can swap providers anytime.
Do I need to use all adapters? No. Kompo is modular. Use what you need, add more later. Start minimal and grow.
Can I use Kompo with my existing codebase? Yes. Install @kompo/core and @kompo/nextjs in your Next.js project and start integrating adapters incrementally.

🀝 Contributing

We welcome contributions from the community!

  1. Fork the repo: git clone https://github.com/kompo-dev/kompo.git
  2. Install dependencies: pnpm install
  3. Create a feature branch: git checkout -b feature/my-feature
  4. Submit a pull request.

Check out CONTRIBUTING.md for detailed guidelines.

Community Channels


License

MIT Β© 2026 SmarttDev and Kompo contributors


Kompo is built by SmarttDev and an amazing community of web3 developers.

Ready to stop rebuilding boilerplate?


Get Started β†’ | Docs β†’ | Discord β†’

About

Code Orchestration Framework Production-ready web3. Deployed in minutes, owned forever.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages