Overview
The SAAC Frontend follows the standard Vite + React + TypeScript structure, optimized for modern web development with minimal configuration.Directory Tree
Key Directories
src/
src/
The main source code directory containing all your application code.Key files:
main.tsx- Application entry point that renders the root componentApp.tsx- Main application componentindex.css- Global styles applied to the entire applicationApp.css- Component-specific stylesvite-env.d.ts- TypeScript definitions for Vite features
assets/- Images, fonts, and other static resources imported in your code
public/
public/
Static files served directly without processing. Files here are accessible at the root URL.Usage:
- Favicon and app icons
robots.txtandsitemap.xml- Static assets that don’t need processing
public/files are copied as-is to the build outputsrc/assets/files are processed by Vite (optimization, hash names, etc.)
Configuration Files
vite.config.ts
Vite build tool configuration with React and Tailwind plugins
tsconfig.json
TypeScript project references configuration
tsconfig.app.json
TypeScript compiler options for application code
eslint.config.js
Code linting rules and configuration
Vite Configuration
vite.config.ts
The
@vitejs/plugin-react-swc uses SWC instead of Babel for faster builds and Hot Module Replacement.TypeScript Configuration
The project uses TypeScript project references with three config files:- tsconfig.json
- tsconfig.app.json
Root configuration that references other configs:
tsconfig.json
Entry Points
src/App.tsx
Main application component (see Components for details)
Adding New Files
Creating Components
Adding Assets
- Processed Assets (src/assets/)
- Static Assets (public/)
For images and files imported in your code:Vite will optimize and hash these files.
Best Practices
Component Organization
- Group related components in folders
- Keep component and styles together
- Use index files for cleaner imports
Asset Management
- Use
src/assets/for imported resources - Use
public/for static files - Optimize images before adding
Type Safety
- Define TypeScript interfaces in component files
- Create shared types in
src/types/ - Use strict TypeScript settings
Code Quality
- Follow ESLint recommendations
- Use consistent naming conventions
- Keep components focused and small
The project uses React 19 and TypeScript 5.8 with strict type checking enabled. This ensures type safety and catches errors early.
