Skip to content

Technical Architecture

System Overview

MemeMint's architecture follows a modular design with clear separation of concerns:

┌─────────────────────────────────────────────────────────────┐
│                   Telegram Mini App UI                       │
└───────────────────────────┬─────────────────────────────────┘

┌───────────────────────────────┼─────────────────────────────┐
│  ┌───────────────┐  ┌─────────┴──────────┐  ┌──────────────┐ │
│  │ AI Generation │  │ Business Logic     │  │ TON          │ │
│  │ Service       │◄─┤ Layer              ├──► Integration   │ │
│  └───────────────┘  └────────────────────┘  └──────────────┘ │
│                     Core Application Layer                    │
└─────────────────────────────────────────────────────────────┘

┌───────────────────────────────┼─────────────────────────────┐
│  ┌───────────────┐  ┌─────────┴──────────┐  ┌──────────────┐ │
│  │ Smart         │  │ Off-chain          │  │ Data         │ │
│  │ Contracts     │◄─┤ Bridge             ├──► Storage      │ │
│  └───────────────┘  └────────────────────┘  └──────────────┘ │
│                    Infrastructure Layer                       │
└─────────────────────────────────────────────────────────────┘

Core Components

1. Frontend Layer

Telegram Mini App UI

  • Framework: Telegram Mini App SDK
  • State Management: React Context/Redux
  • UI Framework: Custom components with Tailwind CSS
  • Key Views:
    • Meme Creation/Minting Flow
    • Coin Discovery/Browsing
    • Trading Interface
    • User Portfolio/Profile

Integration Points:

  • Telegram Bot API for notifications
  • TON Connect for wallet integration
  • AI Service for image generation

2. Application Layer

Business Logic Layer

  • Handles core application flows
  • Manages user sessions and state
  • Processes transactions and orders
  • Implements fee calculation and distribution

AI Generation Service

  • Integration with Stable Diffusion API
  • Prompt management and template system
  • Image processing and optimization
  • Content moderation system

TON Integration Module

  • Wallet connection and management
  • Transaction creation and signing
  • Contract interaction abstraction
  • Balance and asset tracking

3. Infrastructure Layer

Smart Contracts

  • Coin Creation Contract: Handles minting and parameters
  • AMM Contract: Manages trading pools and swaps
  • Treasury Contract: Manages fees and rewards

Off-chain Bridge

  • Synchronizes on-chain and off-chain data
  • Handles event processing and callbacks
  • Manages transaction queue and confirmations

Data Storage

  • User Profiles and Preferences
  • Coin Metadata and Statistics
  • Transaction History
  • Market Analytics

Key Technical Workflows

Meme Coin Creation Flow

  1. User provides prompt or uploads image
  2. AI service generates meme image
  3. User confirms and sets parameters
  4. Frontend constructs contract call
  5. Wallet signs transaction
  6. Smart contract processes minting
  7. Backend records metadata
  8. UI updates to show new coin

Trading Flow

  1. User selects coin and trade amount
  2. System calculates expected price impact
  3. User confirms transaction
  4. Wallet signs transaction
  5. AMM contract processes swap
  6. Fees are collected and distributed
  7. User balance is updated
  8. Transaction is recorded in history

Backend Services

API Layer

  • REST API for standard operations
  • WebSocket for real-time updates
  • GraphQL for complex data queries

Processing Services

  • Image Processing Service
  • Blockchain Indexer
  • Market Analytics Engine
  • Notification Service

Data Model (Simplified)

Coin Entity

  • id: Unique identifier
  • name: Coin name
  • symbol: Coin symbol
  • image: IPFS hash of meme image
  • creator: Creator address
  • creationTime: Timestamp
  • initialSupply: Total supply amount
  • poolBalances: Current liquidity pool state
  • tradingStatistics: Volume, price history, etc.

User Entity

  • address: Wallet address (primary ID)
  • createdCoins: List of created coins
  • tradingHistory: Recent trades
  • holdingStats: Current portfolio
  • rewardsEarned: Creator/HODL rewards
  • preferences: User settings

Deployment Architecture

PoC Environment

  • Frontend: Vercel/Netlify
  • API Services: Serverless Functions
  • Database: MongoDB Atlas
  • Blockchain: TON Testnet
  • AI Service: Managed API service

Security Considerations

  • Wallet connection security
  • Rate limiting
  • Smart contract access controls
  • API authentication

MemeMint - Hackathon Project