Skip to content

b-l-i-n-d/ecommerce-store

Repository files navigation

E-Commerce Admin

GitHub code size in bytes GitHub last commit GitHub commit activity month GitHub license

πŸ“ About β€’ ✨ Features β€’ πŸ’» Technologies β€’ πŸ“ Project structure β€’ βš™οΈ Environment variables β€’ πŸš€ How to run β€’ πŸ“„ License

πŸ“ About

E-Commerce store is the fornend part of this project. You can find it here. I have created this project to learn more about next js app router. I have use nextjs as fullstack framework, tailwind css as css framework, zustand as state management, shadcn/ui as ui components, axios for mutations. I know that there are many things that I can improve in this project, I will try to improve it in the future. Feel free to contribute to this project. I will be very happy if you give this project a star ⭐.

✨ Features

  • Persisted cart
  • Product overview modal
  • Search products with filters
  • Add/remove products from cart
  • Checkout with Stripe
  • Responsive design
  • Increment/decrement product quantity from cart

πŸ’» Technologies

πŸ“ Project structure

β”œβ”€β”€ .eslintrc.json
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
β”œβ”€β”€ actions
β”‚   β”œβ”€β”€ get-billboard.ts
β”‚   β”œβ”€β”€ get-billboards.ts
β”‚   β”œβ”€β”€ get-categories.ts
β”‚   β”œβ”€β”€ get-category.ts
β”‚   β”œβ”€β”€ get-colors.ts
β”‚   β”œβ”€β”€ get-product.ts
β”‚   β”œβ”€β”€ get-products.ts
β”‚   └── get-sizes.ts
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ (routes)
β”‚   β”‚   β”œβ”€β”€ cart
β”‚   β”‚   β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ cart-item.tsx
β”‚   β”‚   β”‚   β”‚   └── summary.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ error.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ loading.tsx
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”œβ”€β”€ category
β”‚   β”‚   β”‚   β”œβ”€β”€ [categoryId]
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ filter.tsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── mobile-filter.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ error.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ loading.tsx
β”‚   β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ error.tsx
β”‚   β”‚   β”‚   └── loading.tsx
β”‚   β”‚   β”œβ”€β”€ error.tsx
β”‚   β”‚   β”œβ”€β”€ loading.tsx
β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   └── products
β”‚   β”‚       β”œβ”€β”€ [productId]
β”‚   β”‚       β”‚   β”œβ”€β”€ error.tsx
β”‚   β”‚       β”‚   β”œβ”€β”€ loading.tsx
β”‚   β”‚       β”‚   └── page.tsx
β”‚   β”‚       β”œβ”€β”€ error.tsx
β”‚   β”‚       └── loading.tsx
β”‚   β”œβ”€β”€ error.tsx
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ globals.css
β”‚   β”œβ”€β”€ layout.tsx
β”‚   └── loading.tsx
β”œβ”€β”€ components.json
β”œβ”€β”€ components
β”‚   β”œβ”€β”€ billboard-swiper.tsx
β”‚   β”œβ”€β”€ footer.tsx
β”‚   β”œβ”€β”€ gallery
β”‚   β”‚   β”œβ”€β”€ gallery-tab.tsx
β”‚   β”‚   └── index.tsx
β”‚   β”œβ”€β”€ info.tsx
β”‚   β”œβ”€β”€ main-nav.tsx
β”‚   β”œβ”€β”€ navbar-actions.tsx
β”‚   β”œβ”€β”€ navbar.tsx
β”‚   β”œβ”€β”€ preview-modal.tsx
β”‚   β”œβ”€β”€ product-list.tsx
β”‚   └── ui
β”‚       β”œβ”€β”€ billboard.tsx
β”‚       β”œβ”€β”€ button.tsx
β”‚       β”œβ”€β”€ card.tsx
β”‚       β”œβ”€β”€ container.tsx
β”‚       β”œβ”€β”€ currency.tsx
β”‚       β”œβ”€β”€ dialog.tsx
β”‚       β”œβ”€β”€ heading.tsx
β”‚       β”œβ”€β”€ label.tsx
β”‚       β”œβ”€β”€ loader.tsx
β”‚       β”œβ”€β”€ no-results.tsx
β”‚       β”œβ”€β”€ product-card.tsx
β”‚       β”œβ”€β”€ radio-group.tsx
β”‚       β”œβ”€β”€ separator.tsx
β”‚       β”œβ”€β”€ sheet.tsx
β”‚       └── tabs.tsx
β”œβ”€β”€ hooks
β”‚   β”œβ”€β”€ use-cart.ts
β”‚   └── use-preview-modal.ts
β”œβ”€β”€ lib
β”‚   └── utils.ts
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ providers
β”‚   β”œβ”€β”€ modal-providers.tsx
β”‚   └── nprogress-provider.tsx
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ next.svg
β”‚   └── vercel.svg
β”œβ”€β”€ tailwind.config.ts
β”œβ”€β”€ tsconfig.json
└── types.ts

πŸ“ Project Summary

  • actions: Contains Redux action creators and related logic.
  • app: Main application directory.
  • app/routes: Contains route configurations for different pages.
  • app/routes/cart: Handles cart-related functionality.
  • app/routes/category: Manages category-related functionality.
  • app/routes/category/categoryId: Handles category-specific functionality.
  • app/routes/products: Handles products-related functionality.
  • app/routes/products/productId: Manages product-specific functionality.
  • components: Contains reusable UI components.
  • lib: Houses utility functions and helper classes.

βš™οΈ Environment variables

Create a .env.local file in the root directory and add the following variables:

NEXT_PUBLIC_API_URL=<COPY_STORE_API_URL_FROM_ADMIN_PANEL>

πŸš€ How to run

  1. Clone this repository
git clone https://github.com/b-l-i-n-d/ecommerce-store.git
  1. Install dependencies
npm install
  1. Run the development server
npm run dev
  1. Open http://localhost:3000 with your browser to see the result.

Screenshots

Home page

Home page

Category page

Category page

Product page

Product page

Product overview modal

Product overview modal

Cart page

Cart page

Payment page

Payment page

πŸ“„ License

MIT