Skip to content

A restaurant website created using React, CSS, NodeJS, Express, PostgreSQL, Prisma, Stripe, and Auth0.

Notifications You must be signed in to change notification settings

LeslieLopez25/perfect-mix-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

435 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Perfect Mix 🌮

## Project Summary

The Perfect Mix is a full-stack restaurant web app that allows users to browse menu items by category, view a gallery of dishes, add items to a cart, and securely checkout using Stripe. Auth0 powers user authentication, enabling a personalized and persistent cart experience. The backend is built with Express and Prisma, connected to a PostgreSQL database, while the frontend is styled with custom CSS and deployed via Render.

Key Features

- Mobile Responsiveness: Enjoy a seamless experience on any device, whether it's a smartphone, tablet, or desktop.

  • Custom Button: Experience our restaurant like never before with a thoughtfully designed custom button that adds a touch of elegance to your navigation.

  • Diverse Menu Pages: Discover the plethora of culinary treasures our restaurant boasts with dedicated pages for each category of food, making your choices easier and more enjoyable.

  • Captivating Gallery: Immerse yourself in the visual feast of our mouthwatering dishes through our gallery section. Get a glimpse of the culinary artistry that awaits you.

  • Playwright E2E Tests: Automated end-to-end tests covering login, cart, checkout, and receipt flow to ensure reliability.

  • Middleware: Custom backend middleware for request validation, authentication, and error handling.

  • Use this link to use Stripe test cards, for placing your order, from different countries.

Changelog Summary

This project is actively maintained. For a full history of updates, check the CHANGELOG.md.

Latest Updates:

  • Refactored backend routes and added comments for clarity (May 2025).

  • Integrated Cloudinary image upload functionality (May 2025).

  • Added Auth0 authentication and Stripe checkout system (Nov 2024).

  • Added Playwright end-to-end testing suite for checkout and authentication flows (September 2025).

  • Introduced middleware for authentication and error handling (September 2025).

  • Full-Stack Setup: Converted the project into a full-stack application with separate frontend and backend components.

  • Backend and Database:

    • Hosted backend setup to manage data, Auth0 authentication, and Stripe payment processing.

    • Integrated PostgreSQL database with Prisma as the ORM for efficient database interaction.

    • Migrated product and gallery images to the database, seeding them through Prisma to replace hardcoded data.

    • Node.js: Powers the backend runtime environment, allowing JavaScript to run server-side for handling server operations and managing asynchronous requests efficiently.

    • Express: Provides the core web framework for routing and middleware management, serving dynamic API routes (e.g., item retrieval, cart management, payments) and static files like gallery images.

    • dotenv: Manages environment variables securely by loading sensitive data (e.g., Stripe secret key) from a .env file, keeping it out of the codebase for security.

    • CORS (Cross-Origin Resource Sharing): Enables secure cross-origin requests between the separately hosted frontend and backend, allowing them to communicate without security issues.

    • REST API: Defines structured endpoints (e.g., /api/items, /api/cart, /create-payment-intent) that enable data exchange with the frontend, following REST principles for handling user interactions and payment processing.

  • Dynamic Content Fetching: Product and gallery data are now fetched directly from the database, making updates and scalability easier.

  • Payment Processing: Implemented Stripe for secure payment processing, configured in both frontend and backend for seamless transactions.

  • Receipt Modal: Upon successful payment, a receipt modal displays the user's name, list of items, and total amount paid, enhancing the checkout experience.

  • Cart Management: Cart items persist across login sessions, allowing users to resume shopping without losing their selections.

  • Frontend: Hosted on Render, making the user-facing interface accessible to the public and ensuring smooth interactions with the backend services.

  • Backend: Also hosted on Render, allowing it to handle API requests, process payments, and manage authentication and cart functionalities, all accessible to the frontend.

  • Database: Hosted on Neon, a cloud PostgreSQL database provider, which stores all product data, gallery images, and user cart information, ensuring secure and scalable data management for the app.

Link

Screenshots


🧪 Running Playwright Tests

This project includes automated end-to-end (E2E) tests using Playwright.

Setup

  1. Ensure both frontend and backend servers are not running — Playwright will start them automatically.
  2. Install Playwright dependencies (only needed once):
    npx playwright install

This project uses an authentication setup file (auth.setup.js) to log in with Auth0 once and save the session state.

The stored authentication state is written to tests/auth.json.

All other Playwright tests reuse this stored state, so they run as if the user is already logged in.

If you need to reset authentication (e.g., you changed test credentials), simply delete tests/auth.json and rerun:

npx playwright test tests/auth.setup.js


Getting Started with Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can't go back!

If you aren't satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

About

A restaurant website created using React, CSS, NodeJS, Express, PostgreSQL, Prisma, Stripe, and Auth0.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published