React Folder Structure
The TailAdmin React Template is built on a modern stack using React 19, Vite 8, TypeScript, Tailwind CSS v4, React Router 8, and Base UI. It follows a modular, scalable architecture to keep source code, layout shells, reusable UI primitives, shared widgets, stylesheets, and localization dictionaries clean and maintainable.
Root Directory
The root directory organizes the source code and configuration.
| File / Folder | Description |
|---|---|
src/ | Contains all React components, layout shells, pages, routes, contexts, hooks, i18n, and styles. |
public/ | Contains static files served directly (images/, favicon.png, maplibre/). |
package.json | Manages scripts and dependencies. |
vite.config.ts | Vite 8 configuration with React Compiler, Tailwind CSS v4 plugin, SVGR, and @/* path alias. |
tsconfig.json | TypeScript Config |
eslint.config.js | ESLint flat config with Oxlint. |
.oxlintrc.json | High-performance Rust-based Oxlint configuration for instant linting. |
index.html | Application HTML entrypoint. |
README.md | Project overview, prerequisites, and getting started instructions. |
AGENTS.md | Authoritative architecture, patterns, and guidelines for AI coding assistants. |
Source Directory (src)
Inside src/, the codebase is organized into layout shells, UI primitives, shared widgets, categorized route pages, context providers, custom hooks, i18n localization, and styling.
Key Directories Explained
src/App.tsx
src/App.tsx is the single source of truth for all routes in the application.
- Adding a Page: To add a new page:
- Create a feature folder under
pages/{main,others,support}/, - Colocate page-specific components, register the route in
App.tsx, - Add message files (
messages/*.json), - add navigation entries to
components/layout/app-layout/sidebar/data.tsx
src/components/
The component library is split into layout shells, shared widgets, and atom-level UI primitives:
ui/: Flat, headless-style primitive components built on Base UI.shared/: Cross-route widgets reused across multiple pages, includingpage-meta.tsx(page title & description viareact-helmet-async),page-breadcrumb.tsx,component-card.tsxfor showcase sections, andvector-map.tsx.layout/: Application layout shells including the defaultapp-layout(header, sidebar, content container, andOutlet) and six alternative layout configurations (layout-onethroughlayout-six).
src/pages/
Routes are organized into three primary categories for structure and discoverability:
main/: Core dashboard features including 11 pre-built dashboard variations , AI Assistant, Calendar, Task management, Forms, Tables, and empty state pages.support/: Real-time style chat messenger, full email client with inbox and detail views, and a complete support tickets help desk system.others/: Supplementary feature pages including authentication forms (withAuthLayout), ApexCharts interactive charts, MapLibre GL and Leaflet interactive maps, and UI element showcases.
src/i18n/ & src/messages/
Built-in internationalization powered by i18next and react-i18next:
- Translations: Organized in modular JSON dictionary files under
src/messages/{en,ar,de,es}.jsonsupporting ICU interpolation and plural syntax. - Supported Locales: English (
en), Arabic (arwith automatic Right-to-Left RTL layout switching), German (de), and Spanish (es). - Translation Hooks: Access translated strings in components using
const t = useTranslations("namespace")orgetTranslations()outside components, withuseLocale()anduseChangeLocale()for locale management.
src/contexts/ & src/hooks/
contexts/: Clean global state management.hooks/: Reusable custom hooks.