How ptanh05/nckh_2024 works
Project type and purpose
• This is a full-stack, blockchain-enabled web application (a Cardano dApp).
• Frontend: Next.js (App Router, React) with TypeScript/JSX pages under app/.
• Backend/API: Next.js serverless routes under app/api/ that wrap database operations and business logic.
• Service layer: On-chain logic (CIP-68 NFT operations and vesting contracts) under service/.
• Database: SQLite or Postgres (inferred from app/api/sql/db.js, schema.js).
• Blockchain network: Cardano, via app/cardano/WalletContext.tsx and adapter files in service/nftcip68 & service/vesting.
File structure
Top-level directories:
• app/ – frontend pages, UI flows (mint, burn, lock, unlock, update NFT), plus serverless API routes under app/api.
• service/ – pure business-logic modules for NFT CIP-68 and vesting on Cardano, including Plutus artifacts.
• components/ & components/ui/ – shared React UI primitives and layout components (navbar, footer, theme provider).
• hooks/ – custom React hooks for mobile detection and toast notifications.
• lib/ – shared utilities.
• public/ & styles/ – static assets and global CSS.
• config files (next.config.mjs, tailwind.config.ts).
• db.mjs & schema.mjs – top-level database definitions.
README
• Minimal content, so our understanding is driven by the code layout and naming conventions.
– Blue for frontend components,
– Green for backend/API,
– Orange for blockchain interactions,
– Grey for DB.