Skip to main content

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js (v16 or higher)
  • npm or yarn package manager
  • A code editor (VS Code recommended)
  • Git for version control
Check your Node.js version with node --version. The portfolio was built with Node.js v18+.

Installation

1
Clone the Repository
2
First, clone the portfolio repository from GitHub:
3
git clone https://github.com/Ritam369/My_Portfolio.git
cd My_Portfolio
4
Install Dependencies
5
Install all required npm packages:
6
npm install
7
This will install all dependencies defined in package.json, including:
8
  • React 18 and React DOM
  • Vite build tool
  • Tailwind CSS and related plugins
  • Framer Motion for animations
  • EmailJS for contact form
  • React Router DOM for navigation
  • Shadcn/ui components
  • And more…
  • 9
    The installation may take 1-2 minutes depending on your internet connection.
    10
    Configure Environment Variables
    11
    The contact form requires EmailJS credentials. Create a .env file in the root directory:
    12
    VITE_SEVICE_ID=your_emailjs_service_id
    VITE_TEMPLATE_ID=your_emailjs_template_id
    VITE_PUBLIC_KEY=your_emailjs_public_key
    
    13
    Never commit your .env file to version control. It’s already included in .gitignore.
    14
    Getting EmailJS Credentials
    15
  • Visit EmailJS Dashboard
  • Create a free account
  • Set up an email service (Gmail, Outlook, etc.)
  • Create an email template with these variables:
    • from_name - Sender’s name
    • from_email - Sender’s email
    • to_name - Your name (default: “Ritam Saha”)
    • to_email - Your email
    • message - Message content
  • Copy your Service ID, Template ID, and Public Key to .env
  • 16
    Start Development Server
    17
    Run the Vite development server:
    18
    npm run dev
    
    19
    You should see output similar to:
    20
      VITE v5.4.1  ready in 1234 ms
    
      Local:   http://localhost:5173/
      Network: use --host to expose
      press h + enter to show help
    
    21
    Open your browser and navigate to http://localhost:5173/ to see the portfolio running.
    22
    Vite provides instant hot module replacement (HMR). Changes to your code will reflect immediately without full page reloads.

    Available Scripts

    The portfolio includes several npm scripts for development and production:

    Development

    npm run dev
    
    Starts the Vite development server with HMR on http://localhost:5173/

    Build for Production

    npm run build
    
    Creates an optimized production build in the dist/ folder with:
    • Minified JavaScript and CSS
    • Tree-shaken dependencies
    • Optimized assets
    • Source maps

    Preview Production Build

    npm run preview
    
    Locally preview the production build before deployment

    Lint Code

    npm run lint
    
    Runs ESLint to check for code quality issues and potential errors

    Configuration Files

    Understanding key configuration files:

    Vite Configuration

    vite.config.js
    import { defineConfig } from 'vite'
    import react from '@vitejs/plugin-react'
    import path from 'path'
    
    export default defineConfig({
      plugins: [react()],
      resolve: {
        alias: {
          "@": path.resolve(__dirname, "./src"),
        },
      },
    })
    
    The @ alias allows importing from src/ using @/ prefix:
    // Instead of:
    import { Button } from '../../../components/ui/button'
    
    // Use:
    import { Button } from '@/components/ui/button'
    

    Tailwind Configuration

    The tailwind.config.js includes custom theme extensions:
    tailwind.config.js
    export default {
      darkMode: ["class"],
      content: [
        './index.html',
        './src/**/*.{js,ts,jsx,tsx}',
      ],
      theme: {
        extend: {
          colors: {
            navy: {
              50: '#f8fafc',
              100: '#f1f5f9',
              // ... custom color palette
              900: '#0f172a',
            },
          },
          animation: {
            blob: "blob 7s infinite",
            fadeIn: 'fadeIn 0.5s ease-in',
          },
        }
      },
      plugins: [require("tailwindcss-animate")],
    }
    

    Shadcn/ui Configuration

    The components.json configures Shadcn/ui components:
    components.json
    {
      "style": "new-york",
      "rsc": false,
      "tsx": false,
      "tailwind": {
        "config": "tailwind.config.js",
        "baseColor": "stone",
        "cssVariables": true
      },
      "aliases": {
        "components": "@/components",
        "utils": "@/lib/utils",
        "ui": "@/components/ui"
      }
    }
    

    Customization

    Update Personal Information

    Edit src/constants/index.js to customize the portfolio:
    src/constants/index.js
    const words = [
      "Software Developer",
      "Problem Solver",
      "MERN Stack Developer",
      "Context-Prompt Engineer",
    ];
    
    const socialsData = [
      {
        name: "LinkedIn",
        url: "https://www.linkedin.com/in/ritamsaha137",
        icon: "bx bxl-linkedin"
      },
      {
        name: "GitHub",
        url: "https://github.com/Ritam369",
        icon: "bx bxl-github"
      },
      // Add more social links...
    ];
    
    const navLinks = [
      { id: "skills", title: "Skills" },
      { id: "education", title: "Education" },
      { id: "projects", title: "Projects" },
      { id: "contact", title: "Contact" },
    ];
    
    const services = [
      {
        title: "Problem Solving & Algorithms",
        icon: Computational,
        description: "Expert in data structures and algorithms..."
      },
      // Add more services...
    ];
    
    const techStack = [
      "C", "Java", "html", "css", "js", "nodejs", 
      "Expressjs", "React", "Tailwind", "Mysql", "Mongodb"
    ].map(name => ({
      name,
      imageUrl: `https://go-skill-icons.vercel.app/api/icons?i=${name.toLowerCase()}`
    }));
    
    const Email = "[email protected]";
    

    Modify Theme Colors

    Adjust colors in tailwind.config.js to match your brand:
    colors: {
      // Change primary color scheme
      primary: "#0f172a",
      secondary: "#64748b",
      tertiary: "#f1f5f9",
    }
    

    Replace Profile Picture

    Replace public/My_pic.jpg with your own profile picture. The Hero component will automatically use it:
    src/components/Hero.jsx
    <img 
      src="My_pic.jpg" 
      alt="My Picture" 
      className="relative w-56 sm:w-64 md:w-80 rounded-full..." 
    />
    

    Common Issues

    Port Already in Use

    If port 5173 is already in use, Vite will automatically try the next available port. You can specify a different port:
    npm run dev -- --port 3000
    

    EmailJS Not Working

    Verify your .env variables are correctly named:
    • VITE_SEVICE_ID (note: typo exists in source code)
    • VITE_TEMPLATE_ID
    • VITE_PUBLIC_KEY
    All Vite environment variables must start with VITE_ prefix.

    Build Errors

    Clear the cache and reinstall dependencies:
    rm -rf node_modules package-lock.json
    npm install
    npm run build
    

    Next Steps

    Now that your portfolio is running locally:
    1. Customize the content in src/constants/index.js
    2. Update your profile picture and assets
    3. Configure EmailJS for the contact form
    4. Modify the theme colors to match your brand
    5. Add your projects and work experience
    6. Test on different devices and screen sizes
    7. Build and deploy to production
    The portfolio is optimized for deployment on platforms like Vercel, Netlify, or GitHub Pages.

    Build docs developers (and LLMs) love