A modern, production-ready React frontend template with all the tools you need to build amazing client-side applications.
π Quick Start β’ π Documentation β’ π οΈ Features β’ π³ Docker
Get a glimpse of what you'll be working with:
Beautiful welcome page showcasing all included technologies and dependencies
Comprehensive development tools section with helper scripts and workflow guidance
Visual representation of the complete development process from setup to deployment
- π― Overview
- β¨ Features
- π οΈ Tech Stack
- π Quick Start
- π Project Structure
- π§ Configuration
- π³ Docker Support
- π Available Scripts
- π¨ Styling & Components
- π Environment Variables
- π§ͺ Testing
- π Deployment
- π€ Contributing
- π License
This template is a comprehensive starter kit for building modern React frontend applications. Created by @DimitriTedom (SnowDev) for the developer community at Worketyamo-Students, it integrates the best practices and most popular tools in the React ecosystem for client-side development.
Perfect for:
- π’ Enterprise frontend applications
- π± SaaS dashboards and interfaces
- ποΈ E-commerce frontend experiences
- π Data visualization and admin panels
- π¨ Portfolio and marketing websites
- π Progressive Web Apps (PWAs)
- β‘ Lightning Fast: Powered by Vite for instant hot reload
- π― Type Safe: Full TypeScript support with strict configuration
- π¨ Modern UI: Pre-built components with ShadCN/UI
- π± Responsive: Mobile-first design with TailwindCSS
- π State Management: Zustand for simple and powerful state management
- π Icon Library: Comprehensive icon set with React Icons
- π§ Pre-configured: ESLint, Prettier, and TypeScript ready
- π³ Docker Ready: Multi-stage Dockerfile with optimization
- π Environment Templates: Comprehensive .env.template
- π¨ Custom Tailwind Layers: Organized CSS with base, components, and utilities
- π Security: Best practices for secure applications
- π¦ Optimized Builds: Tree-shaking and code splitting
- π SEO Friendly: Meta tags and proper HTML structure
- βΏ Accessible: WCAG compliant components
- π i18n Ready: Internationalization support structure
- πΌοΈ Beautiful Welcome Page: Showcases all technologies with interactive elements
- π± Responsive Layout: Mobile-first design that works on all devices
- π Dark Mode Ready: CSS variables for easy theme switching
- β¨ Smooth Animations: Custom keyframe animations for better UX
- π― Developer Guidance: Visual workflow and tool explanations
| Category | Technology | Version | Purpose |
|---|---|---|---|
| Framework | React | 18.3.1 | UI Library |
| Language | TypeScript | 5.5.3 | Type Safety |
| Build Tool | Vite | 5.4.8 | Fast Development & Build |
| Styling | TailwindCSS | 3.4.13 | Utility-first CSS |
| UI Components | ShadCN/UI | Latest | Pre-built Components |
| State Management | Zustand | 5.0.0-rc.2 | Global State |
| Icons | React Icons | 5.3.0 | Icon Library |
| Linting | ESLint | 9.11.1 | Code Quality |
| Container | Docker | - | Containerization |
- Node.js 18+
- npm or yarn or pnpm
- Git
# Clone the repository
git clone https://github.com/DimitriTedom/SnowDev-ReactJs-Template.git
# Navigate to project directory
cd My-React-APP_Template-SnowDev
# Install dependencies
npm install# Copy environment template
cp .env.template .env
# Edit your environment variables
nano .env # or your preferred editor# Start development server
npm run dev
# Open http://localhost:5173You're ready to start building your amazing application!
My-React-APP_Template-SnowDev/
βββ π public/ # Static assets
β βββ vite.svg # Vite logo
βββ π src/ # Source code
β βββ π components/ # Reusable components
β β βββ π ui/ # ShadCN UI components
β β βββ button.tsx # Button component
β βββ π lib/ # Utility functions
β β βββ utils.ts # Helper utilities
β βββ App.tsx # Main application component
β βββ index.css # Global styles & Tailwind
β βββ main.tsx # Application entry point
β βββ vite-env.d.ts # Vite type definitions
βββ π .env.template # Environment variables template
βββ π components.json # ShadCN configuration
βββ π Dockerfile # Docker configuration
βββ π eslint.config.js # ESLint configuration
βββ π index.html # HTML entry point
βββ π LICENSE # MIT License
βββ π nginx.conf # Nginx configuration
βββ π package.json # Dependencies & scripts
βββ π postcss.config.js # PostCSS configuration
βββ π README.md # Documentation
βββ π tailwind.config.js # TailwindCSS configuration
βββ π tsconfig.json # TypeScript configuration
βββ π tsconfig.app.json # TypeScript app configuration
βββ π tsconfig.node.json # TypeScript node configuration
βββ π vite.config.ts # Vite configuration
Our CSS is organized into three layers:
- CSS reset and normalization
- Theme variables (light/dark mode)
- Global styles and typography
- Reusable component classes
- Card, button, form components
- Layout helpers (flex-center, grid-responsive)
- Custom utility classes
- Animations and effects
- Debug utilities (remove in production)
{
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/index.css"
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}# Build development image
docker build --target development -t my-react-app:dev .
# Run development container
docker run -p 5173:5173 -v $(pwd):/app my-react-app:dev# Build production image
docker build --target production -t my-react-app:prod .
# Run production container
docker run -p 80:80 my-react-app:prod- ποΈ Builder stage: Optimized Node.js build
- π Production stage: Lightweight Nginx server
- π Security: Non-root user, minimal attack surface
- β‘ Performance: Gzip compression, caching headers
- π₯ Health checks: Built-in container health monitoring
| Script | Command | Description |
|---|---|---|
| Development | npm run dev |
Start development server with HMR |
| Build | npm run build |
Build for production |
| Preview | npm run preview |
Preview production build locally |
| Lint | npm run lint |
Run ESLint for code quality |
| Type Check | npm run type-check |
Run TypeScript compiler check |
{
"scripts": {
"docker:build": "docker build -t my-react-app .",
"docker:run": "docker run -p 80:80 my-react-app",
"docker:dev": "docker build --target development -t my-react-app:dev . && docker run -p 5173:5173 my-react-app:dev"
}
}/* Layout */
.container /* Responsive container */
.flex-center /* Flex center alignment */
.flex-between /* Flex space-between */
.grid-responsive /* Responsive grid layout */
/* Components */
.card /* Card container */
.btn /* Base button */
.btn-primary /* Primary button variant */
.form-input /* Form input styling */
/* Utilities */
.text-gradient /* Gradient text effect */
.glass /* Glassmorphism effect */
.animate-in /* Slide-in animation */- Button with variants
- Card components
- Form elements
- Layout components
- Navigation elements
# Add ShadCN components
npx shadcn-ui@latest add dialog
npx shadcn-ui@latest add dropdown-menu
npx shadcn-ui@latest add formVITE_APP_NAME="My React App"
VITE_API_URL="http://localhost:3001/api"
VITE_DEBUG_MODE="false"JWT_SECRET="your-secret-key"
API_SECRET="your-api-secret"- β Never expose secrets to client-side
- β Use VITE_ prefix only for public variables
- β Validate environment variables on startup
- β Use different .env files for different environments
# Install testing dependencies
npm install -D vitest @testing-library/react @testing-library/jest-dom
# Add to package.json
{
"scripts": {
"test": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest --coverage"
}
}src/
βββ __tests__/ # Test files
βββ components/
β βββ __tests__/ # Component tests
βββ utils/
βββ __tests__/ # Utility tests
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel# Build command: npm run build
# Publish directory: dist# Build and run
docker build -t my-react-app .
docker run -p 80:80 my-react-app# Staging
VITE_NODE_ENV=staging npm run build
# Production
VITE_NODE_ENV=production npm run buildWe welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
npm test - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- β Follow TypeScript best practices
- β Use meaningful commit messages
- β Add tests for new features
- β Update documentation
- β Follow existing code style
- π Bug Report: Describe the issue with reproduction steps
- π‘ Feature Request: Propose new features or improvements
- π Documentation: Improve or fix documentation
- π¬ Discussions: GitHub Discussions
- π Issues: GitHub Issues
- π Wiki: Project Wiki
Special thanks to:
- Worketyamo-Students community for inspiration
- React Team for the amazing framework
- Vite Team for the lightning-fast build tool
- TailwindCSS Team for the utility-first CSS framework
- ShadCN for the beautiful component library
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by DimitriTedom (SnowDev)
For the amazing developers at Worketyamo-Students π
β Star this repo if you found it helpful!