Introduction
Portfolio Moretto is a modern React-based portfolio website built with a focus on internationalization, clean component architecture, and optimal performance. The application showcases professional experience, skills, and projects through a multilingual interface.Project Structure
The project follows a feature-based folder structure that promotes modularity and maintainability:Components are organized by feature area (Header, Footer, Main, Projects) rather than by type, making it easier to locate and maintain related functionality.
Build Tooling
Vite
The project uses Vite as its build tool and development server, providing fast hot module replacement (HMR) and optimized production builds.vite.config.js
Development
Run
npm run dev to start the Vite development server with instant HMRProduction
Run
npm run build to create an optimized production bundlePostCSS and Autoprefixer
PostCSS processes CSS with Tailwind and automatically adds vendor prefixes for cross-browser compatibility.postcss.config.js
Tailwind CSS
Tailwind CSS provides utility-first styling with a custom configuration for content paths.tailwind.config.js
The content array tells Tailwind which files to scan for class names, enabling tree-shaking to remove unused styles in production.
Component Architecture
Composition Pattern
The application follows a composition-based architecture where components are composed together to build complex UIs from simple, reusable pieces.src/App.jsx
- Header: Navigation bar with language switching
- MainContainer: Main content area with all portfolio sections
- Footer: Copyright and attribution information
Container/Presentational Pattern
The project uses the container/presentational pattern to separate data fetching logic from UI rendering:src/components/Main/MainContainer.jsx
ProjectListContainer) handle:
- Data fetching from Firebase
- State management
- Loading and error states
ProjectList) handle:
- Rendering UI based on props
- User interactions
- Visual styling
State Management
Local State with Hooks
The application uses React’s built-in hooks for state management rather than external libraries like Redux:useState for Component State
useState for Component State
src/components/Header/Header.jsx
useState manages local UI state like menu open/closed status.useEffect for Side Effects
useEffect for Side Effects
src/components/Projects/ProjectListContainer.jsx
useEffect handles asynchronous operations like data fetching, with dependency arrays to control when effects run.The project deliberately avoids complex state management libraries because the state requirements are simple and localized to individual components.
Routing Strategy
Hash-based Navigation
Instead of a client-side router like React Router, Portfolio Moretto uses hash-based navigation with smooth scrolling:src/components/Header/Header.jsx
Benefits
- No additional dependencies
- Simple implementation
- Native browser behavior
- Works without JavaScript
Trade-offs
- Single page only
- No URL-based routing
- Limited to anchor navigation
- No route guards or lazy loading
Application Entry Point
The application initializes through a clear entry point sequence:src/main.jsx
The
i18n.js file is imported before the App component to ensure translations are loaded and initialized before any component attempts to use them.Technology Stack
The project leverages modern web technologies chosen for their performance, developer experience, and production readiness:| Category | Technology | Purpose |
|---|---|---|
| Framework | React 18.2 | UI component library |
| Build Tool | Vite 4.4 | Fast dev server and bundler |
| Styling | Tailwind CSS 3.3 | Utility-first CSS framework |
| i18n | react-i18next 14.0 | Internationalization |
| Backend | Firebase 10.3 | Database and file storage |
| Icons | Bootstrap Icons 1.10 | Icon library |
| Language | JavaScript (ES6+) | Primary programming language |
Performance Considerations
Vite Hot Module Replacement
Instant feedback during development with sub-100ms HMR updates
Tailwind Purging
Removes unused CSS in production, resulting in minimal stylesheet sizes
Component Code Splitting
Components are loaded on demand based on user navigation
Firebase SDK Tree-shaking
Only imports required Firebase modules to reduce bundle size
Next Steps
Components
Dive deep into component hierarchy and composition patterns
Internationalization
Learn how multi-language support is implemented
Getting Started
Set up your development environment
