Folder Structure
An organized folder system makes it easier to find what you need. The directory
bonik/
contains the folder hierarchy.
-
public/
: Contains static assets like images (JPG, PNG), vector graphics (SVG), documents (PDF), and other media files. These files are served directly from the root URL path. -
src/__server__/
: Contains mock server API endpoints using axios-mock-adapter (opens in a new tab) for development and testing. This folder simulates backend API responses without requiring a real server. -
src/app/
: Contains all page folders using Next.js 15 App Router architecture. The project includes over 55 pages with their corresponding components, layouts, and route handlers. Each page follows Next.js file-based routing conventions. Learn more about Next.js routing in their official documentation (opens in a new tab). -
src/components/
: Contains reusable UI components like buttons, cards, dialogs, forms, and other shared elements that are used across multiple pages. These components follow a modular architecture to maintain consistency and reduce code duplication. -
src/contexts/
: Contains global context provider for state management:CartContext:
Manages shopping cart state, including add/remove/update items and cart calculations
-
src/data/
: Contains shared data files such as:- Country lists and information
- Navigation menu structures
- Navbar navigation configurations
- Other reusable data constants
-
src/hooks/
: Contains reusable custom React hooks for shared functionality across components. Examples include:useWindowSize
: Track viewport dimensionsuseScroll
: Monitor page scroll position- And other utility hooks
-
src/page-sections/
: Contains page-specific components, styled components, and hooks organized by page name. Each page has its own dedicated folder (e.g.,page-sections/checkout
for the checkout page). With over 55 pages in the project, this structure helps maintain clear separation and organization of page-level components. -
src/theme/
: Contains theme configuration including:- Project theme setup and options
- Color palette definitions
- Typography settings
- Component-level theme customizations
bonik/
├── public/
| └── assets/
| └── images/
├── src/
| ├── __server__/
| | ├── __db__
| | | ├── all dummy data inside
| ├── app/
| | ├── login
| | ├── signup
| | ├── fashion-1
| | ├── fashion-2
| | ├── fashion-3
| | ├── many more page folders
| | ├── page.jsx
| | ├── layout.jsx
| | ├── loading.jsx
| | ├── not-found.jsx
| | |
| ├── components/
| | ├── accordion
| | ├── banners
| | ├── carousel
| | ├── carousel-cards
| | ├── category-cards
| | ├── navbar
| | ├── layouts
| | └── Includes many more reusable components folder
| |
| ├── contexts/
| | └── CartContext.tsx
| |
| ├── data
| ├── hooks
| ├── lib
| ├── models
| ├── page-sections
| | ├── cart
| | ├── checkout
| | ├── fashion-1
| | ├── fashion-2
| | ├── fashion-3
| | └── Few more folders
| |
| ├── theme
| ├── utils
| | ├── __api__
| | | └── all api functions create inside
└── README.md
Component Organization
Component structure are straight forward. The components in this project are organized into different categories based on their purpose and reusability:
Atomic Components
- All reusable atomic components are located in
src/components/
- These include basic UI elements like buttons, inputs, cards etc.
Layout Components
- Layout components that define page structure are in
src/components/layouts/
- Examples include layout-1, layout-2, admin-dashboard, customer-dashboard
Page Section Components
- Larger, page-specific components are stored in
src/page-sections/
- These components typically contain static data that needs to be customized
- Used for building complete page sections like hero areas, feature sections etc.