How ziptalk/kaiseki-frontend-typescript works
Project Type and Purpose
• This is a full‐stack web application built with Next.js (the “app” directory) that serves React pages, implements serverless API endpoints (under app/api), and interacts with blockchain contracts (via ABIs, ethers.js) and external services (Pinata/IPFS, TradingView datafeeds). Its features include token creation, raffles, charting, and on‐chain interactions.
High‐Level Architecture Components
a. Client (Browser)
• Renders React pages and components (under app/, components/, layout/)
• Loads static assets (fonts, images, charting_library) from CDN or Next.js public folder
• Embeds TradingView chart UI (public/static/charting_library + custom UDF datafeed)
b. Next.js Server / Serverless Platform (Vercel)
• Page Routes (app/[...]/page.tsx): SSR/SSG & client hydration
• API Routes (app/api/pinata/route.ts): serverless functions for Pinata/IPFS uploads
• Environment & Build: next.config.mjs, .env.example
c. Blockchain Interaction Layer
• utils/ethersProvider.ts and ethersSigner.ts: RPC connections to Ethereum or testnets
• abis/: JSON interfaces & mock providers for smart contracts (ReserveToken, interfaces, lib)
• global/contracts.ts: on‐chain addresses & ABIs
d. External Services
• Ethereum JSON‐RPC (Infura/Alchemy/etc.)
• Pinata/IPFS REST API
• TradingView Datafeed (custom under public/static/datafeeds/udf)
• CDN for charting_library bundles
Architectural Patterns & Design Principles
• Separation of Concerns: UI (components/layout) vs. data layer (utils/apis, ethers) vs. static assets vs. API functions
• Serverless Functions: lightweight back‐end under app/api
• Client‐Side Charting: TradingView chart library loaded statically, communicates with a custom UDF provider
• Smart Contract Abstraction: ABIs in “abis/” + ethers provider in “utils/”
Technologies & Frameworks
• Next.js (React + SSR/SSG + API Routes)
• TypeScript
• ethers.js (blockchain RPC client)
• Pinata REST API (upload metadata to IPFS)
• TradingView Charting Library (public/static/charting_library) + custom UDF datafeed
• ESLint, Prettier, Tailwind/PostCSS (postcss.config.mjs)