Skip to content

anindaghosh/minto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Minto - B2B Token Airdrop Platform on Aptos

Minto Logo

Enterprise-grade token distribution platform powered by Aptos blockchain

Demo β€’ Documentation β€’ Report Bug

License: MIT Aptos

πŸš€ Overview

Minto is a comprehensive B2B platform that enables Web3 companies to create, manage, and distribute token airdrops efficiently on the Aptos blockchain. Built with modern technologies and best practices, it provides an enterprise-grade solution for token distribution campaigns.

✨ Key Features

  • πŸ” Multiple Authentication Methods

    • Google OAuth (Keyless authentication)
    • Wallet connection (Petra, Martian, Pontem)
    • Email/password (coming soon)
  • πŸ“Š Campaign Management Dashboard

    • Create and configure airdrop campaigns
    • Real-time analytics and reporting
    • Participant tracking and eligibility management
    • Multi-step campaign creation wizard
  • 🎯 Distribution Methods

    • First-Come-First-Serve (FCFS)
    • Lottery system
    • Equal distribution
    • Tiered access
    • Dutch auction
    • Engagement-based rewards
  • βœ… Eligibility Criteria

    • Open to all
    • Whitelist-based
    • NFT holder verification
    • Token holder requirements
    • Custom criteria
  • πŸ’° Cost Advantages

    • 100x cheaper gas fees vs Ethereum
    • Sub-second transaction finality
    • Parallel execution engine
    • Minimal infrastructure costs

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Landing   β”‚      β”‚   Frontend   β”‚      β”‚   Backend   β”‚
β”‚   (React)   β”‚ ───▢ β”‚  Dashboard   β”‚ ◀──▢ β”‚  (FastAPI)  β”‚
β”‚             β”‚      β”‚   (React)    β”‚      β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                            β”‚                     β”‚
                            β”‚                     β”‚
                            β–Ό                     β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚     Aptos Blockchain         β”‚
                     β”‚   (Smart Contracts - Move)   β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Frontend

  • React 18 + TypeScript
  • Vite (Build tool)
  • Mantine UI v7 (Component library)
  • Zustand (State management)
  • React Query (Data fetching)
  • Aptos TypeScript SDK
  • React Router v6

Backend

  • FastAPI (Python 3.11+)
  • SQLAlchemy + Alembic (ORM & Migrations)
  • PostgreSQL (Database)
  • Pydantic (Validation)
  • python-jose (JWT)
  • Aptos Python SDK

Blockchain

  • Move language (Smart contracts)
  • Aptos blockchain
  • Aptos CLI

πŸ“ Project Structure

minto/
β”œβ”€β”€ backend/              # FastAPI backend API
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ models/      # SQLAlchemy database models
β”‚   β”‚   β”œβ”€β”€ schemas/     # Pydantic schemas
β”‚   β”‚   β”œβ”€β”€ routers/     # API endpoints
β”‚   β”‚   β”œβ”€β”€ services/    # Business logic
β”‚   β”‚   └── main.py      # FastAPI app entry
β”‚   β”œβ”€β”€ alembic/         # Database migrations
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ frontend/            # React dashboard application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/  # React components
β”‚   β”‚   β”œβ”€β”€ pages/       # Page components
β”‚   β”‚   β”œβ”€β”€ hooks/       # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ services/    # API & blockchain services
β”‚   β”‚   β”œβ”€β”€ store/       # Zustand stores
β”‚   β”‚   β”œβ”€β”€ types/       # TypeScript types
β”‚   β”‚   └── utils/       # Utility functions
β”‚   └── package.json
β”‚
β”œβ”€β”€ landing/             # Marketing landing page (TODO)
β”‚   └── ...
β”‚
β”œβ”€β”€ contracts/           # Move smart contracts (TODO)
β”‚   β”œβ”€β”€ sources/
β”‚   β”‚   └── campaign.move
β”‚   β”œβ”€β”€ Move.toml
β”‚   └── scripts/
β”‚
└── IMPLEMENTATION_GUIDE.md  # Detailed implementation guide

πŸš€ Quick Start

Prerequisites

1. Clone the Repository

git clone https://github.com/yourusername/minto.git
cd minto

2. Set Up Backend

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Create database
createdb minto

# Run migrations
alembic upgrade head

# Start server
uvicorn app.main:app --reload

Backend runs on http://localhost:8000

API docs available at http://localhost:8000/docs

3. Set Up Frontend

cd frontend

# Install dependencies
pnpm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Start development server
pnpm dev

Frontend runs on http://localhost:5173

4. Set Up Smart Contracts (Coming Soon)

cd contracts

# Compile contracts
aptos move compile

# Run tests
aptos move test

# Deploy to devnet
aptos move publish --profile devnet

πŸ”§ Configuration

Backend Environment Variables

DATABASE_URL=postgresql://user:password@localhost:5432/minto
SECRET_KEY=your-secret-key-here
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24
APTOS_NETWORK=devnet
APTOS_NODE_URL=https://fullnode.devnet.aptoslabs.com/v1
APTOS_PRIVATE_KEY=0x...
ALLOWED_ORIGINS=http://localhost:5173
DEBUG=True

Frontend Environment Variables

VITE_APTOS_NETWORK=devnet
VITE_APTOS_NODE_URL=https://fullnode.devnet.aptoslabs.com/v1
VITE_API_BASE_URL=http://localhost:8000
VITE_CONTRACT_ADDRESS=0x...
VITE_GOOGLE_CLIENT_ID=your-google-oauth-client-id

πŸ“š API Documentation

Authentication

