How jim788e/mooz-website works
Project Type and Purpose
• This is a full-stack modern web application built with Next.js 15 (App Router) and TailwindCSS.
• It serves as a marketing and analytics site for the MOOZ NFT Collection on the SEI blockchain, featuring real-time stats via the Magic Eden API, static content (terms, privacy), interactive UI components, and optimized image delivery.
File Structure
• Top-level “app/” directory follows Next.js 15 conventions:
• app/page.tsx, app/layout.tsx, app/globals.css → root layout, global styles, home page
• app/api/lib → library code for external API calls (magiceden.ts, tallal-test.ts)
• app/api/stats/route.ts → server route that fetches NFT stats
• app/components & app/components/ui → reusable React components (shadcn/ui buttons, NavLink, Footer, StatsSection)
• app/privacy, app/terms & nested pages → static content routes
• “public/images” → static image assets organized by feature
• “lib/utils.ts” → shared utilities
• Config files: next.config.*, tailwind.config.js, tsconfig.json, ESLint, PostCSS, .env.example
README for Additional Insights
• Confirms Next.js + App Router, TailwindCSS, shadcn/ui
• Highlights external dependencies: Magic Eden API (for NFT stats), SEI blockchain integration, Vercel Analytics
Main Components
a. Client-Side Frontend (Next.js React app)
b. Server-Side API Routes (app/api/**)
c. External Services:
• Magic Eden API (real-time NFT marketplace data)
• SEI Blockchain (NFT contract interactions)
• Vercel Analytics (performance monitoring)
d. Static Asset Store (public/images)
Relationships and Data Flow
• User (browser) → HTTP(S) → Vercel Edge → Next.js app
• Static page requests (terms, privacy, home) served via SSG/SSR
• Dynamic data requests (stats) hit internal API route (/api/stats)
• Internal API (/api/stats) → lib/magiceden.ts → calls Magic Eden REST API → returns JSON
• Next.js server-side renders (or client-side fetches) UI with fetched stats
• Analytics events sent to Vercel Analytics
• All components share utilities (lib/utils.ts) & styles (TailwindCSS)
Architectural Patterns and Design Principles
• App Router structure for clear routing & layout separation
• “API Routes as Micro-Endpoints” pattern: single-purpose serverless functions
• Component-based UI (shadcn/ui, custom components) encourages reusability
• Static asset optimization (Next.js Image, AVIF/WebP)
• Environment variables for API keys (.env)