A comprehensive, production-ready React boilerplate with all the essential tools and components for building modern web applications.
- Modern React with hooks and context
- Type-safe forms with React Hook Form + Zod validation
- Authentication system with JWT tokens
- Responsive design with Tailwind CSS
- API integration with Axios and React Query
- Error handling with error boundaries
- Loading states and user feedback
- SEO optimized with React Helmet
- Accessibility compliant components
- Code formatting with Prettier and ESLint
- Git hooks with Husky
- Frontend: React 19, React Router DOM
- Styling: Tailwind CSS, Lucide React icons
- Forms: React Hook Form, Zod validation
- State Management: React Query, Context API
- HTTP Client: Axios with interceptors
- Notifications: React Hot Toast
- SEO: React Helmet Async
- Error Handling: React Error Boundary
- Code Quality: ESLint, Prettier, Husky
- Node.js 18+
- npm or yarn
-
Clone the repository
git clone <your-repo-url> cd abacus-app
-
Install dependencies
npm install # or yarn install -
Set up environment variables
cp env.example .env
Edit
.envwith your configuration. -
Start the development server
npm start # or yarn start -
Open your browser Navigate to http://localhost:3000
src/
βββ components/ # Reusable UI components
β βββ auth/ # Authentication components
β βββ common/ # Common components (ErrorBoundary, ProtectedRoute)
β βββ layout/ # Layout components (Header, Footer, Layout)
β βββ ui/ # Base UI components (Button, Input, Card)
βββ hooks/ # Custom React hooks
βββ pages/ # Page components
βββ utils/ # Utility functions
β βββ api.js # API configuration and methods
β βββ cn.js # Class name utility
β βββ format.js # Formatting utilities
β βββ validation.js # Validation schemas
βββ App.js # Main application component
npm start- Start development servernpm build- Build for productionnpm test- Run testsnpm run lint- Run ESLintnpm run lint:fix- Fix ESLint errorsnpm run format- Format code with Prettier
- Button - Multiple variants (default, outline, secondary, etc.)
- Input - Form inputs with validation support
- Card - Content containers with header, content, and footer
- LoadingSpinner - Loading indicators
- Header - Navigation with user menu
- Footer - Site footer with links
- Layout - Page wrapper with header/footer
- LoginForm - User login with validation
- RegisterForm - User registration with validation
- ErrorBoundary - Error catching and display
- ProtectedRoute - Route protection based on authentication
- NotFound - 404 error page
The boilerplate includes a complete authentication system:
- JWT token management
- Automatic token refresh
- Protected routes
- Login/Register forms
- User context
import { useAuth } from './hooks/useAuth';
function MyComponent() {
const { user, login, logout, isAuthenticated } = useAuth();
// Use authentication methods
}Configured with Axios and React Query for efficient API calls:
- Automatic token injection
- Error handling
- Request/response interceptors
- Caching and background updates
import { apiService } from './utils/api';
// GET request
const data = await apiService.get('/users');
// POST request
const result = await apiService.post('/users', userData);Built-in form validation with React Hook Form and Zod:
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
const schema = z.object({
email: z.string().email(),
password: z.string().min(8),
});
const {
register,
handleSubmit,
formState: { errors },
} = useForm({
resolver: zodResolver(schema),
});Uses Tailwind CSS with custom configuration:
- Custom color palette
- Responsive design utilities
- Custom animations
- Component-based styling
Create a .env file based on env.example:
REACT_APP_API_BASE_URL=http://localhost:3001/api
REACT_APP_AUTH_TOKEN_KEY=abacus_auth_token
REACT_APP_ENABLE_DEBUG_MODE=falseCustomize colors, fonts, and utilities in tailwind.config.js.
npm run buildEnsure all environment variables are set in your production environment.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review the code examples
Keep your boilerplate updated:
npm update
npm audit fixBuilt with β€οΈ for modern web development