22 feature modules with explicit boundaries
Each module owns its components, hooks, queries, services, store, schemas, and types. Features consume barrel exports rather than each other's internals.
flagship system
Full-Stack Crypto Casino Frontend - Next.js 16, 22 Feature Modules, 6 Auth Methods, 20 Languages
I built the frontend for a crypto casino from the ground up. That meant the folder structure and state model, six sign-in methods, EVM and Solana wallet flows, live chat, game discovery, bonuses, referrals, affiliate tools, a blog, SEO pages, and i18n for 20 languages. It talks to a separate backend API while following a dense Figma design at 80-90% fidelity.
first proofThis crypto casino frontend lets users sign in with six methods, connect EVM or Solana wallets, and deposit through Quick mode or Swap mode. Server components prefetch games, banners, and SEO data into dehydrated HTML for the first render. A WebSocket updates balances, notifications, the bet feed, and bonus progress without polling. Users can chat with role-based moderation, browse and favorite games with cursor pagination and infinite scroll, and use the product in 20 languages, including RTL Arabic.
This frontend has six auth flows, more than 10 chains, moderated live chat, 20 locales including RTL Arabic, live balances, games, bonuses, referrals, affiliates, and a separate backend. Feature modules keep that work close to the feature that owns it. The three state tiers give URL state, client state, and API state separate homes. Shared config files keep settings discoverable, and Figma tokens make visual changes local. The main event channel uses native WebSocket because the Bun backend already supports it; chat uses Socket.IO because rooms and reconnection fit that job.
Next.js 16 (App Router, RSC, React Compiler) / TypeScript 5 (strict) / Bun 1.3 / Tailwind CSS v4 / shadcn/ui (base-maia variant) / Zustand 5 / TanStack Query 5 / Axios / wagmi 3 + ethers 6 (EVM, 10 chains) / @solana/kit 6 + @solana/react 6 (Solana) / next-intl 4 (20 locales) / Socket.IO (live chat) / Native WebSocket (event system) / Zod 4 / react-hook-form 7 / Framer Motion 12 / Recharts 3 / Google reCAPTCHA v3 / Web Crypto API (AES-GCM)
01 / 15The slots catalogue with infinite scroll, category filters, and saved favourites.
Each module owns its components, hooks, queries, services, store, schemas, and types. Features consume barrel exports rather than each other's internals.
The `rillex-auth` BroadcastChannel carries login, logout, and token refresh messages between open tabs. A 1.5-second grace period gives a second tab time to receive a refreshed token.
More than 60 color tokens, 25 gradients, and the spacing, radius, and shadow values are CSS custom properties. A visual change can usually happen at the token instead of across many components.
A native WebSocket manager uses a JWT query parameter, a 30-second heartbeat, retry delays from one to 30 seconds, and token replacement without disconnecting. Its 33 event types invalidate only the affected query keys.
結論Upfront structure reduced friction as features accumulated. The feature-module pattern made locations for types, queries, and stores predictable. APP_CONFIG kept shared URLs and storage keys discoverable, and the URL/Zustand/TanStack Query split gave each kind of state a single owner. Defining design tokens from Figma before building components also turned visual updates into CSS variable changes instead of repeated edits.
Make it hold together
Architecture, interface, production constraints. Together.