This document defines the conventions, file structure, and best practices to be followed
as./src/
โโโ api
โ โโโ api.ts # API
โโโ components
โ โโโ # Reusable UI components
โโโ helper
โ โโโ # General-purpose helper functions
โโโ hooks
โ โโโ # Custom React hooks
โโโ lib
โ โโโ # Third-party libraries or wrappers
โโโ main.tsx # App entry point
โโโ pages
โ โโโ App.module.css # Styles for the main App
โ โโโ App.tsx # Root component
โโโ services
โ โโโ # service layer
โโโ styles
โ โโโ # Global and shared styles
โโโ utils
โ โโโ # Utility functions
โโโ vite-env.d.ts # TypeScript definitions for Vite
- Use CamelCase (PascalCase) for function names.
eg-
function FetchUserProfile() { ... }
function HandleLoginResponse() { ... }Here is the updated README.md for your exp-file project, now including the full folder structure under ./src/:
- Use smallCamel (camelCase) for variable names.
let userToken: string;
const isProfileComplete = true;- Use kebab-case for file and class names.
- Prefer CSS Modules for component styles.
/* App.module.css */
.header-container { ... }
.login-form__input--focused { ... }- Use kebab-case for folder and file names.
- Group logically related files in folders.
components/
โโโ user-card/
โโโ user-card.tsx
โโโ user-card.module.css- DRY: Donโt Repeat Yourself.
- Modularize: Component, Logic, API, Utility separation.
- Use TypeScript for all files (
.tsx/.ts). - Write meaningful commit messages.