A fast, accessible, and modular frontend built with React. Designed with developer experience and a clean architecture in mind.
- Modern React with hooks and functional components
- Type-safe APIs and components (TypeScript-ready)
- Routing, code-splitting, and lazy loading
- Global state with light-weight patterns (Context/Zustand/Redux)
- Accessible UI (WAI-ARIA), keyboard-friendly interactions
- Environment-driven configuration
- Zero-config formatting and linting
- Production-ready build and preview
- React + Vite
- React Router
- Styling: Tailwind CSS / CSS Modules / Styled Components
- State: Context / Zustand / Redux Toolkit
- HTTP: Fetch / Axios
- Tooling: ESLint, Prettier, Husky (pre-commit)
- Testing: Vitest + React Testing Library
Choose the exact options that fit your setup; this README supports common stacks out of the box.
- Node.js >= 18
- npm, pnpm, or yarn
# Using npm
npm install
# Using pnpm
pnpm install
# Using yarn
yarn# start dev server
npm run dev
# or
pnpm dev
# or
yarn devThe app will be available at http://localhost:5173.
npm run build
npm run preview # optional: serve the production build locallyCreate a .env file at the project root. Example:
VITE_API_BASE_URL=https://api.example.com
VITE_SENTRY_DSN=
VITE_FEATURE_FLAG_X=false- For Vite, variables must be prefixed with
VITE_. - Never commit secrets. Use
.env.localfor machine-specific overrides (gitignored).
Update these to match your package.json:
# Dev and build
npm run dev # start development server (Vite)
npm run build # build for production
npm run preview # preview production build (Vite)
# Quality
npm run lint # run ESLint
npm run lint:fix # fix lint issues
npm run format # run Prettier
npm run test # unit tests
npm run test:watch # watch modeExample structure—adjust to your app:
frontend/
├─ public/ # static assets
├─ src/
│ ├─ app/ # app shell, providers
│ ├─ components/ # shared UI components
│ ├─ features/ # feature-based modules
│ ├─ pages/ # route views
│ ├─ routes/ # route definitions
│ ├─ hooks/ # reusable hooks
│ ├─ lib/ # utils, API clients
│ ├─ store/ # global state
│ ├─ styles/ # global styles / tailwind.css
│ ├─ assets/ # images, icons
│ ├─ main.tsx # app entry
│ └─ index.css
├─ .env.example
├─ package.json
└─ README.md
- ESLint and Prettier are configured to ensure consistent code style.
- Recommended VS Code extensions:
- ESLint
- Prettier
- Tailwind CSS IntelliSense (if applicable)
Optional pre-commit hook (Husky + lint-staged):
- Formats staged files and runs quick lint/tests before committing.
We love contributions! To get started:
- Fork the repository and create a feature branch:
git checkout -b feat/your-feature
- Install dependencies and run the app locally.
- Ensure
npm run lintandnpm run testpass. - Commit with Conventional Commits:
feat: add user profile cardfix: handle empty API response
- Open a pull request and fill out the PR template.
Please read .github/CONTRIBUTING.md and .github/CODE_OF_CONDUCT.md (if present).
- Unit tests with Vitest and React Testing Library.
- Example:
npm run test npm run test:watch - Add tests for new components, hooks, and utilities.
- Aim for meaningful coverage, not 100% for its own sake.
- Use React.lazy and dynamic imports for code-splitting heavy routes.
- Preload critical assets where appropriate.
- Follow WAI-ARIA best practices; verify with:
- Lighthouse
- axe DevTools
Common options:
- Netlify / Vercel / GitHub Pages / Cloudflare Pages
Basic flow:
- Build:
npm run build - Deploy the
dist/directory.
Set environment variables in your hosting provider.
- Q: Where do I configure API base URL?
- A: In
.envusing theVITE_prefix.
- A: In
- Q: How do I add a new route?
- A: Add a component in
src/pages/and register it insrc/routes/.
- A: Add a component in
- Dark mode theme
- Offline support (PWA)
- i18n
- Component documentation with Storybook
This project is licensed under the MIT License. See LICENSE for details.
- React, Vite, and the OSS community
- ESLint, Prettier, and Testing Library teams