Installation Overview
VulnTrack is a Next.js 14 application with a PostgreSQL database. This guide covers local development setup and deployment considerations.Prerequisites: Node.js 20+, PostgreSQL 14+, and a terminal with git installed.
Quick Install
Install Dependencies
VulnTrack uses npm as the package manager:This installs the core dependencies from
package.json:Framework:[email protected]- Next.js framework[email protected]- React librarytypescript@5- TypeScript support
@prisma/[email protected]- Prisma ORM[email protected]- Prisma CLI (dev dependency)
[email protected]- NextAuth.js@next-auth/[email protected]- Prisma adapter[email protected]- Password hashing
@radix-ui/react-*- Headless UI components[email protected]- Utility-first CSS[email protected]- Icon library
[email protected]- Schema validation[email protected]- Form handling[email protected]- PDF generation[email protected]- Markdown rendering
The
postinstall script in package.json automatically runs prisma generate after installation.Configure Environment Variables
Create a Add the following configuration:
.env file in the project root:.env
Environment Variable Details
DATABASE_URL (Required)
DATABASE_URL (Required)
PostgreSQL connection string format:Local Development:Production (example with SSL):
NEXTAUTH_SECRET (Required)
NEXTAUTH_SECRET (Required)
Used to encrypt session tokens. Generate a secure random string:Example output:Use this value as your
NEXTAUTH_SECRET.VULNCHECK_API_KEY (Optional)
VULNCHECK_API_KEY (Optional)
Enables enhanced CVE data fetching from VulnCheck.Benefits:
- Faster CVE lookups
- Real-time KEV (Known Exploited Vulnerabilities) detection
- More comprehensive metadata
- Sign up at vulncheck.com
- Navigate to API Keys section
- Generate a new key
- Add to
.env:VULNCHECK_API_KEY="vc_xxxxx"
src/app/actions/cve.ts).RESEND_API_KEY (Optional)
RESEND_API_KEY (Optional)
Enables email notifications for vulnerability assignments.Setup:
- Create account at resend.com
- Add and verify your domain
- Generate API key
- Configure:
src/app/actions/vulnerabilities.ts):- Vulnerability assignment
- Status changes (if configured)
- Team invitations
Without this configuration, the app works but email notifications are disabled.
Set Up PostgreSQL Database
VulnTrack requires PostgreSQL 14 or higher.Verify connection:
Option 1: Local PostgreSQL Installation
Option 2: Docker Container
Run PostgreSQL in Docker for isolated development:Option 3: Cloud Database
Use a managed PostgreSQL service:Providers:- Supabase - Free tier with 500MB
- Neon - Serverless Postgres
- Railway - $5/month starter
- Render - Free tier available
DATABASE_URL in .env with the connection string.Initialize the Database Schema
VulnTrack uses Prisma for database management. The schema is defined in This creates the TypeScript types and Prisma Client based on your schema.This command:This opens a web interface at
prisma/schema.prisma.Generate Prisma Client
Push Schema to Database
- Creates all tables defined in
schema.prisma - Sets up relationships and constraints
- Enables full-text search indexes
Key Schema Features
Fromprisma/schema.prisma:Verify Database Schema
Open Prisma Studio to inspect your database:http://localhost:5555 where you can:- View all tables
- Browse records
- Edit data manually (useful for testing)
Seed Initial Data (Optional)
Optionally seed the database with sample data for testing.Check if a seed script exists:If available, run:This typically creates:
- Sample admin user
- Demo team
- Example vulnerabilities
- Test DREAD/STRIDE scores
Start the Development Server
Launch VulnTrack locally:The application starts on Navigate to
Solutions:
Solution:
Solution:
http://localhost:3000.What happens on startup:- Next.js compiles React components
- Prisma Client connects to PostgreSQL
- NextAuth.js initializes session management
- API routes become available at
/api/*
Verify Installation
You should see:http://localhost:3000 to see the landing page.Common Startup Issues
Database Connection Error
Database Connection Error
- Verify PostgreSQL is running:
pg_isready - Check
DATABASE_URLformat in.env - Test connection:
psql $DATABASE_URL - Ensure database exists:
createdb vulntrack
Prisma Client Not Generated
Prisma Client Not Generated
Port Already in Use
Port Already in Use
Production Deployment
VulnTrack can be deployed to any platform supporting Next.js 14.Build for Production
package.json, this runs:
Start Production Server
Deployment Platforms
Vercel
Best for: Quick deploymentsConfigure environment variables in Vercel dashboard.
Docker
Best for: Self-hosted environments
Railway
Best for: Full-stack deployments
- Connect GitHub repo
- Railway auto-provisions PostgreSQL
- Configure environment variables
- Deploy with one click
DigitalOcean App Platform
Best for: Scalable deployments
- Create new app from GitHub
- Attach managed PostgreSQL
- Set environment variables
- Configure build command:
npm run build
Production Checklist
Security Configuration
- Set strong
NEXTAUTH_SECRET - Enable HTTPS/SSL
- Configure CORS if using API
- Set secure cookie flags
- Restrict database access to app server only
Database Configuration
- Use managed PostgreSQL or configure backups
- Set connection pool limits
- Enable SSL mode:
?sslmode=require - Run migrations instead of
db push
Environment Variables
- Update
NEXTAUTH_URLto production domain - Configure
NEXT_PUBLIC_APP_URL - Set up production email sender
- Add VulnCheck API key (optional but recommended)
Development Tools
Useful Commands
VS Code Extensions
Recommended extensions for VulnTrack development:- Prisma - Syntax highlighting for
.prismafiles - ES7+ React/Redux - React snippets
- Tailwind CSS IntelliSense - Autocomplete for Tailwind classes
- TypeScript Error Translator - Readable TypeScript errors
Updating VulnTrack
To update to the latest version:Next Steps
Quickstart Guide
Create your first vulnerability and explore features
Architecture
Understand VulnTrack’s technical design
Troubleshooting
Session Not Persisting
Session Not Persisting
Symptom: Logged out immediately after loginCauses:
- Missing or invalid
NEXTAUTH_SECRET - Incorrect
NEXTAUTH_URL - Cookie issues (check browser console)
.env
CVE Import Not Working
CVE Import Not Working
Symptom: “CVE not found” errorsDiagnosis:
Check the server logs for API errors:Solutions:
- Verify
VULNCHECK_API_KEYif configured - Check NIST API rate limits (if no VulnCheck)
- Test CVE ID format:
CVE-YYYY-NNNNN
Permission Errors
Permission Errors
Symptom: “Unauthorized” when accessing featuresCheck user role:Update role if needed:
Need Help?
Join the community or report issues on GitHub