How m-u-c-k-a/transcendance works
Project type and purpose
• This is a full-stack, multi-language web application built on Next.js (App Router).
• The “app” folder contains localized user-facing pages (auth, dashboard, game, profile, stats).
• The “server” folder implements a standalone Hapi (or similar) API service with JWT auth, Swagger docs, and Prisma ORM connectivity.
• Prisma manages a local SQLite database under prisma/data.
• A shared UI component library under “components/ui” and i18n assets under “lib/locales” support the frontend.
File structure
Top-level directories and their responsibilities:
• app/…: Next.js pages and layouts, organized per language placholder ([lang]). Uses server/client components (e.g. auth-client.tsx).
• components/: Reusable UI components and “components/ui” for primitives (buttons, dialogs, tables, etc.).
• hooks/: Custom React hooks (e.g. mobile detection).
• lib/: Shared utilities and i18n resources (dictionaries.ts, JSON locale files).
• prisma/: Database schema (schema.prisma), migrations, and test SQLite file.
• server/: Standalone API server code:
• config (environment variables)
• plugins (db.ts initializes Prisma, jwt.ts configures Hapi’s JWT plugin, swagger.ts sets up docs)
• routes/auth (login, registration endpoints)
• index.ts (bootstraps the server)
• middleware.ts: Next.js middleware (e.g. to detect locale, enforce auth).
• next.config.ts, postcss.config.mjs, eslint.config.mjs, tsconfig.json: build, lint, and framework configuration.
README for additional insights
• Confirms Create-Next-App bootstrap, use of next/font for optimized fonts.
• No built-in backend instructions, so the “server” folder runs as a separate process (e.g. node server/index.js).