How stratezone/web works
Project type and purpose
• This is a full-stack Next.js (App Router) web application written in TypeScript.
• It serves a multilingual chess and community platform with features like authentication (NextAuth), booking/chess appointments, user profiles, communities, wallets, and notifications.
File structure
• Top-level:
• config.ts, constants/, messages/ (i18n resources), next.config.ts, postcss.config.mjs, tailwind.config.ts, tsconfig.json
• public/: static assets (images, logos)
• .github/workflows/: CI/CD pipelines for preview/production
• src/
• src/app/[locale]/…: the Next.js App Router layout and pages organized per locale, including nested routes for account, auth API, chess appointments, community, wallet, etc.
• src/app/products, src/app/store.ts: global app config and data stores
• src/State/Auth: Redux actions, reducers, root reducer for global client-side state
• src/components/: reusable UI pieces (navbar, sidebar, dialogs, cards, etc.)
• src/utils, src/i18n, src/auth.ts, middleware.ts: helper functions, session management, localization routing, middleware
• Configuration: ESLint, GitHub Actions, PostCSS, Tailwind, NextAuth type declarations
README for additional insights
• Bootstrapped with create-next-app
• Uses next/font for font optimization
• Standard Next.js dev and deploy instructions
a. Main components
• Client (browser)
• Next.js Frontend (React + App Router + Tailwind)
• Next.js Backend / API Routes (Route Handlers under app/[locale]/api)
• Authentication service (NextAuth + external OAuth or credentials provider)
• Redux store (client-side state)
• Database (e.g., MongoDB/Postgres—configure in NextAuth and API services)
• External services: Payment gateways (walletService, paymentService), Email/SMS for OTP/notifications
• i18n subsystem (messages/en.json, vi.json, routing.ts)
• CDN / Static asset host (public/)
b. Relationships & interactions
• Browser ↔ Next.js Frontend via SSR/CSR and API calls
• Frontend dispatches Redux actions, renders components
• Frontend calls route handlers for auth, booking, community, wallet
• API handlers interact with DB and external services (payment gateways, email/SMS)
• NextAuth middleware and route handlers manage session cookies, tokens
• Middleware.ts enforces locale and auth on protected routes
c. Architectural patterns & design principles
• App Router pattern: file-system routing with nested layouts per locale
• Separation of concerns:
• UI (components/)
• State management (Redux under src/State)
• Business logic & API (app/[locale]/api, walletService, etc.)
• Presentation (Tailwind + PostCSS)
• i18n pattern: dynamic routing by locale segment, message lookup
• CI/CD: GitHub Actions for preview vs production
d. Key technologies/frameworks
• Next.js (React, App Router)
• TypeScript
• Redux (plain or Redux Toolkit)
• NextAuth for authentication
• Tailwind CSS + PostCSS
• GitHub Actions
• Node.js environment
Detail is critical—capture
• Route hierarchy under app/[locale]
• Where Redux lives vs NextAuth vs API routes
• All external dependencies (i18n files, public assets, GitHub Actions)
• Communication paths (SSR requests, client fetch, middleware enforcement)