Production-ready SaaS starter for one-click website security audits using Next.js App Router, Prisma (MongoDB), BullMQ, and a dedicated worker.
- One-click scan request (
POST /api/scan) - Background scanning with BullMQ + Redis
- Modular scanners (headers, SSL, malware patterns, CMS detection, open ports, directory listing)
- Security scoring and plain-language reporting
- Dashboard UI for scan history and reports
- NextAuth foundation for authentication
- Dockerized app + worker + MongoDB + Redis
app/dashboard,app/scan,app/reports/[id],app/login,app/signupapp/api/scan/route.ts,app/api/report/route.ts,app/api/auth/*components/*lib/scanner/*,lib/queue/scanQueue.ts,lib/scoring/riskScore.ts,lib/utils/*prisma/schema.prismaworkers/scanWorker.ts
- Copy env file:
cp .env.example .env(or create.envmanually on Windows)
- Install:
npm install
- Generate Prisma client:
npm run prisma:generate
- Push schema to MongoDB:
npm run prisma:push
- Run web app:
npm run dev
- In another terminal, run worker:
npm run worker
Run full stack:
docker compose up --build
Services:
- Next.js app:
http://localhost:3000 - Redis:
localhost:6379 - MongoDB:
localhost:27017
POST /api/scan
Body:
{
"url": "https://example.com"
}Response:
{
"scanId": "....",
"jobId": "....",
"status": "queued"
}GET /api/report?scanId=<id>
- Add real password hashing (Argon2/Bcrypt) for NextAuth credentials
- Add persistent distributed rate-limit store (Redis-based)
- Restrict worker outbound network and harden OS-level sandboxing for scans
- Keep
nmapand scanner dependencies patched - Add observability (OpenTelemetry + structured logs + alerts)