Overview
DevJobs is built with a modern React architecture using Vite as the build tool. The project follows a component-based structure with clear separation of concerns.Directory Structure
Component Organization
Components are organized by feature, with each component in its own directory containing all related files:Component Structure Convention
Each component follows this pattern:- Component directory: Named with PascalCase matching the component name
- JSX file: Contains the component logic and markup
- CSS Module (optional): Component-specific styles using
.module.cssextension - Barrel export: All components exported through
components/index.js
Pages Structure
Page components represent different routes in the application:Custom Hooks
Reusable logic is extracted into custom hooks:Configuration Files
vite.config.js
Vite configuration with React plugin and path aliases:- React plugin with SWC for faster builds
- Path alias
@→/srcfor cleaner imports
eslint.config.js
ESLint flat config with React-specific rules:- React Hooks rules enforcement
- React Refresh for HMR
- Allows unused vars starting with uppercase (React components)
jsconfig.json
JavaScript compiler configuration for IDE support:package.json
Project metadata and dependencies:File Naming Conventions
Components
- Component files: PascalCase (e.g.,
JobCard.jsx) - Component directories: PascalCase matching component name
- CSS Modules: camelCase or PascalCase with
.module.cssextension
Hooks
- Custom hooks: camelCase starting with
use(e.g.,useFilters.js)
Pages
- Page components: PascalCase (e.g.,
Detail.jsx,Search.jsx) - Special pages: Numeric for error codes (e.g.,
404.jsx)
Styles
- Global styles: kebab-case (e.g.,
index.css) - Module styles: Component name +
.module.css(e.g.,jobCard.module.css)
Import Conventions
Path Aliases
Use the@ alias for cleaner imports from src/:
Component Imports
Components are exported through a barrel file (components/index.js):
Build Output
Build artifacts are generated in thedist/ directory:
- Production-optimized bundles
- Minified JavaScript and CSS
- Static assets with hashed filenames
- Ignored by Git (
.gitignore)
Development vs Production
Development Mode
- Fast HMR (Hot Module Replacement)
- Source maps enabled
- React development warnings
- Run with
npm run dev
Production Build
- Minified and optimized code
- Tree-shaking for smaller bundles
- Asset optimization
- Build with
npm run build, preview withnpm run preview