Skip to main content
The VIJ Admin dashboard is a Next.js application that provides error monitoring, visualization, and AI-powered analysis. This guide walks you through setting up your own self-hosted instance.

Prerequisites

Before setting up VIJ Admin, ensure you have:
  • Node.js 18+ - Required for running Next.js
  • npm, yarn, pnpm, or bun - Package manager
  • MongoDB 5.0+ - Database for storing error logs
  • Git - For cloning the repository
You need a MongoDB instance. Choose one of:Option 1: MongoDB Atlas (Cloud)
  1. Create free account at mongodb.com/atlas
  2. Create a cluster
  3. Get connection string
Option 2: Local MongoDB
For AI-powered error analysis:
  1. Visit ai.google.dev
  2. Create an API key
  3. Keep it for environment configuration
AI features are optional. VIJ works perfectly without them.

Installation

1

Clone the repository

Clone the VIJ Admin repository:
Alternatively, fork the repository first if you plan to make customizations.
2

Install dependencies

Install all required npm packages:
This will install:
  • Next.js 14+ framework
  • MongoDB driver
  • Google Generative AI SDK
  • UI components and utilities
3

Configure environment variables

Create a .env.local file in the project root:
Add the following configuration:
.env.local
MONGODB_URI is required. The application will not start without it.
See the Environment Variables reference for all available options.
4

Start the development server

Run the Next.js development server:
The dashboard will be available at http://localhost:3000
You should see the VIJ Admin dashboard! The home page will be empty until you start sending logs from your applications.
5

Verify database connection

Check the terminal output for MongoDB connection status:
If you see connection errors, verify:
  • MongoDB is running
  • Connection string is correct
  • Network/firewall allows connection

Configuration

Environment Variables

Configure VIJ Admin through environment variables:
string
required
MongoDB connection string.Format: mongodb://[username:password@]host[:port]/database[?options]Examples:
string
required
Base URL where your VIJ Admin dashboard is accessible.Usage: Used for API endpoints and client-side routing.Examples:
string
Google Gemini API key for AI-powered error analysis.Get a key: ai.google.devExample:
Without this key, AI features will be disabled but all other functionality works normally.

MongoDB Configuration

VIJ Admin automatically creates the following indexes for optimal performance:
Indexes are created automatically on first connection. No manual setup required.

Database Schema

Error logs are stored in the logs collection with this structure:

Next.js Configuration

The VIJ Admin uses these Next.js settings:

App Router Structure

API Routes

All API routes are automatically available:
  • POST /api/logs - Receive error logs from SDK
  • GET /api/logs - Fetch logs with filtering
  • GET /api/stats - Get dashboard statistics
  • GET /api/groups - Get grouped errors
These routes are documented in detail in the API Reference.

Initial Setup Checklist

After installation, verify your setup:
1

Check dashboard access

Open http://localhost:3000 in your browser.You should see:
  • Dashboard home page
  • Navigation menu (Dashboard, Logs, Groups)
  • Empty state (no errors yet)
2

Verify API endpoints

Test the API is responding:
Getting a method error is good! It means the API is running.
3

Test log ingestion

Send a test log:
Then check the dashboard - you should see your test error!
4

Verify database

Check MongoDB has the data:
5

Test AI features (if configured)

If you set GEMINI_API_KEY, click on a log entry and verify you see:
  • AI Summary
  • Possible Cause
  • Suggested Fix
AI analysis may take a few seconds on first load.

Project Structure

Understanding the VIJ Admin codebase:

Customization

Theming

VIJ Admin uses Tailwind CSS. Customize colors in tailwind.config.js:
tailwind.config.js

Adding Custom Filters

Extend filtering in app/logs/page.tsx:

Custom Metadata Fields

Display custom metadata in components/ErrorDetails.tsx:

Troubleshooting

Error: MongoServerError: connect ECONNREFUSEDSolutions:
  1. Verify MongoDB is running:
  2. Check connection string in .env.local
  3. Verify firewall/network settings
  4. For Atlas: Check IP whitelist
Error: Module not found: Can't resolve 'X'Solutions:
Issue: Environment variables undefinedSolutions:
  1. Ensure file is named .env.local (not .env)
  2. Restart dev server after changes
  3. Use NEXT_PUBLIC_ prefix for client-side variables
  4. Check for typos in variable names
Issue: No AI analysis appearingSolutions:
  1. Verify GEMINI_API_KEY is set
  2. Check API key is valid on ai.google.dev
  3. Check browser console for errors
  4. Verify you have API quota available
  5. Check server logs for AI-related errors
Error: Port 3000 is already in useSolutions:

Next Steps

Dashboard Features

Explore all dashboard capabilities and features

Environment Variables

Complete environment variable reference

Deploy to Production

Deploy VIJ Admin to Vercel or your infrastructure

Integrate SDK

Add error tracking to your applications