This project is built with Vite, React, TypeScript, Tailwind CSS, and shadcn/ui, providing a modern and maintainable foundation for web applications.
src/
├── components/
│ ├── ui/ # shadcn components
│ └── layout/ # layout components
│ ├── Header.tsx
│ └── Footer.tsx
├── pages/ # page components
│ ├── Home.tsx
│ └── About.tsx
├── lib/ # utility functions
│ └── utils.ts
├── routes/ # routing configuration
│ └── index.tsx
├── styles/ # global styles
│ └── globals.css
│ └── index.css
└── App.tsx
# Clone the repository
git clone [repository-url]
# Install dependencies
npm install
npm run dev
To add a new shadcn/ui component, use the following command:
npx shadcn add [component-name]
Example:
npx shadcn add button
npx shadcn add card
npx shadcn add dialog
src/pages/
src/routes/index.tsx
:import { NewPage } from "@/pages/NewPage"
export const router = createBrowserRouter([
{
path: "/",
element: <App />,
children: [
// ... existing routes
{
path: "new-page",
element: <NewPage />,
},
],
},
])
src/components/layout/Header.tsx
To add new navigation items, edit src/components/layout/Header.tsx
:
<Button
variant={location.pathname === "/new-path" ? "secondary" : "ghost"}
asChild
>
<Link to="/new-path">New Page</Link>
</Button>
To update footer content, edit src/components/layout/Footer.tsx
:
export function Footer() {
return (
<footer className="border-t border-gray-700 bg-gray-800/50">
<div className="container mx-auto px-4 py-6">
{/* Add your footer content here */}
</div>
</footer>
)
}
src/styles/globals.css
globals.css
Component Organization
Routing
routes/index.tsx
Styling
State Management
npm run dev
- Start development servernpm run build
- Build for productionnpm run lint
- Run ESLintnpm run preview
- Preview production build locally[Your License Here]