π 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. -
π 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.