How amineelouadi/wordwise-dictionary works
Project type and purpose
• This is a full-stack web application (“WordWise”) consisting of a React+TypeScript frontend and an Express.js backend.
• Purpose: Provide dictionary lookups by querying the Free Dictionary API, track search history in memory, and enable theme toggling.
File structure
• Top-level directories:
• client/ – React app (components, pages, hooks, UI library wrappers)
• server/ – Express server (entry point, API routes, in-memory storage)
• shared/ – Common schema definitions for request/response validation
• Configuration files: tsconfig.json, tailwind.config.ts, drizzle.config.ts, vite.config.ts, postcss.config.js
• Build & dev scripts: package.json, vite integration in server/vite.ts
README for additional insights
• Confirms tech stack: React + TailwindCSS + shadcn/ui, Express/Node, React Query
• Describes features: word search, detailed info display, audio pronunciation, search history, dark/light theme
• No external database – uses in-memory storage on the server
a. Main components:
• User’s Web Browser (client) running the React app
• Static Asset Server / Vite Dev Server (serves HTML/CSS/JS)
• React Application Layers:
– UI Components (shadcn/ui, TailwindCSS)
– State Management (React Query via queryClient.ts)
• Backend Express Server (API routes)
• In-Memory Storage Module (server/storage.ts)
• Shared Schema Layer (shared/schema.ts) for type safety & validation
• External Free Dictionary API (https://api.dictionaryapi.dev/)
b. Relationships & data flow:
1. Browser → (HTTP GET) → Static Asset Server → serves index.html & bundle.js
2. React App → (REST/Fetch via React Query) → Express API endpoint (/lookup/:word)
3. Express Route Handler → (calls) → In-Memory Storage to log/retrieve search history
4. Express Route Handler → (HTTP request) → External Dictionary API → receives word data
5. Express → (JSON response) → React Query → UI renders results (meanings, phonetics, audio)
c. Architectural patterns & design principles:
• Layered architecture: separation of presentation (UI), application logic (React Query + Express routes), and data (in-memory storage + external API).
• DRY & reusability: UI primitives (client/src/components/ui) abstract common design patterns.
• Configuration-driven build: Vite handles dev vs. production, integrated into the Express server.
d. Key technologies & libraries:
• Frontend: React, TypeScript, TailwindCSS, shadcn/ui, React Query
• Backend: Node.js, Express.js, Vite (dev), in-memory storage
• Shared: Zod or a similar schema library (in shared/schema.ts) for validation
• Tooling: Drizzle (drizzle.config.ts) if/when migrating to a persistence layer