A Next.js e-commerce application built with React 19, TypeScript, and Tailwind CSS.
Run the development server with Turbopack:
npm run devOpen http://localhost:3000 in your browser to view the application.
Build and start the production server:
npm run build
npm start| Command | Description |
|---|---|
npm run dev |
Start development server with Turbopack |
npm run build |
Build production bundle |
npm start |
Start production server |
npm run lint |
Run ESLint to check for code issues |
npm run format |
Format all files with Prettier |
npm run format:check |
Check if files are formatted correctly |
This project uses ESLint and Prettier to maintain code quality and consistency. It's recommended to:
- Run
npm run lintbefore committing - Set up your editor to format on save
- Run
npm run formatto format all files
File-based Routing: Each folder in src/app/ becomes a URL route:
app/page.tsx→/(home page)app/shop/page.tsx→/shopapp/about/page.tsx→/about(add this folder to create the route)
Special Files:
layout.tsx- Shared UI that wraps pages (header, footer, etc.)page.tsx- Unique content for each route
Components Folder:
- Store reusable components in
app/components/ - Not part of routing (doesn't create routes)
- Import into your pages as needed
Example: To add a new "Products" page at /products:
- Create
app/products/page.tsx - Export a React component
- It's automatically accessible at
/products