A modern, production-ready template for building scalable React applications with TypeScript, Zustand, and Vite.
Production-ready โข Fully typed โข Modern stack
Demo โข Features โข Quick Start โข Documentation
git clone https://github.com/AmirHaytham/React-Zustand-Vite-TS-temp.git
cd React-Zustand-Vite-TS-temp
npm install
cp .env.example .env
npm run dev
Visit http://localhost:3000
to see your app!
# Development
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
# Testing
npm run test # Run tests
npm run test:coverage # Run tests with coverage
# Code Quality
npm run lint # Run ESLint
npm run format # Format with Prettier
# Git Hooks
npm run prepare # Install husky hooks
โโโ src/
โ โโโ components/
โ โ โโโ common/ # Shared components
โ โ โโโ layout/ # Layout components
โ โ โ โโโ AppLayout.tsx
โ โ โโโ leads/ # Lead management
โ โ โโโ LeadForm.tsx
โ โ โโโ LeadForm.test.tsx
โ โโโ store/
โ โ โโโ useStore.ts # Zustand store
โ โโโ assets/ # Static assets
โ โโโ App.tsx # Root component
โ โโโ App.css # Root styles
โ โโโ main.tsx # Entry point
โ โโโ index.css # Global styles
โ โโโ setupTests.ts # Test configuration
โโโ public/ # Public assets
โโโ docs/ # Documentation
โ โโโ TECHNICAL.md
โโโ config/ # Configuration files
โ โโโ .env.example
โ โโโ .env
โ โโโ tsconfig.json
โ โโโ vite.config.ts
โ โโโ tailwind.config.js
โ โโโ eslint.config.js
โโโ .github/ # GitHub workflows
โโโ .husky/ # Git hooks
โ โโโ pre-commit
โ โโโ commit-msg
โโโ docker/ # Docker configuration
โโโ Dockerfile
โโโ docker-compose.yml
# Start the app
docker-compose up
# Stop the app
docker-compose down
# Build the image
docker build -t react-app .
# Run the container
docker run -p 3000:3000 react-app
This template uses Vitest and React Testing Library. Example tests are included in the src/components
directory.
# Run tests in watch mode
npm run test
# Run tests with coverage
npm run test:coverage
Create a .env
file in the root directory:
# App Configuration
VITE_APP_NAME=React Startup
VITE_APP_VERSION=1.0.0
# Development
VITE_DEV_PORT=3000
VITE_DEV_HOST=localhost
# API Configuration
VITE_API_URL=https://api.example.com
# Production
VITE_PROD_URL=https://your-app.com
# Analytics
VITE_ANALYTICS_ID=UA-XXXXX-Y
Note: All environment variables must be prefixed with
VITE_
to be accessible in the app.
npm run build
dist
npm install
.env
npm run build
npm run preview
dist
folder to your hosting providerOur template includes basic security practices:
.env
The template is prepared for analytics integration through environment variables (VITE_ANALYTICS_ID
). You can easily add your preferred analytics solution.
This project is licensed under the MIT License - see the LICENSE file for details.
We love your input! We want to make contributing as easy and transparent as possible. Please read our Contributing Guide for details on:
Made with โค๏ธ by Amir Haytham