A full-stack e-commerce application built with Next.js App Router, TypeScript, and Tailwind CSS.
This project follows modern Next.js 14+ best practices for structuring a large-scale application:
my-nextjs-project/
│
├── src/ # Source files
│ ├── app/ # Next.js App Router
│ │ ├── (auth)/ # Auth route group
│ │ ├── products/ # Products routes
│ │ │ ├── [id]/ # Dynamic product routes
│ │ ├── api/ # API routes
│ │ ├── layout.tsx # Root layout
│ │ ├── page.tsx # Home page
│ │
│ ├── components/ # UI Components
│ │ ├── ui/ # Generic UI components
│ │ │ ├── buttons/ # Button components
│ │ │ ├── cards/ # Card components
│ │ │ ├── inputs/ # Input components
│ │ │ ├── modals/ # Modal components
│ │ ├── forms/ # Form components
│ │ ├── layouts/ # Layout components
│ │ ├── common/ # Common components
│ │
│ ├── config/ # Configuration
│ │ ├── constants/ # App constants
│ │
│ ├── lib/ # Library code
│ │ ├── utils/ # Utility functions
│ │ ├── hooks/ # Custom hooks
│ │ ├── transitions/ # Transition animations
│ │
│ ├── contexts/ # React context providers
│ ├── hooks/ # Application hooks
│ ├── services/ # External services
│ ├── store/ # State management
│ ├── styles/ # Global styles
│ ├── types/ # TypeScript types
│
├── public/ # Static files
├── next.config.mjs # Next.js configuration
├── tsconfig.json # TypeScript configuration
├── tailwind.config.ts # Tailwind CSS configuration
This structure follows best practices for large-scale Next.js applications with the App Router, ensuring:
The components follow atomic design principles:
# Install dependencies
npm install
# Run the development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run tests
npm test
Generate new components following atomic design principles:
# Usage: npm run gen:component <component-type> <component-name>
npm run gen:component atoms Button
npm run gen:component molecules FormGroup
npm run gen:component organisms ProductCard
npm run gen:component templates AccountLayout
git checkout -b feature/my-feature
git commit -m 'Add some feature'
rigin feature/my-feature