Skip to content

bakayu/blinkzero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blinkzero

CI Status Vercel Deployment Rust Version Powered by Solana Release Version License

image

A visual environment for designing, configuring, and deploying Solana Actions (Blinks) without writing code.

Warning

Currently the platform is running on devnet.

Motivation

Creating Solana Actions currently requires manual coding, which limits adoption; This project aims to remove this barrier by enabling the visual construction and deployment of Blinks without engineering dependencies.

Solution

blinkzero solves this by providing a visual abstraction layer over the Solana Actions specification. Instead of manually coding API endpoints, users define parameters through a GUI which the system compiles into valid Action payloads.

Unlike generic boilerplate templates, this architecture:

  • Abstracts Lifecycle Management: Automatically handles the GET (metadata) and POST (transaction) request cycle required by the Actions spec, eliminating common configuration errors.
  • Enforces Safety Constraints: Uses pre-validated transaction builders for common patterns (e.g., SPL transfers, NFT minting) to prevent the construction of malicious or malformed payloads.

Note

Planned Feature: Hot-Swappable Configuration - Stores Blink definitions as structured data, allowing users to update metadata (labels, icons, descriptions) instantly without redeploying the underlying infrastructure.

Screen Shots

ss_1

ss_2

ss_3

ss_4

Stack

  • Frontend (Builder): Next.js, React, TypeScript
  • Backend (API & TX Engine): Rust (Axum/Tokio), Solana SDK
  • Database: PostgreSQL
  • Infrastructure: Vercel (Frontend), Docker (Backend)

API Reference

The backend exposes a REST API compliant with the Solana Actions specification.

1. Create Blink

Registers a new Blink configuration in the database.

  • Endpoint: POST /api/blinks

  • Content-Type: application/json

  • Body:

    {
    "title": "title",
    "icon_url": "https://example.com/image.png",
    "description": "description",
    "label": "Donate",
    "wallet_address": "abC2...",
    "type": "donation", 
    "config": {
        "amount": 0.5
     }
    }

    Supported types: donation, payment, vote

    Response:

    {
      "id": "{id}",
      "action_url": "https://your-api.com/api/actions/{id}"
    }

2. Get Action Metadata (GET)

Returns the Action metadata required by the Solana Actions specification (dialects).

Endpoint: GET /api/actions/{id}

Response:

{
  "icon": "https://example.com/image.png",
  "label": "Donate",
  "title": "title",
  "description": "description",
  "links": {
    "actions": [
      {
        "label": "Donate",
        "href": "/api/actions/{id}?amount=0.5"
      }
    ]
  }
}

3. Build Transaction (POST)

Constructs the unsigned transaction payload for the user to sign.

Endpoint: POST /api/actions/{id}

Query Parameters:

  • amount (optional): Amount of SOL to transfer.

  • selection (optional): Vote option selected.

    Body:

    {
      "account": "UserWalletAddress..."
    }

    Response:

    {
      "transaction": "base64_encoded_transaction_string...",
      "message": "Send 0.5 SOL"
    }

Local Development

The repository is structured as a monorepo. You must run the backend services before starting the frontend interface.

1. Backend Setup (Transaction Engine)

The Rust backend handles transaction serialization and interaction with the Solana RPC.

  1. Navigate to the server directory:

    cd backend
  2. Configure environment variables:

    Create a .env file with your RPC URL and Backend URL (optional).

  3. Run the Rust server:

    cargo run
  4. For a better development experience, use the following command with cargo watch: (bunyan is used to prettify the trace logs, can be installed with cargo install bunyan)

    cargo watch -x 'clippy --all-features --all-targets -- -D warnings' -x test -x run | bunyan

2. Frontend Setup (Visual Builder)

The Next.js application provides the UI for creating and managing Blinks.

  1. Open a new terminal and navigate to the web directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    Copy .env.example to .env.local. Ensure NEXT_PUBLIC_API_URL points to your running Rust backend (default: http://localhost:8000).

  4. Run the development server:

    npm run dev

Deployment

Frontend (Vercel)

  1. Push the code to your git repository.
  2. Import the project into Vercel, setting the Root Directory to apps/web.
  3. Add the environment variables defined in .env.example.
  4. Deploy.

Backend

The Rust backend requires a long-running server environment (e.g., VPS, Shuttle, or a Docker container). It cannot be deployed to Vercel Edge Functions due to the heavy compute requirements of the Rust Solana SDK.

License

MIT License