Site Url:
Project Overview: PizzaPerk Food Delivery Site
Project Name: PizzaPerk
Tech Stack:
- Frontend: Next.js (using SSR, parallel routes, intercepted routes), Redux for state management, TypeScript for type safety and error-free code.
- Backend: Supabase for database management and backend services.
- Testing:
- end-to-end and component testing(cypress)
- unit testing(jest and react testing library)
Features and Functionality
1. Server-Side Rendering (SSR)
- Objective: Improve SEO and provide a faster initial load.
- Implementation: Key pages, such as the homepage, menu, and order details, are rendered on the server. This allows the site to deliver content-rich pages quickly and enhance the user experience.
2. Parallel Routes
- Objective: Improve load times and enhance user experience by loading multiple routes simultaneously.
- Implementation: Used Next.js’s ability to load components in parallel, particularly for complex pages like the menu with multiple categories etc.
3. Intercepted Routes
- Objective: Provide a smoother navigation experience by intercepting routes and handling them appropriately without a full page reload.
- Implementation: This feature is particularly useful for modals and sidebars. For example, clicking on a pizza item opens a modal with the item details without navigating away from the current page.
4. Redux for State Management
- Objective: Maintain a predictable state across the application.
- Implementation: Used Redux to manage the application state, particularly for user authentication, cart management, order tracking, and user preferences. Actions and reducers are defined to handle the state transitions in a predictable manner.
5. Supabase Backend
- Objective: Provide a robust backend service with real-time capabilities.
- Implementation: Supabase is used for database management, user authentication, and real-time data synchronization. It provides an API that the frontend interacts with to perform CRUD operations, manage user sessions, and handle real-time updates (e.g., order status changes).
6. TypeScript
- Objective: Ensure type safety and reduce runtime errors by catching issues at compile time.
- Implementation: TypeScript is used extensively throughout the project to define types for components, props, state, and API responses. This practice helps in maintaining clean, readable, and error-free code.
Key Pages and Components
Homepage
- Features: Display featured pizzas and special deals.
- SSR Implementation: Pre-render the page on the server to deliver content quickly.
Menu Page
- Features: Display categories of pizzas.
- Parallel Routes: Load multiple categories and filters simultaneously to enhance performance.
Pizza Detail Modal
- Features: Show detailed information about a pizza item, including price, and customization options.
- Intercepted Routes: Open as a modal from the menu page without a full page reload.
Cart
Cart Logic: Users can access their cart from any screen, with real-time updates reflecting item additions and modifications. Interactive modals guide users through selecting pizza sizes, drink options, and customizing their orders, ensuring a smooth and efficient ordering process.
Implemented a dynamic cart system where the total adjusts effectively when items are added or removed.
- Price tags automatically update based on pizza sizes, ensuring accurate pricing.
- Developed a logic to distinguish between drinks (no size update) and pizzas (size update required), ensuring clear categorization.
User Profile
- Features: Display user information, order history, and settings.
- Parallel Routes: Load different sections (orders, settings) in parallel for a smoother experience.
Project Structure
Frontend Directory:
- /pages: Contains all the page components, leveraging Next.js’s file-based routing.
- /components: Reusable UI components like buttons, modals, and forms.
- /store: Redux store configuration, actions, and reducers.
- /utils: Utility functions and hooks.
- /types: TypeScript type definitions.
Backend Directory:
- /supabase: Configuration and API integration with Supabase.
- /services: Backend services and functions interacting with Supabase.
Summary
PizzaPerk leverages the power of Next.js for an optimized user experience through server-side rendering, parallel and intercepted routes, and robust state management with Redux. The use of TypeScript ensures type safety and reduces errors during development. Supabase provides a powerful backend solution, enabling real-time updates and efficient data management. This combination of technologies ensures PizzaPerk is fast, reliable, and user-friendly.
The following react depencies were used in this project:
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.2",
"@clerk/nextjs": "^5.2.6",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@reduxjs/toolkit": "^2.2.6",
"@stripe/react-stripe-js": "^2.7.3",
"@stripe/stripe-js": "^4.1.0",
"@supabase/auth-helpers-nextjs": "^0.10.0",
"@supabase/ssr": "^0.4.0",
"@supabase/supabase-js": "^2.44.4",
"@tanstack/react-query": "^5.51.15",
"aos": "^2.3.4",
"axios": "^1.7.2",
"clsx": "^2.1.1",
"firebase": "^10.12.4",
"framer-motion": "^11.3.18",
"install": "^0.13.0",
"loadash": "^1.0.0",
"lodash": "^4.17.21",
"lorem-ipsum": "^2.0.8",
"next": "14.2.5",
"npm": "^10.8.2",
"react": "^18",
"react-countdown": "^2.3.5",
"react-dom": "^18",
"react-error-boundary": "^4.0.13",
"react-hot-toast": "^2.4.1",
"react-icons": "^5.2.1",
"react-merge-refs": "^2.1.1",
"react-redux": "^9.1.2",
"react-slick": "^0.30.2",
"slick-carousel": "^1.8.1",
"svix": "^1.25.0"
Launching the PizzaPerk Food Delivery Site
My PizzaPerk food delivery site, built with Next.js, is designed to offer an optimized, seamless user experience. Here’s how it launches:
Server-Side Rendering (SSR): We use SSR to pre-render the homepage, ensuring fast load times and improved SEO. This means that key content is ready to go as soon as the user lands on the site.
React Suspense for Loading States: To handle data fetching gracefully, we leverage React’s Suspense. This allows us to show a loading indicator while waiting for data to be loaded, providing users with immediate feedback that the content is being retrieved.
Chakra UI Spinner: The loading indicator is implemented using Chakra UI’s Spinner component. When the homepage is fetching data, the Chakra Spinner is displayed, centered on the screen, ensuring a visually appealing and consistent user experience.
This combination of Next.js for SSR, React Suspense, and Chakra UI for loading states ensures that PizzaPerk delivers a fast, responsive, and user-friendly experience from the moment users visit our site.
watch video
Product Detail Modal Implementation in PizaPerk Food Delivery App
Project: PizaPerk Food Delivery App
Technology Stack: Next.js, Redux
Description:
In the PizaPerk food delivery app, I implemented a versatile product detail modal that can be accessed from any page within the application. The modal dynamically determines whether the selected item is a pizza or a drink and displays the appropriate components accordingly. Here’s a detailed breakdown of the implementation:
Dynamic Display Based on Item Type:
- The modal automatically detects the type of item being viewed. If the item is a pizza, the modal displays a size selection component. For drinks, this component is omitted.
Global Access:
- The product detail modal is designed to be accessible from any page in the app. This ensures a seamless user experience, allowing users to view product details and make selections without navigating away from their current page.
Implementation Using Next.js and Redux:
- Next.js: Utilized Next.js for server-side rendering and efficient routing.
- Redux: Managed the state of the modal using Redux to ensure consistent behavior across the application.
Key Features:
Parallel and Intercepted Routing:
- Implemented parallel routing to allow the modal to open over any current route, without disrupting the user’s navigation flow.
- Intercepted routing ensures that when the modal is closed, the user returns to their previous state seamlessly.
Component Structure:
- Created a reusable
ProductDetailModalcomponent. - The component checks the item type and conditionally renders the
SizeSelectioncomponent if the item is a pizza.
- Created a reusable
Code Snippet:
| |
State Management:
| |
This implementation not only enhances the user experience by providing dynamic content but also maintains the state and navigational context, ensuring a smooth and intuitive interaction for users.

