How sanidhyarathore/teamverse-frontend works
Project type and purpose
• Teamverse-Frontend is a standalone web application built on Next.js (App Router) that provides a gamified, blockchain-enabled team-bonding experience.
• It’s primarily a front-end SPA/SSR hybrid that:
• Renders game pages and onboarding flows under /app
• Hosts reusable UI components in components, components/ui, and app/components
• Integrates with Argent Invisible Wallet for seamless Web3 authentication and transaction submission
File structure
Top-level areas:
• /app – Next.js App Router: page folders (e.g. create, game-setup, leaderboard, etc.), global layout and CSS
• /components – shared, cross-page React components, contexts, hooks under /hooks
• /lib & /app/lib – utility functions and constants
• Config & metadata – next.config.ts, Tailwind/PostCSS configs, ESLint, TypeScript
Architectural patterns & clues:
• File-based routing via nested /app directories → each folder with page.tsx is a route
• Presentation layer separated into UI primitives (components/ui and app/components) and higher-level page components
• State management via React Context (DarkModeContext), custom hooks (useToast), and local store in onboarding
• External integration points (Argent wallet, potential backend APIs or blockchain RPC endpoints stored in env vars)
Key README insights
• Tech stack: Next.js (SSR/SSG), Tailwind CSS, Radix UI, TypeScript, Wallet integration
• Purpose: drive user flows (onboarding → choose game → play → leaderboard)
• Blockchain is used as an inclusion layer via Argent Invisible Wallet
Diagramming guidance
a. Main components to represent:
– Browser / Client – React app running in user’s browser
– Next.js Server (if SSR/Edge), rendering pages and handling API routes (if any)
– UI Layer – presentational components and page layouts
– State Layer – React Contexts, custom hooks, local store (Onboarding store)
– Integration Layer – Web3 connector (Argent Invisible Wallet SDK), utility libs, API service modules
– External Services – Blockchain network (e.g. Ethereum L2), optional backend or API endpoints
b. Relationships & interactions:
• User’s browser issues HTTP/SSR requests to Next.js server → server renders or hydrates React pages
• UI components use Contexts/hooks to fetch or mutate data
• Integration layer invokes Argent Wallet SDK for authentication, signing, and on-chain transactions
• Static assets loaded directly from CDN or public
c. Architectural patterns & principles:
– Separation of concerns: routing (Next.js App Router) vs. presentation (components) vs. integration (lib/hooks)
– Component re-use: UI primitives (Radix + Tailwind) are wrapped in components/ui and used throughout
– Unidirectional data flow: page → layout → components → hooks → services
– Feature folders under /app for collocating code for each route
d. Technologies & frameworks to annotate:
• Next.js App Router (SSR/SSG/ISR)
• React + TypeScript
• Tailwind CSS + Radix UI
• Argent Invisible Wallet (Web3 onboarding)
• Custom hooks & Context API
• Node-based build & dev server (Vercel or self-hosted)
Detail & coverage
– Call out shared contexts (DarkModeContext, Toast)
– Indicate environment variables driving the integration endpoints
– Show potential build/deploy pipeline (GitHub Actions CI → Vercel) at a high level if relevant