POST /auth/login

Login with wallet or Google OAuth

Request (Google Keyless):

{
  "provider": "google",
  "id_token": "eyJhbGc..."
}

Request (Wallet):

{
  "provider": "wallet",
  "wallet_address": "0x1234...",
  "signature": "0xabcd...",
  "message": "Sign this message..."
}

Response:

{
  "user": {
    "id": "uuid",
    "wallet_address": "0x...",
    "email": "user@example.com",
    "role": "user"
  },
  "access_token": "eyJhbGc...",
  "refresh_token": "eyJhbGc...",
  "expires_in": 3600
}

Campaigns

GET /campaigns

List all campaigns with pagination

Query Parameters:

  • skip (int): Offset for pagination
  • limit (int): Number of items (max 100)
  • status (string): Filter by status (draft/live/ended/paused)

POST /campaigns

Create new campaign (requires company role)

Request:

{
  "name": "Summer Token Airdrop",
  "token_address": "0x1::aptos_coin::AptosCoin",
  "total_supply": 1000000,
  "amount_per_claim": 100,
  "start_time": "2024-01-01T00:00:00Z",
  "end_time": "2024-12-31T23:59:59Z",
  "eligibility_type": "open",
  "distribution_type": "fixed",
  "max_claims_per_wallet": 1
}

Claims

POST /claims/check-eligibility

Check if wallet is eligible to claim

Request:

{
  "campaign_id": "uuid",
  "wallet_address": "0x..."
}

Response:

{
  "is_eligible": true,
  "max_claimable_amount": 100,
  "remaining_claims": 1
}

POST /claims

Create new claim

See full API documentation at /docs when running the backend.

🎨 Design System

Colors

  • Primary Green: #10b981
  • Accent Emerald: #059669
  • Background: #ffffff (light) / #000000 (dark)
  • Sidebar: #0a0a0a (light) / #064e3b (dark)

Typography

  • Font: Inter (400, 500, 600, 700)
  • Scaling: Fluid with clamp()
  • Numbers: Tabular numerals for data

Spacing

  • Grid: 8px base unit
  • Values: 8, 16, 24, 32, 48, 64px

Components

  • Cards: 8px border radius
  • Buttons: 6px border radius
  • Modals: 12px border radius
  • Inputs: 4px border radius

πŸ” Security Features

  • JWT Authentication with refresh tokens
  • Wallet signature verification
  • Google OAuth integration
  • CORS protection
  • SQL injection prevention (SQLAlchemy ORM)
  • XSS protection (Input sanitization)
  • Rate limiting (TODO)
  • HTTPS enforcement (production)

πŸ§ͺ Testing

Backend Tests

cd backend
pytest

Frontend Tests (TODO)

cd frontend
pnpm test

Smart Contract Tests (TODO)

cd contracts
aptos move test

πŸ“Š Database Schema

Users Table

users (
  id UUID PRIMARY KEY,
  wallet_address VARCHAR UNIQUE,
  email VARCHAR UNIQUE,
  display_name VARCHAR,
  avatar_url VARCHAR,
  role VARCHAR,  -- user, company, admin
  auth_provider VARCHAR,  -- wallet, google, apple, twitter
  is_verified BOOLEAN,
  created_at TIMESTAMP,
  updated_at TIMESTAMP
)

Campaigns Table

campaigns (
  id UUID PRIMARY KEY,
  creator_id UUID REFERENCES users(id),
  name VARCHAR(100),
  contract_address VARCHAR,
  token_address VARCHAR,
  total_supply INTEGER,
  claimed_supply INTEGER,
  amount_per_claim INTEGER,
  start_time TIMESTAMP,
  end_time TIMESTAMP,
  eligibility_type VARCHAR,
  distribution_type VARCHAR,
  status VARCHAR,  -- draft, live, ended, paused
  created_at TIMESTAMP,
  updated_at TIMESTAMP
)

Claims Table

claims (
  id UUID PRIMARY KEY,
  campaign_id UUID REFERENCES campaigns(id),
  user_wallet VARCHAR,
  amount INTEGER,
  tx_hash VARCHAR UNIQUE,
  status VARCHAR,  -- pending, processing, completed, failed
  claimed_at TIMESTAMP,
  processed_at TIMESTAMP
)

🚒 Deployment

Backend (Railway / Render / Fly.io)

  1. Create PostgreSQL database
  2. Set environment variables
  3. Deploy with: uvicorn app.main:app --host 0.0.0.0 --port $PORT
  4. Run migrations: alembic upgrade head

Frontend (Vercel / Netlify)

  1. Build command: pnpm build
  2. Output directory: dist
  3. Set environment variables (VITE_*)
  4. Configure SPA fallback routing

Smart Contracts (Aptos Mainnet)

  1. Compile: aptos move compile
  2. Test: aptos move test
  3. Deploy: aptos move publish --profile mainnet

πŸ›£οΈ Roadmap

  • Backend API with FastAPI
  • Google Keyless authentication
  • Frontend dashboard with Mantine
  • Campaign CRUD operations
  • Complete campaign creation wizard
  • Smart contract implementation
  • Landing page
  • NFT-gated airdrops
  • Multi-token support
  • Analytics dashboard
  • Email notifications
  • Webhook integrations
  • Mobile app

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Contact


Built with ❀️ for the Aptos ecosystem

⬆ back to top

About

Minto is a comprehensive B2B platform that enables Web3 companies to create, manage, and distribute token airdrops efficiently on the Aptos blockchain. Built with modern technologies and best practices, it provides an enterprise-grade solution for token distribution campaigns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors