SafeFront is a frontβend web security toolkit built with React + Vite.
It includes a password strength tool, a suspicious URL inspector, a security headers audit (via API), and an XSS sanitization demo using DOMPurify.
π Live Demo: https://safefront-eight.vercel.app/
- Password Strength Checker β entropy/length/character classes
- URL Inspector β flags punycode, IP hosts, suspicious TLDs, many subdomains, and nonβHTTPS
- Security Headers Audit β backend fetch to site and reports CSP, HSTS, XFO, XβCTO, ReferrerβPolicy, PermissionsβPolicy
- Sanitizer Demo β shows how DOMPurify prevents XSS
- Clean UI β responsive, lightweight
- Frontend: React, Vite, CSS
- Security: DOMPurify
- API: Serverless endpoint on Vercel (
/api/headers) - Hosting: Vercel
safefront/
ββ api/ # Vercel serverless functions
β ββ headers.js # GET /api/headers?url=...
ββ server/ # Local dev Express server (optional)
β ββ index.js
ββ src/
β ββ components/ # UI widgets
β ββ sections/ # Tools pages
β ββ App.jsx
β ββ main.jsx
β ββ index.css
ββ package.json
ββ vite.config.js
ββ index.html
npm install
npm run dev:api # starts local API (optional for dev)
npm run dev # starts Vite (http://localhost:5173)Vite proxies
/apitohttp://localhost:5174during dev (seevite.config.js).
Deployed on Vercel (zero config):
- Build:
npm run build - Output:
dist - API:
api/headers.jsβ/api/headers
Live: https://safefront-eight.vercel.app/
Endpoint
GET /api/headers?url=https://example.com
Response
{
"ok": true,
"url": "https://example.com/",
"status": 200,
"headers": { "content-security-policy": "...", "strict-transport-security": "..." },
"audit": {
"hsts": true,
"csp": true,
"xFrameOptions": true,
"xContentTypeOptions": true,
"referrerPolicy": true,
"permissionsPolicy": false,
"httpsRedirectLikely": true
}
}react/jsx-runtimenot found β ensurereactandreact-domare installed (18.x) and@vitejs/plugin-reactis enabled invite.config.js.- 404 on
/api/headersin prod β file must be at repo root:api/headers.js. - CORS locally β use
npm run dev:api+ Vite proxy (already set).
react vite javascript security web-security http-headers xss dompurify vercel
MIT β see LICENSE.