Overview
Portfolio Moretto is built with React, Vite, and Tailwind CSS, providing a modern and fast development experience. This guide will walk you through the complete setup process.Prerequisites
Before you begin, ensure you have the following installed:Node.js
Version 18.x or higher recommended
npm
Comes bundled with Node.js
Installation
Install dependencies
Install all required packages using npm:This will install the following key dependencies:
- React 18.2.0 - Core UI library
- Vite 4.4.5 - Build tool and dev server
- Firebase 10.3.1 - Backend services
- Tailwind CSS 3.3.3 - Utility-first CSS framework
- i18next - Internationalization framework
- Sass 1.66.1 - CSS preprocessor
Project Structure
Understanding the project structure will help you navigate and contribute effectively:Key Directories
src/components/
src/components/
Contains all React components organized by feature:
- db/ - Firebase database and storage utilities
- Main/ - Core sections (Hero, About, Skills, Contact, etc.)
- Projects/ - Project listing and display components
- Header/ and Footer/ - Layout components
- dictionaries/ - Translation files for i18next (es.json, en.json)
public/
public/
Static assets that are served directly:
- Images (favicon, project screenshots)
- Other static files
Development Scripts
The project includes several npm scripts defined inpackage.json for common tasks:
Start Development Server
Run the Vite development server with hot module replacement:http://localhost:5173 by default. Changes to your code will automatically reload the browser.
Vite’s dev server is extremely fast thanks to native ES modules and esbuild-powered HMR.
Build for Production
Create an optimized production build:- Bundles all code with Vite
- Optimizes assets (minification, tree-shaking)
- Outputs to the
dist/directory - Generates production-ready static files
Preview Production Build
Preview the production build locally before deployment:dist/ directory to verify the production build works correctly.
Lint Code
Run ESLint to check for code quality issues:.eslintrc.cjs to check JavaScript and JSX files.
Vite Configuration
The project uses a minimal Vite configuration located invite.config.js:
vite.config.js
- Enables React Fast Refresh for instant feedback
- Uses JSX transformation for React components
- Leverages Vite’s default optimizations
Code Quality & Linting
The project uses ESLint with React-specific rules to maintain code quality:.eslintrc.cjs
ESLint Configuration Breakdown
- extends: Uses recommended rulesets for React and hooks
- react/jsx-runtime: Supports new JSX transform (no need to import React)
- react-refresh plugin: Warns about Fast Refresh compatibility issues
- Target: ES2020 features in browser environment
Entry Points
HTML Entry (index.html)
The main HTML file serves as the application shell:
index.html
JavaScript Entry (src/main.jsx)
The main.jsx file bootstraps the React application:
src/main.jsx
- Imports i18n configuration before App
- Imports global CSS with Tailwind directives
- Renders App component to the root element
- React.StrictMode is commented out
Internationalization
The project supports multiple languages using i18next. Configuration is insrc/i18n.js:
src/i18n.js
- Default language: Spanish (
es) - Translations stored in
src/components/dictionaries/ - Debug mode enabled for development
Next Steps
Styling Guide
Learn about Tailwind CSS setup and custom styling
Firebase Integration
Configure Firebase for data storage and images
Architecture
Understand the application architecture
Customization
Customize content and translations
