Architecture
System architecture, data model, and blockchain integrations
Architecture
This page summarizes MomentMM's system architecture, technology choices, and database schema.
Tech Stack
- Frontend: Next.js 14 (App Router), TypeScript, TailwindCSS
- Backend: Next.js API Routes, serverless functions (Vercel)
- Database: PostgreSQL with Drizzle ORM
- Blockchains: Solana (finance), Polygon (NFTs)
- Authentication: Clerk
- Payments: Razorpay (India)
High-Level Flow
- Users sign up and optionally create a Solana wallet.
- Hosts create events that users can RSVP to.
- Payments are processed via Razorpay; RSVPs are created as pending.
- Host acceptance triggers reward distribution (SOL) and NFT minting on Polygon.
Key Tables
See whitepaper.md for the complete schema. Core tables include profiles, wallets, events, event_rsvp, nft_tickets, and collection_nft.
Blockchain Integrations
Solana
- RPC provider: Alchemy (or other providers)
- Operations: Wallet creation, balance fetch, send SOL, reward distribution
- Transactions signed server-side with encrypted private keys
Polygon
- RPC provider: Polygon public RPC / Alchemy
- Operations: ERC-721 minting, token transfers for ticket ownership
Performance & Scaling
- ISR caching for public pages
- Database connection pooling
- Transaction retry logic for on-chain operations
- Plans for Redis caching and WebSocket-based real-time features