Giter VIP home page Giter VIP logo

project_mac_orders's Introduction

This is a Next.js project bootstrapped with create-next-app.

Getting Started MacDonald's Take Home

This project is building using app route of NextJS 13, also I got the knowledge to handle the routes with pages and server side props. Thanks

Features

  • Menu Products
  • Page Details of each product with Dinamyc Route
  • Add Product (1 or more products)
  • Remove Product
  • Pay Order - Confirmation View
  • Button New Order to clean Store or State Management
  • UseReducer to Shopping Cart
  • Signin Context and NavBar with username (It's open to any user in order you can see the functionality)
  • Testing e2e of views with Playwright
  • Components
  • Settings in next.config.js
  • Structure of commits
  • TS interfaces and comments on each component
  • Tailwind CSS styles and a little responsive

Run the project

yarn install
yarn dev

.env with Port 3000

Open http://localhost:3000 Important keep this port

Tech Details

  • TypeScript: Use interfaces and types
  • NextJS
  • useReducer - State Management Cart
  • createContext - to handle in the full app the data
  • Jest and RTL - Unit Test

Project Structure

project-root/
│
├── README.md
├── src/
│ ├── app
│ ├─── api
│ │ ├── products
│ └─── cart - Cart view with all producs
│ └─── confirmation - Confirmation once the payment is acepted View
│ └─── details/[slug]  - Product Details View (Dynamic Route)
│ └─── auth/signin - Signin you can use any user, it's a demo
│ └─── page.tsx  - Home View
├── components
│ └── BackButton.tsx
│ └── BuyProduct.tsx 
│ └── Card.tsx
│ └── DetailsProduct.tsx
│ └── Footer.tsx
│ └── NavBar.tsx
├── middleware  - Call from client-side to server-side
├── test - Unit test
├── utils
│ └─── context - Handle Cart data in the entire app
│ └─── store  - useReducer to handle the state
│ └─── interfaces  - Organize all the interfaces and types
└── LICENSE

You'll see the following Views

  • Home - Menu - Navbar

Alt text

  • Product Details

Alt text

  • Shopping Cart

Alt text

  • Order confirmation

Alt text

  • Signin

Alt text

  • footer

Alt text

Testing

I added some test e2e, you'll see the commands in package.json

    "test":"npx playwright test",
    "test:interactive":"playwright test --ui"

Alt text

ENV VARS

NEXT_PUBLIC_BASE_PATH:http://localhost:3000

project_mac_orders's People

Contributors

ecarinagr5 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.