How vlad-rzaiev/goit-react-hw-08 works
Project type and purpose
• This is a single-page front-end application built with React and Vite.
• It provides user authentication (register/login), contact management (list, add, edit, delete), and search/filtering.
• It uses Redux for state management (auth, contacts, filters) and Thunks (“operations.js”) for async API calls.
File structure
• Top-level:
• public – static assets
• src – application code
• vite.config.js / package.json – build & dependency config
• vercel.json – deployment settings
• src/components – reusable UI pieces (forms, nav, lists, loaders, routes)
• src/pages – route targets (HomePage, LoginPage, RegisterPage, ContactsPage)
• src/redux – three slices (auth, contacts, filters) plus store.js
• src/main.jsx + index.html – SPA entry point
• CSS modules for scoped styling
• ESLint & Prettier configs for code quality
README
• Confirms React + Vite setup, HMR via plugin-react or plugin-react-swc.
• Suggests TypeScript/ESLint expansions for production (out of scope).
a. Main components
• Browser/Client
• React Component Tree (UI Layer)
• Router (React Router)
• State Management (Redux Store with authSlice, contactsSlice, filtersSlice)
• Async Layer (Redux Thunks invoking REST API)
• External REST API (Auth & Contacts endpoints)
• Build & Deployment (Vite Dev Server, Vite Bundler, Vercel)
b. Relationships & interactions
1. Browser loads index.html → main.jsx → renders App
2. App contains Routes → pages → nested components
3. UI dispatches Redux actions → reducers update state
4. Thunks (operations.js) call external API → on success dispatch further actions
5. UI subscribes to store (selectors.js) → re-renders with fresh data
6. Vite dev server bundles modules & serves via HMR; on build outputs static assets for Vercel
c. Architectural patterns & design principles
• Component-based UI (separation of concerns)
• Unidirectional data flow (Redux)
• Thunk middleware for side effects (API calls)
• CSS Modules for encapsulated styling
• Route guards (PrivateRoute, RestrictedRoute) for auth
d. Key technologies & frameworks
• React + React Router
• Redux Toolkit (createSlice, createAsyncThunk)
• Vite (bundler + dev server) + plugin-react
• CSS Modules
• ESLint / Prettier
• Vercel for deployment