π Built with Next.js, TypeScript, and Tailwind CSS for fast, responsive shopping experience
- Table of Contents
- Technologies
- Setup Instructions
- Usage
- Project Structure
- Development Workflow
- Next Steps / Future Improvements
Some of the technologies used in this project:
- βοΈ React β The main frontend library
- β² Next.js (App Router) β React framework with server components
- π¨ Tailwind CSS v4 β Utility-first CSS framework
- π· TypeScript β A typed superset of JavaScript
- π‘οΈ Zod β TypeScript-first schema validation with static type inference
- π» Zustand β Lightweight state management
- β¨ Motion β Animation library for smooth transitions
- π Lenis β Smooth scrolling library
- π― Sonner β Toast notifications
- π¨ Phosphor Icons β Beautiful icon library
Some additional development tools:
- π Biome β Code formatter and linter
- π€ Commitlint β Ensure well-formatted commit messages
- πΆ Husky β Git hooks
- π Lint Staged β Run scripts before committing
git clone https://github.com/up2dul/cake-commerce.git
# or if using ssh
git clone git@github.com:up2dul/cake-commerce.gitGo to the project directory and install dependencies
# Go to the project directory
cd cake-commerce
# Install dependencies
pnpm installCreate a .env.local file in the root directory and add the following variables:
API_BASE_URL=https://api-example.compnpm devOpen http://localhost:3000 with your browser to see the result.
pnpm build
pnpm start.
βββ src/
β βββ app/
β β βββ (main)/ # Main app routes
β β β βββ layout.tsx
β β β βββ page.tsx # Home page
β β β βββ account/ # Account page
β β β βββ shop/ # Shop page
β β β β βββ product/
β β β β βββ [slug]/ # Product detail page
β β β βββ _components/ # Shared components
β β βββ auth/ # Auth routes
β β β βββ login/
β β β β βββ _components/
β β β βββ register/
β β β βββ _components/
β β βββ actions/ # Server actions
β β β βββ auth.ts # Auth server actions
β β β βββ cart.ts # Cart server actions
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ not-found.tsx # 404 page
β βββ components/
β β βββ common/ # Common components
β β β βββ cart-drawer.tsx
β β β βββ cart-item-card.tsx
β β β βββ cart-line-edit.tsx
β β βββ layout/ # Layout components
β β β βββ navbar.tsx
β β β βββ footer.tsx
β β βββ ui/ # Reusable UI components
β β βββ button.tsx
β β βββ input.tsx
β β βββ label.tsx
β β βββ checkbox.tsx
β β βββ textarea.tsx
β β βββ field.tsx
β β βββ tag.tsx
β β βββ separator.tsx
β βββ hooks/ # Custom React hooks
β βββ lib/
β β βββ api.ts # API client with error handling
β β βββ auth.ts # Auth utilities
β β βββ config.ts # Configuration
β β βββ utils.ts # Utility functions
β β βββ data/ # Data fetching functions
β β β βββ product.ts # Product data fetching
β β β βββ customer.ts # Customer data fetching
β β β βββ cart.ts # Cart data fetching
β β βββ store/ # Zustand stores
β β β βββ cart.ts # Cart state management
β β βββ types/ # TypeScript types
β β βββ product.ts
β β βββ cart.ts
β β βββ auth.ts
β β βββ common.ts
β βββ assets/ # Static images and assets
β βββ proxy.ts # Proxy configuration
βββ public/ # Static files
βββ biome.json # Biome configuration
βββ commitlint.config.ts # Commitlint configuration
βββ next.config.ts # Next.js configuration
βββ tsconfig.json # TypeScript configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ postcss.config.mjs # PostCSS configuration
βββ pnpm-workspace.yaml # pnpm workspace config
βββ package.json
βββ README.md
The project uses Biome for automatic code formatting and linting:
# Format code
pnpm format
# Check code quality
pnpm lint
# Format and lint
pnpm checkHusky and lint-staged ensure code quality before commits:
- Pre-commit hook runs Biome formatting
- Commit messages are validated with commitlint
- Fix the edit cart line bug
- Checkout
