Skip to content

Groww-OSS/Appollo-Dashboard

Repository files navigation

Appollo Dashboard

A modern, open-source attack surface management dashboard built with Next.js, TypeScript, and MongoDB. Monitor your organization's external assets including SSL certificates, DNS records, IP addresses, and port scans in a unified interface.

Next.js TypeScript MongoDB License

✨ Features

  • πŸ›‘οΈ SSL Certificate Monitoring - Track expiration dates, certificate chains, and security status
  • 🌐 DNS Records Management - Monitor DNS configurations, detect changes, and track record types
  • πŸ” IP Address Tracking - Comprehensive IP address and infrastructure monitoring across cloud providers
  • πŸ”’ Port Scan Analysis - Security assessment, open port detection, and vulnerability tracking
  • πŸ“Έ Website Screenshots - Capture and view screenshots of endpoints
  • πŸ“Š Real-time Analytics - Interactive charts and data visualization with filtering
  • 🎨 Modern UI - Responsive design with dark/light theme support
  • πŸ” Role-based Access Control - Admin, editor, and viewer roles with granular permissions
  • πŸ” Advanced Search - Real-time search and multi-criteria filtering
  • πŸ“€ Data Export - Export data to CSV and JSON formats

πŸ› οΈ Tech Stack

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Database: MongoDB
  • Authentication: NextAuth.js with Google OAuth
  • UI Components: Radix UI, Tailwind CSS
  • Charts: Recharts, Chart.js
  • Screenshots: Puppeteer

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • MongoDB (local or Atlas)
  • Google OAuth credentials (for authentication)

Installation

  1. Clone the repository

    git clone https://github.com/groww-oss/apollo-dashboard.git
    cd apollo-dashboard
  2. Install dependencies

    npm install
  3. Configure environment variables

    cp env-example.txt .env.local
  4. Update .env.local with your configuration (see Environment Variables)

  5. Start the development server

    npm run dev
  6. Open your browser Navigate to http://localhost:3000

Initial Admin Setup

Before users can sign in, you need to create the first admin user:

curl -X POST http://localhost:3000/api/users/init \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@example.com",
    "name": "Admin User",
    "secret": "your-system-init-key"
  }'

Replace your-system-init-key with your SYSTEM_MAINTENANCE_KEY from .env.local.

🐳 Docker Deployment

# Build the image
docker build -t apollo-dashboard .

# Run the container
docker run -p 3000:3000 \
  -e MONGODB_URI="mongodb://host.docker.internal:27017/Appollo" \
  -e NEXTAUTH_URL="http://localhost:3000" \
  -e NEXTAUTH_SECRET="your-secret" \
  -e GOOGLE_CLIENT_ID="your-client-id" \
  -e GOOGLE_CLIENT_SECRET="your-client-secret" \
  apollo-dashboard

πŸ“¦ MongoDB Collections

The dashboard expects these collections in your MongoDB database:

Collection Description
SSL Certificates SSL certificate data with expiration tracking
IP Records IP address information and infrastructure data
Port Scans Port scan results and security assessments
DNS DNS records and configuration data
users User accounts and permissions

βš™οΈ Environment Variables

Required

Variable Description
MONGODB_URI MongoDB connection string
NEXTAUTH_URL Your application URL (e.g., http://localhost:3000)
NEXTAUTH_SECRET Random secret for NextAuth.js session encryption
GOOGLE_CLIENT_ID Google OAuth client ID
GOOGLE_CLIENT_SECRET Google OAuth client secret

Optional

Variable Description Default
SYSTEM_MAINTENANCE_KEY Secret key for initial admin user creation -
ALLOWED_EMAIL_DOMAIN Restrict sign-in to specific email domain (e.g., example.com) All domains
NEXT_PUBLIC_REFETCH_INTERVAL Data refresh interval in ms 300000
NEXT_PUBLIC_DASHBOARD_REFETCH_INTERVAL Dashboard refresh interval in ms 30000
PUPPETEER_EXECUTABLE_PATH Path to Chrome binary for screenshots Auto-detected

Setting up Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Navigate to APIs & Services β†’ Credentials
  4. Click Create Credentials β†’ OAuth client ID
  5. Select Web application
  6. Add authorized redirect URI: http://localhost:3000/api/auth/callback/google
  7. Copy the Client ID and Client Secret to your .env.local

πŸ“ Project Structure

β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”‚   β”œβ”€β”€ auth/         # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ dns/          # DNS records API
β”‚   β”‚   β”œβ”€β”€ ips/          # IP records API
β”‚   β”‚   β”œβ”€β”€ port-scans/   # Port scans API
β”‚   β”‚   β”œβ”€β”€ ssl-certificates/ # SSL certificates API
β”‚   β”‚   └── users/        # User management API
β”‚   β”œβ”€β”€ auth/             # Authentication pages
β”‚   β”œβ”€β”€ dns/              # DNS records page
β”‚   β”œβ”€β”€ endpoints/        # Endpoints page
β”‚   β”œβ”€β”€ ips/              # IP addresses page
β”‚   β”œβ”€β”€ port-scans/       # Port scans page
β”‚   β”œβ”€β”€ ssl-certificates/ # SSL certificates page
β”‚   └── users/            # User management page
β”œβ”€β”€ components/            # Reusable UI components
β”‚   β”œβ”€β”€ dashboard/        # Dashboard-specific components
β”‚   └── ui/               # Generic UI components
β”œβ”€β”€ lib/                   # Utility functions and configurations
β”‚   β”œβ”€β”€ auth.ts           # NextAuth configuration
β”‚   β”œβ”€β”€ mongodb.ts        # MongoDB connection
β”‚   └── permissions.ts    # Role-based permissions
└── types/                 # TypeScript type definitions

πŸ”Œ API Endpoints

Data Endpoints

Method Endpoint Description
GET /api/ssl-certificates SSL certificate records
GET /api/ssl-certificates/stats SSL statistics
GET /api/ips IP address records
GET /api/ips/stats IP statistics
GET /api/port-scans Port scan results
GET /api/port-scans/stats Port scan statistics
GET /api/dns DNS records
GET /api/dns/stats DNS statistics
GET /api/endpoints All endpoints
GET /api/stats Overall dashboard statistics

User Management

Method Endpoint Description
GET /api/users List all users
POST /api/users Create new user
PUT /api/users/[id] Update user
DELETE /api/users/[id] Delete user
POST /api/users/init Initialize first admin

System

Method Endpoint Description
GET /api/system/health Health check

πŸ‘₯ User Roles

Role Permissions
Admin Full access: view all data, manage users, export data
Editor View and modify data, export data
Viewer Read-only access to data

πŸ§‘β€πŸ’» Development

# Start development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Run linting
npm run lint

# Type checking
npm run type-check

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run linting and type checking (npm run lint && npm run type-check)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Add TypeScript types for new code
  • Update documentation for new features
  • Test your changes thoroughly

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages