Overview
The Pizza Chef Frontend is a modern React application built with TypeScript, Vite, and Redux Toolkit. This guide will walk you through setting up your development environment from scratch.Prerequisites
Before you begin, ensure you have the following installed on your system:- Node.js (v18 or higher)
- npm (comes with Node.js) or yarn
- A code editor (VS Code recommended)
- Git for version control
Installation
Install dependencies
Install all required npm packages using npm:This will install all dependencies listed in
package.json, including:Core Dependencies:react(^19.2.0) - React libraryreact-dom(^19.2.0) - React DOM rendering@reduxjs/toolkit(^2.11.2) - State managementreact-redux(^9.2.0) - React bindings for Reduxreact-router-dom(^7.13.1) - Client-side routing
tailwindcss(^4.2.1) - Utility-first CSS framework@tailwindcss/vite(^4.2.1) - Tailwind Vite integrationframer-motion(^12.35.0) - Animation librarylucide-react(^0.577.0) - Icon library
react-hook-form(^7.71.2) - Form state management@hookform/resolvers(^5.2.2) - Validation resolverszod(^4.3.6) - Schema validation
recharts(^3.7.0) - Charting libraryclsx(^2.1.1) - Conditional className utility
Start the development server
Launch the Vite development server with Hot Module Replacement (HMR):The application will be available at
http://localhost:5173 by default. The development server provides:- Fast HMR: Instant updates without full page reloads
- TypeScript checking: Real-time type error detection
- ESLint integration: Code quality checks
- React Fast Refresh: Preserves component state during updates
Development Scripts
The project includes several npm scripts for development workflows:npm run dev
Starts the Vite development server with HMR enabled. This is your primary command for day-to-day development.
npm run lint
Runs ESLint to check code quality and style issues:
eslint(^9.39.1)@eslint/js(^9.39.1)eslint-plugin-react-hooks(^7.0.1) - React Hooks ruleseslint-plugin-react-refresh(^0.4.24) - Fast Refresh compatibilitytypescript-eslint(^8.48.0) - TypeScript-specific rules
npm run preview
Serves the production build locally for testing:
Project Structure
Once installed, your project structure will look like this:Technology Stack
Build Tool: Vite
Vite provides lightning-fast development and optimized production builds:- Instant server start: No bundling during development
- Lightning-fast HMR: Updates reflect in milliseconds
- Optimized builds: Production builds use Rollup for optimal output
- TypeScript support: Native TypeScript compilation
Styling: Tailwind CSS 4.0
The project uses Tailwind CSS 4.0 with the Vite plugin:- Utility-first CSS approach
- Mobile-first responsive design
- Custom design tokens
- Automatic class purging in production
State Management: Redux Toolkit
Global state is managed with Redux Toolkit, providing:- Simplified Redux logic: Less boilerplate code
- Immutable updates: Using Immer under the hood
- DevTools integration: Time-travel debugging
- LocalStorage persistence: Order history and current cart
Data Persistence
The application uses localStorage for client-side persistence:pizza_current_order: Active shopping cartpizza_orders: Order history for analyticscustom_pizzas: User-created pizzaspizza_filters: Search and filter preferences
Next Steps
Now that your environment is set up:- Explore the codebase structure
- Run the test suite with
npm run test - Review the Testing Guide for writing tests
- Check the Build Process for deployment preparation
Troubleshooting
Port Already in Use
If port 5173 is already in use, Vite will automatically try the next available port. You can specify a custom port invite.config.ts.
Module Not Found Errors
If you encounter module resolution errors:- Delete
node_modulesandpackage-lock.json - Run
npm installagain - Restart your development server
TypeScript Errors
Ensure you’re using TypeScript ~5.9.3 as specified inpackage.json. Check your IDE’s TypeScript version matches the project version.