Skip to content

adityajha2005/snapchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snapchain:Solana Smart Contracts

Next.js Solana

Snapchain is a full-stack Web3 platform combining a no-code smart contract builder with a Next.js frontend for Solana blockchain applications. Create and deploy production-ready dApps without writing Rust code.

🌟 Snapchain Features

  • Visual Contract Builder: Drag-and-drop interface for Solana programs
  • Cross-Chain Ready: Built-in support for Polkadot and NEAR ecosystems
  • One-Click Deployment: Direct to Solana devnet/mainnet from UI
  • Wallet SDK: Integrated Phantom, Solflare, and Ledger support
  • Template Contracts: Marketplace, NFT, DAO, and DeFi starters

⚡ Getting Started

Prerequisites

  • Node.js 18+ & npm 9+
  • Solana CLI (brew install solana-cli)
  • Phantom Wallet (Browser Extension)

Installation

  1. Clone the Snapchain repository:
git clone https://github.com/https://github.com/adityajha2005/snapchain.git

cd snapchain
  1. Install dependencies:
npm install
  1. Configure environment:
cp .env.example .env.local

Add your credentials:

NEXT_PUBLIC_SOLANA_CLUSTER=devnet
NEXT_PUBLIC_SNAPCHAIN_API_KEY=your_api_key_here

🛠️ Snapchain Workflow

  1. Build Contracts Visually

    • Drag blockchain components (Tokens, NFTs, Governance)
    • Export as Solana Program (Anchor-compatible)
  2. Deploy Contracts

# Using Snapchain CLI
snapchain deploy ./contracts/my_dapp.json --network devnet

# Or via dashboard interface
  1. Integrate with Frontend
// src/config/snapchain.ts
export const SNAPCHAIN_CONTRACTS = {
  NFT_MARKETPLACE: process.env.NEXT_PUBLIC_NFT_CONTRACT!,
  TOKEN_FACTORY: process.env.NEXT_PUBLIC_TOKEN_CONTRACT!,
};

📂 Architecture

snapchain-dapp/
├── contracts/            # Visual contract JSON blueprints
├── snapchain/            # Auto-generated SDK
│   ├── programs/         # Anchor-compatible Rust code
│   └── client/           # TypeScript client library
├── src/
│   ├── app/              # Next.js 14 app router
│   ├── components/       # Snapchain UI Kit
│   ├── providers/        # Web3 & Wallet context
│   └── lib/              # Blockchain utilities
└── public/               # Snapchain web assets

🖥️ Frontend Integration

Connect Wallet

import { useSnapchain } from "@snapchain/react";

const { connectWallet, connectedAddress } = useSnapchain();

return (
  <button onClick={connectWallet}>
    {connectedAddress ? truncateAddress(connectedAddress) : "Connect"}
  </button>
);

Execute Contract Method

const { execute } = useSnapchainContract("TOKEN_MINT");

const handleMint = async () => {
  const result = await execute("mintTo", {
    recipient: connectedAddress,
    amount: 100,
  });

  if (result.success) {
    toast.success("Tokens minted!");
  }
};

📈 Deploy to Production

  1. Build production bundle:
npm build
  1. Deploy to mainnet:
snapchain deploy --network mainnet-beta
  1. Host frontend:
npm run dev

📄 License

Snapchain is open-source software licensed under the MIT License.

🤝 Contributing

We welcome contributions! Please read our Contributing Guide for details on how to get involved.

📜 Disclaimer

This project is for educational purposes only. Use at your own risk. Snapchain is not responsible for any losses or damages incurred.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •