A complete Full-Stack MERN application for photographers to securely manage and deliver media galleries (images and videos).
https://photo-gallery.keinar.com
This project provides a self-hosted, professional platform for photographers to deliver client galleries with secure access, cloud media (images and video) hosting, and an admin dashboard.
- Secure Admin Authentication: Protected routes using JWT and bcrypt.js.
- Gallery Management: Create, update, and delete galleries with unique secret links.
- Cloud Storage: Automated integration with Cloudinary for efficient image and video hosting.
- Bulk Uploads: Drag-and-drop upload with visual progress bar. Supports concurrent uploads for speed.
- Lightbox View: Full-screen immersive viewing experience for images and videos.
- Download All: Generates a ZIP file on-the-fly containing all gallery assets.
- Responsive Design: Built with React and Tailwind CSS for mobile and desktop.
- Production Ready: Optimized for cPanel/Node.js environments with static file serving.
- Frontend: React, React Router, Tailwind CSS, React Toastify, Axios, Vite
- Backend: Node.js, Express.js
- Database: MongoDB (Mongoose)
- Storage: Cloudinary
- Deployment: Optimized for cPanel (Node.js Selector)
- Node.js (v18+ recommended)
- MongoDB Atlas or local MongoDB
- Cloudinary account
git clone https://github.com/keinar/photographer-gallery.git
cd photographer-gallerycd backend
npm installCreate a .env file in the backend directory:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_key
CLOUDINARY_API_SECRET=your_cloudinary_secret
PORT=5001Run the backend:
npm run devOpen a new terminal:
cd frontend
npm install
npm run devFrontend runs at: http://localhost:5173
This project is configured to serve the frontend directly from the backend server.
On your local machine, navigate to the frontend folder and build the React app:
cd frontend
npm run buildThis creates a dist folder.
- On your cPanel File Manager, inside your application root, create a
folder named
publicinside thebackenddirectory (backend/public). - Copy all contents from your local
frontend/distfolder into the server'sbackend/publicfolder.- Note: The
index.htmlshould be directly insidebackend/public.
- Note: The
- Upload the
backendfolder to your server. - Ensure
server.jsis the application startup file. - Run
npm installin the cPanel Node.js app interface. - Add your Environment Variables (MONGO_URI, CLOUDINARY_*, etc.) in the cPanel interface.
Restart the Node.js application via cPanel. The app handles SPA routing automatically.
- Upload Limits: The system supports uploading up to 20 files at once.
- Server Timeout: The server timeout is set to 5 minutes (300,000ms) to handle large video uploads without connection drops.
- Max File Size: Controlled by Cloudinary and server limits.
- 503 Error on Startup: Check
stderr.log. Usually indicates a DB connection failure (wrong IP/credentials) or missing Environment Variables. - Page Not Found / White Screen: Ensure the frontend build files
are correctly placed in
backend/publicand notbackend/public/dist. - Upload Failed: Check your internet connection or reduce the number of files if uploading very large videos.
Contributions, bug reports, and feature requests are welcome. Please open an issue or PR on the repository.
