Skip to main content

Quick Start

Get the Pizza Chef Frontend application running on your local machine in just a few minutes.

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js v18 or higher
  • npm, yarn, or pnpm package manager

Installation and Setup

1

Clone the Repository

Clone the Pizza Chef Frontend repository to your local machine:
git clone <repository-url>
cd frontend-challenge
2

Install Dependencies

Install the required dependencies using your preferred package manager:
npm install
3

Start the Development Server

Launch the development server with Hot Module Replacement (HMR):
npm run dev
The application will start on http://localhost:5173 by default.
4

Open in Browser

Navigate to http://localhost:5173 in your web browser to see the Pizza Chef application.

What’s Next?

Now that you have the application running, you can:
  • Browse the Menu: Explore the pizza catalog with filtering and sorting options
  • Create Custom Pizzas: Use the pizza builder form to create your own pizzas
  • Place Orders: Add pizzas to your cart and complete orders
  • View Analytics: Check out the business intelligence dashboard for insights

Available Scripts

The project includes several npm scripts for development:
ScriptCommandDescription
devnpm run devStart development server with HMR
buildnpm run buildBuild for production with TypeScript compilation
previewnpm run previewPreview production build locally
testnpm run testRun tests with Vitest
test:uinpm run test:uiRun tests in interactive UI mode
lintnpm run lintLint code with ESLint

Running Tests

The project uses Vitest for testing. To run the test suite:
# Run all tests
npm run test

# Run tests with UI
npm run test:ui

Building for Production

To create an optimized production build:
npm run build
The build process will:
  1. Run TypeScript compilation (tsc -b)
  2. Bundle the application with Vite
  3. Output optimized assets to the dist/ directory
To preview the production build locally:
npm run preview

Troubleshooting

Port Already in Use

If port 5173 is already in use, Vite will automatically try the next available port. Check the terminal output for the actual port number.

Dependencies Installation Failed

Ensure you’re using Node.js v18 or higher:
node --version
If your Node.js version is outdated, update it and try installing dependencies again.

Build Errors

If you encounter TypeScript errors during build, ensure all dependencies are properly installed:
rm -rf node_modules package-lock.json
npm install