Open-source AI-powered passport photo studio
Upload β Auto-process β Generate a print-ready sheet β in seconds.
SnapPass AI is a free, open-source web application that lets anyone generate professional passport-quality photos from any selfie or portrait.
No expensive studio. No complicated software. Just upload, click, and print.
| Step | Description |
|---|---|
| π€ Upload | Drag & drop or browse any portrait photo |
| π§ AI Process | Background removal, face centering, DPI optimisation |
| π Customise | Choose country standard (India, USA, UK, Schengenβ¦) |
| π¨οΈ Print | Download a print-ready A4 sheet with multiple photos |
β οΈ This project is in active early development. The frontend scaffold is complete and functional. The backend and Python AI service stubs are ready for contributors to build on.
| Layer | Status |
|---|---|
| Frontend (React) | β Scaffold complete β fully navigable |
| Backend (Express) | π‘ Scaffold ready β needs controller logic |
| Python AI Service | π‘ Structure ready β needs OpenCV / rembg logic |
| Database (MongoDB) | π² Structure planned β not yet implemented |
| Layer | Technology |
|---|---|
| Frontend | React.js, React Router DOM, Vanilla CSS |
| Backend | Node.js, Express.js, Multer |
| AI Microservice | Python, Flask, OpenCV, Pillow, rembg |
| Database (planned) | MongoDB |
snappass-ai/
β
βββ frontend/ # React.js web app
β βββ src/
β βββ components/
β β βββ layout/
β β β βββ Navbar.js # Top navigation bar
β β β βββ Footer.js # Site footer
β β βββ UploadBox.js # Drag-and-drop upload
β β βββ PhotoPreview.js # Before/after photo viewer
β β βββ BackgroundSelector.js # BG colour picker
β β βββ SizeSelector.js # Country preset dropdown
β β βββ QuantityInput.js # Number of photos stepper
β β βββ PrintButton.js # Download/print CTA
β β βββ LoadingSpinner.js # Reusable spinner
β βββ pages/
β β βββ HomePage.js # Landing page
β β βββ UploadPage.js # Step 1 β upload
β β βββ EditorPage.js # Step 2 β AI editor
β β βββ PrintPreviewPage.js # Step 3 β preview & print
β β βββ AdminDashboard.js # Admin panel
β βββ hooks/
β β βββ usePhotoUpload.js # Upload state management
β β βββ useImageProcessor.js # AI processing state
β βββ services/
β β βββ api.js # Axios base instance
β β βββ photoService.js # All photo API calls
β βββ utils/
β β βββ fileValidation.js # Client-side validation
β β βββ formatters.js # String/number formatting
β βββ routes/
β βββ AppRoutes.js # Central route config
β
βββ backend/ # Express.js REST API
β βββ src/
β βββ config/app.config.js
β βββ controllers/
β β βββ upload.controller.js
β β βββ image.controller.js
β β βββ print.controller.js
β βββ routes/
β β βββ upload.routes.js
β β βββ image.routes.js
β β βββ print.routes.js
β βββ middlewares/
β βββ upload.middleware.js
β βββ error.middleware.js
β βββ validate.middleware.js
β
βββ python-ai-service/ # Python Flask AI microservice
βββ app/
β βββ services/
β βββ bg_remove.py # rembg background removal
β βββ face_center.py # OpenCV face detection
β βββ dpi_optimizer.py # DPI resize logic
β βββ sheet_generator.py # A4 sheet layout
βββ requirements.txt
Make sure you have these installed:
git clone https://github.com/souma9830/SnapPass-AI.git
cd SnapPass-AIcd frontend
npm install
npm startOpen http://localhost:3000 in your browser.
cd backend
npm install
npm run devBackend runs at http://localhost:5000.
Health check: GET http://localhost:5000/health
cd python-ai-service
pip install -r requirements.txt
python main.pyAI service runs at http://localhost:8000.
Home
βββ /upload (Upload your photo)
βββ /editor (Choose background + size β AI process)
βββ /print-preview (Set quantity β Download A4 sheet)
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/upload |
Upload photo |
GET |
/api/upload/:id |
Get upload metadata |
POST |
/api/process |
AI process photo |
GET |
/api/process/preview/:filename |
Get processed preview |
POST |
/api/print/generate-sheet |
Generate A4 print sheet |
GET |
/api/print/presets |
List size presets |
GET |
/health |
Backend health check |
| Preset ID | Standard | Dimensions |
|---|---|---|
35x45 |
India / UK Passport | 35 Γ 45 mm |
51x51 |
USA Visa | 51 Γ 51 mm |
33x48 |
Schengen Visa | 33 Γ 48 mm |
40x60 |
China Visa | 40 Γ 60 mm |
2x2in |
US Passport | 2 Γ 2 inches |
REACT_APP_API_URL=http://localhost:5000/apiPORT=5000
NODE_ENV=development
AI_SERVICE_URL=http://localhost:8000
UPLOAD_DIR=uploads
MAX_FILE_SIZE=10485760
CORS_ORIGIN=http://localhost:3000- React frontend scaffold with all pages & components
- Express backend scaffold with all routes & controllers
- Python AI service structure
- Background removal using
rembg - Face detection & auto-centering using OpenCV
- DPI optimisation & resize to standard dimensions
- A4 print sheet generation using Pillow
- MongoDB database integration
- User session & upload history
- Real-time image preview after AI processing
- Admin dashboard with live statistics
- Multi-file batch upload support
- Docker Compose setup
- CI/CD pipeline
- Deploy guide (Vercel + Render + Railway)
- PWA support
- Dark mode
We β€οΈ contributions! Whether you're fixing bugs, building features, improving docs, or designing UI elements β every contribution matters.
π Read the full guide: CONTRIBUTING.md
Quick summary:
- Fork the repo
- Create a branch:
git checkout -b feature/your-feature-name - Make your changes
- Open a Pull Request to
master
New to open source? Look for issues tagged:
good first issueβ small, well-defined taskshelp wantedβ features awaiting a contributordocumentationβ improve docs and comments
This project is licensed under the MIT License β see LICENSE for details.
You are free to use, modify, and distribute this project for both personal and commercial use.
Soumadeep β @souma9830
β If you find this useful, please star the repository β it helps others discover the project!
β Star on GitHub Β· π Report a Bug Β· π‘ Request a Feature