BHMX - Photography Portfolio & CMSBHMX
Photography Portfolio & CMS

A high-performance, full-stack photography portfolio application built with Next.js and MySQL. This platform combines a stunning, fluid user experience with a powerful administrative backend for seamless gallery and content management.

Hero Section

Hero Section

Lightbox

Lightbox

Images parallax

Images parallax

About me Page

About me Page

Portfolio Banner

Portfolio Banner

About me Section

About me Section

Portfolio page

Portfolio page

Services Page

Services Page

About Section

About Section

login Page

login Page

Project Overview

BHMX Photography Portfolio is a full-stack web application designed for professional photographers to showcase their work and manage client interactions. Built with Next.js, it provides a visually rich, performant public-facing portfolio and a secure administrative dashboard for content management. The platform enables visitors to explore photography collections organized by categories, learn about services offered, and submit contact inquiries—while administrators maintain full control over photos, categories, projects, and incoming messages. Target users include public visitors (potential clients browsing portfolios and making contact) and administrators (photographers managing content and client inquiries).

Tech Stack

Frontend

Next.js
React Framework
Tailwind CSS
Utility-first styling with PostCSS
Material Tailwind
Component library
Framer Motion
Animation library with Motion
Lenis
Smooth scrolling
Headless UI
Accessible components
Heroicons
Icon library with React Icons
yet-another-react-lightbox
Lightbox viewer
react-multi-carousel
Carousel component
Google Fonts
Open Sans via next/font

Backend & Database

Next.js API Routes
Serverless Functions on Node.js
mysql2
MySQL database driver with connection pooling
jsonwebtoken & jose
JWT authentication
bcrypt
Password hashing
Axios
HTTP client with retry logic
formidable
Multipart form parsing
image-size
Image dimension extraction
sanitize-html
Input sanitization
cookie
Cookie handling

Key Features

Dynamic Category Pages: Browse photography collections organized by categories (wedding, commercial, landscape)
Masonry Grid Gallery: Responsive multi-column image layout with hover effects
Lightbox Viewer: Full-screen image viewing with zoom, captions, and keyboard navigation
Image Metadata Display: View photo titles, upload dates, and descriptions
Hero Section: Animated text introduction with rotating call-to-action phrases
Zoom Parallax: Scroll-triggered parallax effect with image transformations
Pictures Banner: Animated banner with rotating showcase images (Fisher-Yates shuffle)
About Section & Page: Introduction to photographer with journey timeline and professional milestones
Services Overview & Page: Detailed photography services with pricing information
Portfolio Highlights: Featured work from various categories
FAQ Section: Service-related questions and answers
Testimonials: Client feedback carousel with dynamic display
Contact Form: Multi-field form (first name, last name, email, phone, message) with validation
Smooth Scrolling: Lenis-powered smooth scroll experience with 60fps performance
Page Transitions: Animated route transitions with fade effects
Responsive Navigation: Mobile hamburger menu with desktop navigation bar
SEO Optimization: Dynamic meta tags, canonical URLs, Open Graph tags, JSON-LD structured data, sitemap.xml, robots.txt

System Flow

1

Public Page Request (SSG/ISR): User navigates → Next.js serves pre-rendered HTML from build cache → Page includes getStaticProps() with revalidation timer (10-60 seconds) → Client hydrates React components → Background regeneration if interval passed → API requests to /api/* endpoints fetch latest data from MySQL → Page re-renders with fresh data → Response served with optimized images (AVIF/WebP)

2

Contact Form Submission: User fills form → Client-side validation (required fields, email format, phone format) → Form data sanitized → POST to /api/contact/add → Server validates inputs (email regex, phone regex) → Message sanitized with sanitize-html → Data inserted into contact_submissions table → Success animation displayed

3

Admin Authentication: User visits /login → Enters credentials → POST to /api/auth/login → Server queries users table → Password compared using bcrypt → JWT token generated (1-hour expiration, HS256) → Token set as HTTP-only, secure, SameSite=Strict cookie → Redirect to /admin dashboard → All admin pages verify token using verifyAuth() middleware

4

Photo Upload: Admin opens Add Picture modal → Fills form with title, category, optional project, description → Selects image file (client-side preview) → Validates file type and size (10MB max) → Submits multipart/form-data to /api/photos/add → verifyAuth() checks JWT → Formidable parses upload → File type validated → Category name sanitized → Directory created: /public/images/[category-name]/ → File renamed with timestamp → Dimensions extracted using image-size → Photo metadata inserted into photos table → Admin UI refreshes

5

Dynamic Category Page Generation: Build time: getStaticPaths() queries all categories → Each category slug generates static page → User visits category page → Next.js serves pre-rendered HTML → Page queries photos by category_id → Photos rendered in masonry grid → User clicks photo → Lightbox opens with zoom → ISR: Page regenerates every 60 seconds if traffic occurs

Benefits

SEO Excellence

Server-side rendering, dynamic meta tags, sitemap, robots.txt, and JSON-LD structured data ensure maximum search visibility and discoverability.

Performance

SSG + ISR delivers near-instant page loads (AVIF/WebP optimization) while keeping content fresh. Connection pooling and caching prevent database overload.

Scalability

Serverless architecture scales automatically with traffic. Efficient database schema and indexed queries support growing portfolios without performance degradation.

Security

JWT authentication, HTTP-only cookies, bcrypt hashing, input sanitization, and parameterized queries provide enterprise-grade security.

Professional Presentation

High-quality animations, smooth scrolling (Lenis), lightbox viewing with zoom, and masonry grids showcase photography work effectively.

User Engagement

Modern design patterns, micro-interactions, page transitions, and responsive layouts keep visitors engaged across all devices.

Content Control

Comprehensive admin dashboard enables photographers to update portfolio, manage categories, moderate testimonials, and handle client inquiries without developer intervention.

Lead Generation

Contact form with client and server-side validation captures inquiries directly. Centralized inbox with read/unread status streamlines client communication.

Developer Experience

Next.js file-based routing, hot reload, built-in API routes, and modular component structure accelerate development and simplify maintenance.

Cost Efficiency

Serverless architecture reduces hosting costs. Static generation minimizes server load. Connection pooling optimizes resource usage.

Mobile Reach

Fully responsive design with mobile-first approach ensures portfolio accessible and beautiful on all devices from phones to desktops.

Error Resilience

Exponential backoff retry logic, comprehensive error handling, timeout management, and graceful degradation ensure reliability.