This is a Next.js project bootstrapped with create-next-app
.
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
- 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
yarn install
yarn dev
Open http://localhost:3000 Important keep this port
- 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-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
- Home - Menu - Navbar
- Product Details
- Shopping Cart
- Order confirmation
- Signin
- footer
I added some test e2e, you'll see the commands in package.json
"test":"npx playwright test",
"test:interactive":"playwright test --ui"
NEXT_PUBLIC_BASE_PATH:http://localhost:3000