Skip to content

Latest commit

 

History

History
213 lines (161 loc) · 4.62 KB

File metadata and controls

213 lines (161 loc) · 4.62 KB

Quick Start Guide

Prerequisites

  • Node.js 18+ installed
  • MongoDB Atlas account (or local MongoDB)
  • Docker (optional, for containerized deployment)

Local Development Setup

1. Clone and Install

git clone <repository-url>
cd MyPentest-Dashboard
npm install
cd backend && npm install
cd ../frontend && npm install

2. Configure Environment

Create a .env file in the root directory:

MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net/pentest-dashboard
JWT_SECRET=your-super-secret-jwt-key-change-in-production
JWT_REFRESH_SECRET=your-super-secret-refresh-key-change-in-production
BACKEND_PORT=4000
FRONTEND_PORT=3000
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000

3. Start Development Servers

Option A: Using npm scripts (recommended for development)

# Terminal 1: Start backend
cd backend
npm run dev

# Terminal 2: Start frontend
cd frontend
npm run dev

Option B: Using Docker Compose (MongoDB only)

# Start MongoDB
docker-compose -f docker-compose.dev.yml up -d

# Start backend and frontend locally
npm run dev

4. Access the Application

5. Create Your First User

The application requires authentication. You can:

  1. Register via API:

    curl -X POST http://localhost:4000/api/auth/register \
      -H "Content-Type: application/json" \
      -d '{
        "username": "admin",
        "email": "admin@example.com",
        "password": "admin123",
        "role": "admin"
      }'
  2. Or use the import script (creates default admin user):

    node scripts/import-notion.js /path/to/notion/export

    Default credentials:

    • Email: admin@pentest.local
    • Password: admin123

Docker Deployment

Quick Start with Docker Compose

# Build and start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Import Notion Data

  1. Export from Notion:

    • Go to Settings & Members → Export
    • Select HTML format
    • Download and unzip the export
  2. Run Import Script:

    # Install script dependencies
    cd scripts
    npm install
    
    # Run import
    node import-notion.js /path/to/notion/export

Project Structure

MyPentest-Dashboard/
├── backend/              # Express API server
│   ├── src/
│   │   ├── models/      # MongoDB schemas
│   │   ├── routes/      # API routes
│   │   ├── middleware/ # Auth middleware
│   │   └── server.ts   # Entry point
│   └── package.json
├── frontend/            # Next.js application
│   ├── app/            # Next.js app router pages
│   ├── components/     # React components
│   ├── lib/           # Utilities and API client
│   └── package.json
├── scripts/           # Utility scripts
│   └── import-notion.js
├── docker-compose.yml
├── Dockerfile
└── README.md

Common Tasks

Create a Project

curl -X POST http://localhost:4000/api/projects \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My Pentest Project",
    "slug": "my-pentest-project",
    "description": "Project description",
    "tags": ["web", "api"]
  }'

Create a Task

curl -X POST http://localhost:4000/api/tasks \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Test SQL Injection",
    "projectId": "PROJECT_ID",
    "status": "todo",
    "priority": "high"
  }'

Troubleshooting

MongoDB Connection Issues

  • Verify MONGODB_URI is correct
  • Check MongoDB Atlas IP whitelist
  • Ensure network connectivity

Port Already in Use

  • Change ports in .env file
  • Update CORS_ORIGIN accordingly

Build Errors

  • Clear node_modules: rm -rf node_modules && npm install
  • Ensure Node.js 18+ is installed
  • Check TypeScript version compatibility

Import Script Errors

  • Ensure MongoDB is running and accessible
  • Check that models are compiled (run npm run build in backend first)
  • Verify export path is correct

Next Steps

  1. Read DEPLOYMENT.md for production deployment
  2. Check ACCEPTANCE_CRITERIA.md for feature list
  3. Explore the API endpoints in backend/src/routes/
  4. Customize the UI in frontend/components/

Support

For issues or questions:

  • Check the documentation files
  • Review error logs in console
  • Verify environment variables are set correctly