How michniks2001/baby-app works
Project type and purpose
• This is a full-stack web application built with Next.js (v13 App Router).
File structure
• Top-level “app” folder: defines routes via Next.js App Router.
• /app/page.js → Home page
• /app/game/page.js → Animal‐sound game
• “components” folder: reusable UI pieces (TextToSpeech, Button, Textarea).
• “lib” folder: utilities (utils.js/ts).
• “public” folder: static assets (animal_images, animal_sounds, shape_images).
• Configs: next.config.mjs, postcss.config.mjs, eslint.config.mjs.
• package.json, jsconfig.json, components.json: dependency & type settings.
README for additional insights
• Standard create-next-app boilerplate.
• No custom API routes; relies on static assets and client/server components.
• Uses next/font for font optimization.
a. Main components
• Client Browser (React in the browser)
• Next.js Server (Node.js runtime)
• File-based Router (App Router in “app/”)
• UI Components (in “components/”)
• Utility Layer (in “lib/”)
• Static Asset Store (images & sounds in “public/”)
b. Relationships & interactions
2. Next.js server resolves route via App Router, renders React Server/Client Components.
3. Components fetch static assets (images, sounds) directly from “public/”.
4. Client Components use TextToSpeech component which calls Web Speech API in browser.
5. Utils module provides shared logic (e.g., randomization, scoring).
c. Architectural patterns & design principles
• File-based routing (App Router)
• Component-based UI (React Server + Client components)
• Separation of concerns: Routes vs. Components vs. Utils vs. Static assets
• Progressive enhancement: Server-rendered pages with client interactivity
d. Key technologies & frameworks
• Next.js (App Router)
• React (Server and Client Components)
• Web Speech API (TextToSpeech)
• Node.js (server runtime)
• PostCSS, ESLint, TypeScript (optional)