π File Structure (App Router)
The TailAdmin Next.js file structure is designed to allow the use of the App Router, offering a clear separation between pages, layouts, and other essential resources. By properly organizing your project, you can take full advantage of Next.jsβs features, such as SSR, SSG, ISR, and more.
Hereβs an overview of the file structure:
-
π public/
β Contains static files such asfavicon.ico
, fonts, and other assets.π images/
β Contains all image files used in the project.
-
π src/
β Contains the source code of your Next.js app.-
π app/
β The core directory for Next.js pages and layouts (App Router).π layout.tsx
β Root layout component for the entire application.π page.tsx
β The main entry point for the homepage.π dashboard/
β Dashboard route.π page.tsx
β Dashboard main page.π analytics/
β Analytics subpage.π page.tsx
β Analytics dashboard page.
π crm/
β CRM subpage.π page.tsx
β CRM dashboard page.
π ecommerce/
β E-commerce subpage.π page.tsx
β E-commerce dashboard page.
π marketing/
β Marketing subpage.π page.tsx
β Marketing dashboard page.
-
π components/
β Contains reusable components used across the app.π common/
β Contains commonly used reusable components like breadcrumb.π ui/
β Contains UI-specific reusable components like buttons and modals.
-
π contexts/
β Contains React Context providers for managing global state.π SidebarContext/
β Manages sidebar-related state across the application.π ThemeContext/
β Handles theme preferences (dark/light mode).
-
π hooks/
β Contains custom React hooks to reuse logic across components. -
π utils/
β Contains utility functions for common tasks like formatting dates, API helpers, etc.
-
-
π next.config.js
β Next.js configuration file. -
π package.json
β NPM package configuration and dependencies. -
π tailwind.config.js
β Tailwind CSS configuration file. -
π tsconfig.json
β TypeScript configuration file. -
π .eslintrc.js
β ESLint configuration for code linting. -
π .gitignore
β Specifies files and folders to be ignored by Git.
This file structure for TailAdmin Next.js provides a clean, modular, and scalable way to manage both the frontend and backend aspects of your project. The use of the App Router allows for better routing management and smoother navigation between different sections of your dashboard.