Skip to content

ggauravky/Dev-Portfolio

Gaurav Kumar Yadav - Developer Portfolio

Production portfolio for Gaurav Kumar Yadav, focused on Python, AI/ML, and full-stack development.

Live URLs

Stack

Frontend:

  • React 18 + Vite
  • Tailwind CSS
  • Framer Motion
  • React Router

Backend:

  • Node.js + Express
  • MongoDB + Mongoose
  • Gemini API integration
  • Security middleware (Helmet, rate-limit, mongo-sanitize, validators)

Observability:

  • pino structured logs
  • Request IDs on every request
  • Optional Sentry error monitoring

Architecture

Monorepo layout:

  • src/: React app (pages, components, hooks, utilities)
  • backend/: Express API and Mongo models
  • api/: Vercel serverless handlers
  • shared/: shared chatbot core + privacy utilities
  • public/: static assets, robots, sitemap
  • scripts/: build-time utilities (sitemap, data sync, image variants)

Chatbot logic is centralized in shared modules and reused by backend and serverless entrypoints.

Features

  • Multi-page portfolio (home/about/skills/projects/blog/contact/links)
  • AI chatbot with fallback logic and chat analytics
  • Contact + newsletter APIs
  • Project and blog detail pages with SEO metadata
  • Responsive image pipeline with AVIF/WebP variants + srcset
  • Build-time sitemap generation for static + blog + project routes

Local Development

Prerequisites:

  • Node.js 18+
  • npm 9+
  • MongoDB Atlas connection string

Install:

npm install
cd backend
npm install
cd ..

Run frontend:

npm run dev

Run backend:

cd backend
npm run dev

Environment Variables

Root .env:

VITE_API_URL=http://localhost:5000

Backend .env:

MONGODB_URI=your_mongodb_connection_string
PORT=5000
PORT_RETRIES=10
NODE_ENV=development
FRONTEND_URL=http://localhost:5173

# Chatbot
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-2.0-flash

# Chat analytics privacy
CHATLOG_RETENTION_DAYS=60
CHAT_HASH_SALT=replace_with_strong_random_secret

# Admin/API security
ADMIN_KEY=replace_with_secure_admin_key
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=5
CHAT_RATE_LIMIT_MAX=30

# Observability (optional)
LOG_LEVEL=debug
SENTRY_DSN=
SENTRY_TRACES_SAMPLE_RATE=0.1

Build and Production

Build command:

npm run build

Build pipeline includes:

  1. Sync chat data
  2. Generate responsive image variants
  3. Generate sitemap
  4. Vite production build

Preview build:

npm run preview

Deployment Flow

Frontend (Vercel):

  1. Import repository in Vercel
  2. Set root env vars (VITE_API_URL)
  3. Deploy from main branch

Backend (Render):

  1. Create Web Service from backend directory
  2. Build command: npm install
  3. Start command: node server.js
  4. Add backend env vars from section above

API Endpoints (Core)

  • GET /health
  • POST /api/contact
  • POST /api/newsletter/subscribe
  • POST /api/newsletter/unsubscribe
  • POST /api/chat
  • GET /api/chat/privacy-policy

SEO and Indexing

Image Performance Strategy

  • Source images: public/images/projects and public/images/blogs
  • Generated variants: 480, 768, 1200 widths
  • Formats: AVIF, WebP, and fallback originals
  • Runtime delivery: LazyImage component with picture + srcset + sizes

Generate variants manually:

npm run generate:image-variants

Security Notes

  • Proprietary project (not open source for reuse)
  • Chat analytics store hashed network identifiers, not raw IP/user-agent
  • MongoDB TTL automatically expires chat logs (30 to 90 day window)

See:

License

Copyright (c) 2026 Gaurav Kumar Yadav. All rights reserved.

About

Personal developer portfolio built with React, Vite, and Tailwind CSS to showcase projects, skills, and learning journey.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors