A modern, feature-rich React TypeScript starter template with a comprehensive tech stack for building robust web applications.
- React 18 - Latest version with modern features
- TypeScript - Type safety and better developer experience
- Vite - Fast build tool and development server
- React Router - Client-side routing for single-page applications
- Ant Design - Professional React UI library with rich components
- SCSS/Sass - Enhanced CSS with variables, mixins, and nested selectors
- Responsive Design - Mobile-first approach with media queries
- TanStack React Query - Powerful server state management
- Axios - HTTP client for API requests
- Custom Hooks - Reusable logic for API interactions
- ESLint - Code linting and quality assurance
- TypeScript Compiler - Type checking and compilation
- Hot Module Replacement - Fast development with instant updates
- Pre-commit Hooks - Automated code quality checks before commits
- Knip - Unused dependency and export detection
- GitHub Actions - Automated CI/CD pipeline for deployment
- Navigation - Responsive navigation with Ant Design Menu
- Home Page - Interactive demo with tabs showcasing:
- Posts management
- User profiles
- Photo gallery
- Dashboard statistics
- About Page - Feature overview and technology stack
- JSONPlaceholder API - Demo integration showing:
- Data fetching with loading states
- Error handling
- Caching and background refetching
- Parallel and dependent queries
- Server State Management - Optimistic updates and synchronization
- Loading States - Smooth user experience with spinners
- Error Boundaries - Graceful error handling
- Responsive Design - Works on all device sizes
- Node.js (version 16 or higher)
- npm or yarn
-
Clone the repository:
git clone <repository-url> cd react-starter-template
-
Install dependencies:
npm install
Start the development server:
npm run dev- Opens automatically at
http://localhost:3000 - Hot reload enabled for instant updates
Build for production:
npm run build- Generates optimized build in
dist/folder - Includes type checking and bundling
Preview the production build:
npm run preview- Serves the built files locally for testing
Run code quality checks:
npm run lint- Checks for code quality issues
- Enforces consistent coding standards
Automated quality checks run before every commit:
- ESLint - Ensures code quality and consistency
- TypeScript Build - Verifies type safety and compilation
- Knip Analysis - Detects unused dependencies and exports
The pre-commit hook automatically runs these checks when you commit changes, preventing issues from entering the repository. If any check fails, the commit is blocked until the issues are resolved. To bypass the hook temporarily, use git commit --no-verify.
Automated deployment to GitHub Pages using GitHub Actions:
- Continuous Integration - Runs on every push to main branch
- Build Process - Installs dependencies, runs linting, and builds the project
- Automatic Deployment - Deploys built files to
sitebranch for GitHub Pages - Pull Request Checks - Validates builds on pull requests without deploying
The workflow automatically builds and deploys your application whenever you push changes to the main branch. Configure GitHub Pages to use the site branch as the source to serve your application.
react-starter-template/
βββ .github/
β βββ workflows/ # GitHub Actions workflows
β βββ deploy.yml # Build and deploy workflow
βββ public/ # Static assets
βββ src/
β βββ components/ # Reusable UI components
β β βββ Navigation.tsx # Navigation component
β βββ pages/ # Page components
β β βββ Home.tsx # Home page with API demo
β β βββ About.tsx # About page
β βββ hooks/ # Custom React hooks
β β βββ useApi.ts # API interaction hooks
β βββ services/ # API and service layer
β β βββ api.ts # API client and types
β βββ App.tsx # Main application component
β βββ App.scss # Application styles
β βββ main.tsx # Application entry point
β βββ index.scss # Global styles
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ README.md # This file
- Function components with hooks
- TypeScript for type safety
- Latest React 18 features
- Ant Design component library
- Consistent design system
- Responsive layouts with Grid and Flexbox
- TanStack React Query for server state
- Automatic caching and synchronization
- Background refetching and optimistic updates
- Axios for HTTP requests
- Custom hooks for data fetching
- Error handling and loading states
- SCSS with variables and mixins
- Responsive design patterns
- Component-scoped styles
- Fast development with Vite
- Type checking with TypeScript
- Code quality with ESLint
- Hot module replacement
- Pre-commit hooks for automated quality assurance
- GitHub Actions for continuous deployment
- Create component in
src/pages/ - Add route in
src/App.tsx - Update navigation in
src/components/Navigation.tsx
- Define types in
src/services/api.ts - Create custom hooks in
src/hooks/useApi.ts - Use hooks in components for data fetching
- Add variables in
src/App.scss - Create mixins for reusable styles
- Use nested selectors for organization
Visit the running application to see:
- Posts Tab - Fetches and displays blog posts
- Users Tab - Shows user profiles with contact information
- Photos Tab - Image gallery with lazy loading
- Dashboard Tab - Statistics and metrics overview
This template demonstrates:
- Modern React patterns and best practices
- TypeScript integration in React applications
- Professional UI development with Ant Design
- Server state management with React Query
- SCSS preprocessing and responsive design
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is open source and available under the MIT License.
Happy coding! π
This template provides a solid foundation for building modern React applications with TypeScript, professional UI components, and robust state management.