This repository demonstrates a simple project structure for a React application using TypeScript and Vite. It includes essential libraries and configurations to get started quickly with modern web development.
- React 18 - A powerful JavaScript library for building user interfaces.
- TypeScript - A statically typed superset of JavaScript for better development experience and maintainability.
- Vite - A fast build tool for modern web projects.
- React Router - Declarative routing for React applications.
- ShadCN - A collection of UI components built on top of Tailwind CSS.
- Tailwind CSS - A utility-first CSS framework for rapid UI development.
Follow these steps to set up the project from scratch:
# Create a new Vite project
npm create vite@latestThen, follow the command-line instructions
# Navigate into the project directory
cd my-app
# Install dependencies
npm installInstall the additional libraries required for the project:
npm install react-router-dom# Install Tailwind CSS and its dependencies
npm install -D tailwindcss postcss autoprefixer
# Initialize Tailwind CSS configuration
npx tailwindcss init# Install shadcn components and prerequisites
npm install shadcn-uisrc/
assets/ # Static assets (e.g., images, SVGs)
components/ # Reusable React components
features/ # Feature-specific components
ui/ # Shared UI components
hooks/ # Custom React hooks
features/ # Feature-specific hooks
layouts/ # Layout components
lib/ # Utility functions and helpers
router/ # Application routing setup
styles/ # Tailwind CSS and global styles
views/ # Top-level application pages
main.tsx # Application entry point
vite-env.d.ts # Vite environment type definitions
-
Start the development server:
npm run dev
-
Open the application in your browser at http://localhost:5173.
-
To build for production:
npm run build