Directory tree
src/ subdirectories
components/
Reusable UI pieces shared across pages. The
Layout.tsx shell and Navigation.tsx bar live here, alongside the ui/ folder for shadcn/ui primitives.pages/
Full-page components that map one-to-one with routes. Each file exports a single React component rendered inside
Layout via <Outlet />.routes/
All routing logic.
AppRoutes.tsx defines the route tree as a RouteObject[] array; index.tsx bootstraps createBrowserRouter and exports the router instance.lib/
Shared utilities. Currently contains
utils.ts, which exports the cn() helper for composing Tailwind class names.data/
Static application data.
featureData.ts holds the feature list used by FeaturesPage. Use this folder for any typed, in-memory data that pages consume directly.components/ui/
shadcn/ui primitives (
button.tsx, card.tsx, input.tsx). These are owned by your project — edit them directly to customize appearance or behavior.Key config files
vite.config.ts
Configures the build tool with two plugins and the @ path alias:
vite.config.ts
@vitejs/plugin-react-swc— compiles React with the SWC transpiler for faster builds.@tailwindcss/vite— integrates Tailwind CSS v4 without a separatetailwind.config.jsfile.- The
@alias maps to./src, so you can writeimport { cn } from "@/lib/utils"from anywhere in the project.
tsconfig.app.json
Mirrors the Vite alias on the TypeScript side so the compiler resolves the same paths:
tsconfig.app.json
components.json
The shadcn/ui configuration file. It tells the shadcn CLI where to put components and which style variant to use:
components.json
npx shadcn add <component>, the CLI reads this file and drops the new component into src/components/ui/ with the correct import path for cn().
Conventions
@ path alias
All imports within src/ use the @ alias rather than relative paths. This makes imports stable regardless of how deep a file is nested:
Small, composable components
Each component has a single responsibility.Layout provides the shell; Navigation handles the navbar; page components handle only their own content. Avoid putting routing logic inside page components or layout logic inside pages.
Tailwind utilities over ad-hoc CSS
Style everything with Tailwind utility classes. Reservesrc/index.css for CSS variables and Tailwind base layer customizations only — not one-off selectors.
The data layer
src/data/featureData.ts is the pattern to follow for static, typed data:
src/data/featureData.ts
type, export a typed const array, and import it directly in the page that needs it. For dynamic data, replace this pattern with a data-fetching hook or a loader function in your route definition.