Frontend overview
The frontend is a React application bootstrapped with Create React App (CRA), using React 19.2.0 and modern React patterns including hooks and functional components.Project structure
The React application is located in theclient/ directory:
Dependencies
The frontend uses the following key dependencies fromclient/package.json:
Core libraries
- react - Core React library for building user interfaces
- react-dom - DOM-specific methods for React
- react-scripts - Build and development scripts from Create React App
- web-vitals - Performance monitoring utilities
Testing libraries
Application entry point
The application initializes inclient/src/index.js:
- Creates a React root using the modern
createRootAPI (React 18+) - Renders the App component inside
React.StrictModefor additional development checks - Initializes web vitals for performance monitoring
Main application component
TheApp.js component is the main entry point for the UI:
- Functional component using modern React syntax
- Imports and displays the React logo
- Provides a basic template for starting development
- Includes proper accessibility attributes (
alt,rel)
This is the default Create React App template. In a real application, you would replace this with your own components and routing logic.
Build process
The frontend build process is defined in thepackage.json scripts:
Available scripts
npm start
npm start
Runs the app in development mode with hot reloading on
http://localhost:3000npm run build
npm run build
Creates an optimized production build in the
build/ directory with:- Minified JavaScript and CSS
- Bundled and tree-shaken code
- Optimized asset hashing for cache busting
npm test
npm test
Launches the test runner in interactive watch mode
npm run eject
npm run eject
Ejects from Create React App (one-way operation) to customize build configuration
Production build in Docker
During the Docker build process, the frontend is compiled in the first stage:- Installs all dependencies including build tools
- Runs
npm run buildto create production-optimized files - Outputs static files to
client/build/
Serving in production
In the production container, the built frontend is served by the Express backend:server/client/build/, where the Express server can serve them alongside API endpoints.
Browser support
The application targets modern browsers based on thebrowserslist configuration:
Production:
Key features
Modern React
Uses React 19.2.0 with hooks and functional components
Built-in testing
Includes React Testing Library for component testing
Performance monitoring
Web Vitals integration for measuring user experience
Optimized builds
Create React App provides zero-config optimization
Next steps
Backend architecture
Learn how the Express backend serves the application