Skip to content

Repository files navigation


VersionPlatformLicensePRs

JavaScriptNetlify FunctionsJWT AuthWebCam


Gate. Capture. Redirect. A serverless visual security gateway that logs visitors with camera evidence before granting access to protected resources.


🔍 What Is CameraGPT?

CameraGPT (Secure Gateway Portal) is a consent-based, serverless visitor verification layer. It sits in front of any protected link — visitors must pass through the gateway, approve camera access, and get logged with photographic evidence before being redirected to the protected destination.

Built entirely on Netlify's serverless stack — zero backend servers, zero infrastructure management.

[Visitor] → [Public Gateway Link]
│
▼
┌─────────────────────────┐
│ Camera Consent Prompt │ ← Consent-based image capture
│ Image Evidence Stored │ ← Netlify Blobs (serverless storage)
│ Metadata Logged │ ← IP, timestamp, user agent
└──────────┬──────────────┘
│
┌──────────▼──────────────┐
│ Redirect to Protected │ ← Only after successful log
│ Destination │
└─────────────────────────┘
│
[Admin Console] → View evidence, manage profiles, review logs

✨ Key Features

FeatureDescription
📸 Consent-Based CaptureVisitor explicitly approves camera before capture occurs
🔐 JWT-Secured AdminAdmin console protected with token-based authentication
🗂️ Profile-Based LinksEach gateway profile generates a unique public URL
🖼️ Image Evidence VaultCaptured images stored in Netlify Blobs, viewable in admin
📊 Access Log TrackingCapture success/failure + redirect status per visit
☁️ Zero-Server Deployment100% Netlify Functions — no VPS, no Docker, no DB
🔄 Redirect ControlConfigurable per-profile destination URLs
👁️ Visitor VerifySecondary verification flow for sensitive destinations

⚡ Quick Start

1 — Clone & Install

git clone https://github.com/gnonymous1/CameraGPT.git
cd CameraGPT
npm install

2 — Configure Environment

cp .env.example .env
# Fill in your values — see .env.example for all variables

3 — Deploy to Netlify

# Install Netlify CLI
npm install -g netlify-cli
# Link to your Netlify site
netlify link
# Deploy
netlify deploy --prod

Set these environment variables in your Netlify dashboard → Site Settings → Environment Variables:

VariableRequiredPurpose
JWT_SECRETSigns admin session tokens
ADMIN_EMAILAdmin login email
ADMIN_PASSWORDAdmin login password

⚠️ Never commit .env to version control. Use .env.example as your template.

4 — Access the Portal

URLPurpose
/Admin console — manage profiles, view evidence
/gateway/main-gatewayPublic gateway entry point

🏗️ Architecture

CameraGPT/
│
├── 📄 index.html Admin console UI
├── 📄 public-attendance.html Public gateway page shell
├── 📄 visitor-verify.html Visitor verification page
│
├── ⚙️ script.js Admin console logic
├── ⚙️ public-attendance.js Capture & redirect flow
├── ⚙️ visitor-verify.js Verification logic
├── ⚙️ face-recognition.js Camera access & capture
│
├── netlify/
│ └── functions/
│ └── 🔧 api.mjs Serverless API (JWT, Blobs, profiles)
│
├── 🎨 styles.css UI styling
├── 📋 netlify.toml Netlify routing config
├── 📋 _redirects URL redirect rules
└── 🔐 .env.example Environment variable template

🔒 Security

  • All admin routes protected by JWT authentication
  • Camera capture only occurs after explicit visitor consent
  • Credentials configured via environment variables only — never hardcoded
  • Image evidence stored in Netlify Blobs — not on public filesystem
  • JWT_SECRET should be a cryptographically random 256-bit string

Changing Default Credentials

⚠️Change the default password before any production deployment.

Set ADMIN_EMAIL and ADMIN_PASSWORD in Netlify environment variables. If ADMIN_PASSWORD is not set, the system uses the fallback Admin@12345never leave this in production.

# Generate a strong JWT secret
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

🛠️ Local Development

# Start local Netlify dev server
netlify dev
# Admin console available at:# http://localhost:8888/# Public gateway at:# http://localhost:8888/gateway/main-gateway

🗺️ Roadmap

  • Multi-admin role support
  • Email notifications on visitor capture
  • Rate limiting on gateway endpoints
  • Analytics dashboard for capture metrics
  • Time-limited gateway links (expiry)
  • Webhook integration for capture events

🤝 Contributing

git checkout -b feature/your-feature
# Make changes, test with netlify dev
git commit -m "feat: your feature"# Open a Pull Request

Read CONTRIBUTING.md for full guidelines.


⚖️ Legal & Ethics

CameraGPT is designed for authorized, consent-based visitor logging only. Camera capture occurs only after explicit visitor approval. This tool must not be used to capture images of individuals without their knowledge or consent. The developer assumes no liability for misuse.


About

📷 AI-powered serverless visitor management system — Netlify serverless, webcam photo capture, face detection, secure visitor logs

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages