A modern React application built with TypeScript, Vite, and TanStack Router for learning and development purposes.
- React 19 - Latest React with concurrent features
- TypeScript - Full type safety and better developer experience
- TanStack Router - File-based routing with type-safe navigation
- TanStack Query - Powerful data fetching and caching
- Tailwind CSS - Utility-first CSS framework
- ESLint - Code linting and formatting
- Husky + Commitlint - Git hooks for code quality
- Path Aliases - Clean import statements
src/
βββ components/ # Reusable UI components
β βββ layout/ # Layout components
β βββ shared/ # Shared components
β βββ ui/ # UI components
βββ hooks/ # Custom React hooks
β βββ queries/ # Query-related hooks
β βββ use-persistance.ts
βββ routes/ # File-based routes (TanStack Router)
β βββ __root.tsx # Root layout
β βββ index.tsx # Home page (/)
β βββ about.tsx # About page (/about)
β βββ contact.tsx # Contact page (/contact)
β βββ users/ # User-related routes
β βββ index.tsx # Users list (/users)
β βββ $userId.tsx # User profile (/users/:userId)
β βββ route.tsx # /users layout file
βββ services/ # API services and external integrations
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
β βββ persistance.ts
βββ contexts/ # React contexts
βββ conf/ # Configuration files
βββ router.tsx # Router configuration
βββ main.tsx # Application entry point
βββ App.tsx # Main app component
docs/ # Documentation
βββ TANSTACK_FILEBASED_ROUTING.md
- React 19 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- TanStack Router - File-based routing
- TanStack Query - Data fetching and caching
- Axios - HTTP client
- Tailwind CSS - Utility-first CSS
- ESLint - Code linting
- Husky - Git hooks
- Commitlint - Commit message linting
- Node.js (v20.18.3 or higher)
- npm or yarn
- Clone the repository
git clone <repository-url>
cd codemy-web- Install dependencies
npm install
npm run prepare- Start the development server
npm run dev- Open http://localhost:5173 in your browser
# Development
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
# Code Quality
npm run lint # Run ESLint
# Git Hooks (auto-setup)
npm run prepare # Setup Husky hooksThis project uses TanStack Router with file-based routing. Routes are automatically generated from files in the src/routes/ directory.
src/routes/index.tsxβ/(Home)src/routes/about.tsxβ/aboutsrc/routes/users/$userId.tsxβ/users/:userId(Dynamic route)
- Type-safe navigation - Full TypeScript support
- Dynamic routes - URL parameters with
$paramsyntax - Nested routes - Folder-based organization
- Route loaders - Data fetching before render
- Route actions - Form handling and mutations
- Automatic code splitting - Performance optimization
For detailed routing documentation, see docs/TANSTACK_FILEBASED_ROUTING.md.
The project uses Tailwind CSS for styling with a utility-first approach.
- Responsive design with
sm:,md:,lg:prefixes - Flexbox utilities:
flex,items-center,justify-center - Spacing:
p-8,m-4,space-x-4 - Colors:
bg-indigo-500,text-gray-900 - Shadows:
shadow-md,shadow-lg
The project enforces code quality through:
- ESLint - Catches potential bugs and enforces style
- TypeScript - Strict type checking
- Pre-commit hooks - Automatic linting before commits
- Commit message linting - Conventional commit format
This project uses Husky for Git hooks and Commitlint to enforce conventional commit messages.
- Runs ESLint on staged files before each commit
- Enforces conventional commit format
- Supported commit types:
build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
type(scope): description
[optional body]
[optional footer]
feat: add user authentication
fix: resolve memory leak in component
docs: update API documentation
style: format code with prettier
refactor: simplify component logic
Clean import statements using path aliases:
// Instead of relative paths
import Component from '../../../components/ui/Button'
// Use aliases
import Component from '@/components/ui/Button'
import { usePersistance } from '@/hooks/use-persistance'
import { apiClient } from '@/services/api'Available aliases:
@/*βsrc/*@components/*βsrc/components/*@hooks/*βsrc/hooks/*@utils/*βsrc/utils/*@types/*βsrc/types/*@routes/*βsrc/routes/*@conf/*βsrc/conf/*
- TanStack Router Guide - Complete routing documentation
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please follow conventional commit format. The pre-commit hooks will enforce this automatically.
This project is private and proprietary.
Built with β€οΈ using React, TypeScript, and modern web technologies.