How tanphat0226/trello-web works
Project type and purpose
• This is the front-end of a Trello-style Kanban application built with React, Redux Toolkit, and Vite. It serves as the UI layer in a MERN-style course, handling board rendering, card management, authentication flows, and real-time updates via WebSockets.
File structure
• Top-level:
• index.html – single page host
• vite.config.js – build/dev server config
• src/:
• main.jsx – React entrypoint, bootstraps App component inside Redux Provider & theme provider
• App.jsx – root component, defines routes (Auth, Boards, Settings, Users, 404)
• /apis – HTTP client (authorizeAxios) and mock-data stub
• /socketClient.js – WebSocket (socket.io-client) setup for real-time events
• /redux – Redux Toolkit slices (user, activeBoard, activeCard, notifications) and store.js
• /components + /pages – presentational & container components organized by feature (AppBar, Modals, Forms, Boards, etc.)
• /customHooks, /customLibs, /utils, theme.js – cross-cutting utilities, DnD kit sensors, formatters, validators, theme config
README for additional insights
• Confirms project is the React front-end for a Trello clone, part of a MERN Stack course using React 18, Vite, Redux, SWC plugin, ESLint, etc.
• Browser/Client (loads index.html, serves React SPA)
• React App
– Entry (main.jsx)
– Router layer (Auth, Boards, Settings, Users, 404)
– UI Components (AppBar, Forms, Modals, Boards/Columns/Cards)
• State Management
– Redux Store
– Slices: user, activeBoard, activeCard, notifications
• Service Layer
– HTTP API module (axios wrapper)
– WebSocket Client (socketClient.js)
• Static Assets & Build
– Vite Dev/Build pipeline
• External Services (outside repo)
– Backend REST API
– WebSocket / socket.io server
– Database
• Browser → React App (initial page load)
• React App ↔ Redux Store (dispatch actions, subscribe to state)
• React App → API Layer (REST calls via authorizeAxios) → Backend API → Redux Store (via dispatched thunks)
• React App ↔ WebSocket Client → socket.io server → Redux Store (real-time events)
• Components consume state and render UI; user events dispatch Redux actions
c. Architectural patterns & design principles:
• Single-Page Application (SPA) with client-side routing
• Container–Presentational separation: pages vs UI components
• Redux Toolkit for predictable global state
• Service layer abstraction for HTTP and WebSocket
• Custom hooks for cross-cutting concerns (debounce, focus)
• Utility modules for formatting, validation, constants
d. Key technologies & frameworks:
• React 18, JSX
• Vite + SWC plugin
• Redux Toolkit, React-Redux
• Axios (authorizeAxios wrapper)
• socket.io-client
• DnD Kit (custom DndKitSensors)
• ESLint, Prettier, jsconfig.json
Essential architectural elements
• Do not over-compartmentalize; illustrate logical groupings: UI, state, services.
• How actions in the UI propagate through Redux to services and back.
• Real-time WebSocket channel alongside REST calls.