This is a React 18 + TypeScript + Vite application with comprehensive development tooling and optimization features.
- Node.js: Version 22.17.1 (use
.nvmrcfile) - npm: Version 10+ (comes with Node.js)
# Clone the repository
git clone <repository-url>
cd techlabs_mvp
# Use correct Node.js version (if using nvm)
nvm use
# Install dependencies
npm install
# Start development server
npm run dev# Development server with hot reload
npm run dev
# Development server exposed to network
npm run dev:host
# Run tests in watch mode
npm run test
# Run linting and type checking
npm run check
# Fix linting and formatting issues
npm run check:fixtechlabs_mvp/
├── .editorconfig # Editor consistency settings
├── .env.example # Environment variables template
├── .gitignore # Git ignore patterns
├── .lintstagedrc.cjs # Lint-staged configuration
├── .nvmrc # Node.js version specification
├── .prettierignore # Prettier ignore patterns
├── .prettierrc.json # Prettier formatting rules
├── commitlint.config.js # Commit message linting
├── eslint.config.mjs # ESLint configuration
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript root configuration
├── tsconfig.app.json # App TypeScript configuration
├── tsconfig.node.json # Node.js TypeScript configuration
├── tsconfig.test.json # Test TypeScript configuration
├── vite.config.ts # Vite build configuration
src/
├── components/ # Shared UI components
│ ├── Buttons/ # Button components
│ ├── Forms/ # Form components
│ ├── Layouts/ # Layout components
│ └── Popups/ # Modal and popup components
├── features/ # Feature-based modules
│ ├── about/ # About page feature
│ ├── events/ # Events feature
│ ├── home/ # Home page feature
│ ├── partners/ # Partners feature
│ ├── stories/ # Stories feature
│ └── tracks/ # Learning tracks feature
├── hooks/ # Custom React hooks
├── utils/ # Utility functions
├── theme/ # MUI theme configuration
├── config/ # App configuration
├── contexts/ # React contexts
├── styles/ # Global styles
├── assets/ # Static assets
├── mocks/ # Mock data for development
└── test/ # Test utilities and setup
Copy .env.example to .env and configure:
# Copy environment template
cp .env.example .env
# Edit with your settings
nano .envNODE_ENV: Environment mode (development/production)VITE_APP_NAME: Application nameVITE_APP_VERSION: Application versionVITE_ENABLE_PERFORMANCE_MONITORING: Enable performance trackingVITE_ENABLE_DEBUG_MODE: Enable debug featuresVITE_HMR_PORT: Hot Module Replacement portVITE_HMR_HOST: Hot Module Replacement host
- ESLint: Comprehensive linting with TypeScript, React, and accessibility rules
- Prettier: Code formatting with consistent style
- TypeScript: Strict type checking with modern configuration
- Commitlint: Conventional commit message validation
- Jest
- Bundle Analyzer: Analyze bundle size and composition
- Lighthouse: Performance auditing and optimization
- Web Vitals: Core Web Vitals monitoring
npm run dev # Start development server
npm run dev:host # Start dev server accessible to network
npm run dev:debug # Start with debug mode enabled
npm run dev:no-hmr # Start without hot module replacementnpm run build # Production build
npm run build:analyze # Build with bundle analysis
npm run build:clean # Clean and rebuild
npm run preview # Preview production build
npm run analyze # View bundle analyzernpm run test # Run tests in watch mode
npm run test:run # Run tests once
npm run test:ui # Run tests with UI
npm run test:coverage # Run tests with coverage report
npm run test:watch # Run tests in watch modenpm run lint # Check for linting errors
npm run lint:fix # Fix linting errors automatically
npm run format # Check code formatting
npm run format:fix # Fix formatting automatically
npm run typecheck # Check TypeScript types
npm run typecheck:watch # Watch mode type checkingnpm run lighthouse # Run Lighthouse audit
npm run lighthouse:ci # Run Lighthouse for CI
npm run performance # Full performance auditnpm run clean # Clean build artifacts
npm run unimported # Find unused imports
npm run check # Run all quality checks
npm run check:fix # Fix all auto-fixable issues
npm run check:all # Run all checks including coverageAutomated quality checks run before each commit:
- Lint-staged: Lint and format only staged files
- Type checking: Ensure TypeScript compiles
- Unit tests: Run test suite
- Security checks: Basic security validation
Use conventional commits:
type(scope): description
feat(auth): add user authentication
fix(ui): resolve button styling issue
docs(setup): update installation guide
test(utils): add unit tests for date helpers
EMFILE errors during testing:
- Tests are configured to run sequentially to prevent file handle issues
- If you still encounter issues, try
npm run test:runinstead ofnpm run test
HMR not working:
- Check if ports 3000 and 24678 are available
- Try
npm run dev:debugfor more verbose output
TypeScript errors:
- Run
npm run typecheckto see all type errors - Check if all dependencies are installed:
npm install
Build failures:
- Clear cache:
npm run clean - Rebuild:
npm run build:clean
Slow development server:
- Check if you have many large files in the project
- Try
npm run dev:no-hmrto disable hot reloading
Large bundle size:
- Run
npm run build:analyzeto see bundle composition - Check for unused dependencies:
npm run unimported
- TypeScript: Built-in TypeScript support
- ESLint: Real-time linting
- Prettier: Code formatting
- Vite: Vite integration
- Thunder Client: API testing (if needed)
Add to .vscode/settings.json:
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.preferences.importModuleSpecifier": "relative"
}# Clean build
npm run build:clean
# Verify build
npm run preview
# Run performance audit
npm run performanceEnsure these environment variables are set:
NODE_ENV=production
VITE_APP_NAME="TechLabs MVP"
VITE_APP_VERSION="1.0.0"
VITE_ENABLE_PERFORMANCE_MONITORING=true- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes following the coding standards
- Run quality checks:
npm run check:all - Commit your changes:
git commit -m "feat: add amazing feature" - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- File size limit: 220 lines per file
- No classes: Use function components and hooks
- Strict TypeScript: No
anytypes allowed - Named exports: Prefer named over default exports
- Accessibility: Follow WCAG 2.1 AA guidelines
For issues and questions:
- Check this documentation first
- Review the troubleshooting section
- Check existing GitHub issues
- Create a new issue with detailed reproduction steps
- Lighthouse Performance: Score ≥ 90
- First Contentful Paint: < 1.8s
- Largest Contentful Paint: < 2.5s
- Cumulative Layout Shift: < 0.1
- Bundle Size: Optimized for fast loading