A modern, high-performance website built with React, TypeScript, and Tailwind CSS.
- Modern Stack: Built with React 19, TypeScript 5.8, and Vite 7
- Type-Safe: Full TypeScript coverage with strict typing
- Responsive Design: Mobile-first approach with Tailwind CSS 4
- Performance Optimized: Code splitting, lazy loading, and optimized assets
- Accessible: ARIA-compliant components following WCAG guidelines
- Form Validation: Robust client-side validation with helpful error messages
- Code Quality: ESLint, Prettier, and automated formatting
- Node.js 18+
- npm 9+ or yarn 1.22+
- Clone the repository:
git clone https://github.com/uxlabspk/codehunts.git
cd codehunts- Install dependencies:
npm install- Copy environment variables:
cp .env.example .env- Update
.envwith your configuration
Start the development server:
npm run devThe app will be available at http://localhost:5173
Create a production build:
npm run buildPreview the production build:
npm run previewnpm run type-checknpm run lint # Check for issues
npm run lint:fix # Auto-fix issuesnpm run format # Format all files
npm run format:check # Check formattingRun all checks at once:
npm run validatesrc/
βββ assets/ # Static assets (images, icons)
βββ components/ # React components
β βββ common/ # Shared components
β βββ form/ # Form components
β βββ landing/ # Landing page sections
β βββ portfolio/ # Portfolio components
β βββ services/ # Service-related components
β βββ ui/ # Base UI components
βββ config/ # Configuration files
βββ constants/ # App constants and enums
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions
βββ pages/ # Page components
βββ services/ # API and external services
βββ types/ # TypeScript type definitions
- Use TypeScript and define prop interfaces
- Export components as named exports
- Include proper TypeScript types
- Add JSDoc comments for complex components
Example:
interface ButtonProps {
label: string;
onClick: () => void;
variant?: "primary" | "secondary";
}
/**
* Reusable button component
*/
export function Button({ label, onClick, variant = "primary" }: ButtonProps) {
// Component logic
}- Use Tailwind CSS utility classes
- Extract repeated patterns to component variants
- Use
cn()utility for conditional classes
- vite.config.ts: Vite configuration
- tsconfig.json: TypeScript configuration
- eslint.config.js: ESLint rules
- .prettierrc: Prettier formatting rules
See .env.example for all available variables:
VITE_APP_NAME: Application nameVITE_API_URL: API endpoint URLVITE_CONTACT_EMAIL: Contact email address
- React 19: UI library
- React Router 7: Client-side routing
- Tailwind CSS 4: Utility-first CSS framework
- Radix UI: Accessible component primitives
- Lucide React: Icon library
- TypeScript 5.8: Type safety
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Run validation:
npm run validate - Commit changes:
git commit -m "feat: your feature" - Push to branch:
git push origin feature/your-feature - Create a Pull Request
Follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting)refactor:Code refactoringtest:Adding testschore:Build process or auxiliary tool changes
Copyright Β© 2024 CodeHunts. All rights reserved.
- Email: [email protected]
- Website: https://codehunts.com
- Location: I-10/2 Islamabad, Pakistan
Built with modern web technologies and best practices.
export default tseslint.config([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
]);You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from "eslint-plugin-react-x";
import reactDom from "eslint-plugin-react-dom";
export default tseslint.config([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs["recommended-typescript"],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
]);