How neelshah1505/transactin works
Project type and purpose
• TransactIN is a full-stack, decentralized payment protocol built with Next.js (React) on the frontend, Next.js API routes as the backend, and Solidity smart contracts on EVM chains. It provides EIP-712 dual-signature token transfers, cross-chain support (Chainlink CCIP & Circle CCTP), on-chain verification, gasless relayers, and real-time attestation indexing (The Graph).
File structure
• Top level:
• app/ (Next 13 “app router” pages, API routes, global layout, providers)
• components/ (UI primitives & domain components)
• contract/ (ABI JSON artifacts)
• lib/ (Apollo GraphQL client)
• utils/ (formatters, validation schemas, Wagmi setup)
• Key config: next.config.mjs, tsconfig.json, tailwind.config.ts
• API routes in app/api handle fetch/store transactions and payment callbacks.
• Providers.tsx wires up Wagmi (blockchain) and Apollo (The Graph).
Readme insights
• Architecture relies on:
• Frontend Next.js (React)
• Backend API routes
• Ethers.js & Wagmi for wallet interactions & EIP-712 signing
• Solidity contracts for on-chain dual-signature verification
• Chainlink CCIP & Circle CCTP for cross-chain messages
• The Graph for attestation indexing & Apollo GraphQL queries
a. Frontend (Next.js app)
– Pages: /, /dashboard, /send-request
– React components & UI libs (Tailwind, custom modals, spinners)
– Wagmi hooks for wallet connect & EIP-712 signing
– Apollo Client for GraphQL queries to The Graph
b. API layer (Next.js app/api)
– fetch-transaction, store-transaction, latest-transactionid, payment-completed
– Orchestrates calls between frontend, The Graph, and on-chain relayer services
c. Smart Contracts (EVM)
– Dual-signature contracts verifying EIP-712 data
– Cross-chain gateways (Chainlink CCIP, Circle CCTP)
d. External Services
– Chainlink CCIP network
– Circle CCTP bridge
– The Graph indexing node
– Relayer (third-party or custom off-chain executor)
e. Data Stores
– On-chain state in smart contracts
Relationships and data flow
1. User (sender) → Next.js UI → Wagmi/Ethers.js → EIP-712 message → Wallet signature
2. UI → API /store-transaction → off-chain storage or triggers relayer
3. Recipient fetches pending transaction → signs via EIP-712
4. API /payment-completed or relayer service → submits both signatures to on-chain contract
5. Smart contract validates dual signatures → emits events
6. Chainlink CCIP / Circle CCTP handle cross-chain message passing if needed
7. The Graph indexes contract events → makes data available via GraphQL
8. Frontend queries GraphQL via Apollo → updates dashboard
Architectural patterns & design principles
• Separation of concerns: clear frontend vs. API code vs. blockchain code
• Modular React components + Tailwind CSS for style
• Provider pattern for injecting Wagmi & Apollo contexts
• Next.js “app router” conventions for server/client boundaries
• Event-driven on-chain → off-chain indexing (The Graph)
• Client-side components
• Server/API components
• On-chain components
• Off-chain services