Admin Panel

NexaDB includes a powerful web-based admin panel for managing your database visually. No code required!

Getting Started

Terminal
$nexadb admin
✓ Admin panel running at http://localhost:9999/admin_panel/

Default Login Credentials

Username: root
Password: nexadb123

⚠️ IMPORTANT: Change the default password after first login!

Features Overview

📊 Collections Management

  • • View all collections at a glance
  • • See document counts in real-time
  • • Create new collections instantly
  • • Delete collections with confirmation
  • • Monitor collection statistics

📝 Document Operations

  • • Browse documents with pagination
  • • View in table or JSON format
  • • Create new documents easily
  • • Edit existing documents inline
  • • Delete with confirmation modal
  • • Bulk delete multiple documents

👥 User Management

  • • Create users with different roles
  • • Change user passwords
  • • Assign admin, write, read roles
  • • Delete users (admin only)
  • • View user permissions

🔑 API Key Management

  • • Generate new API keys
  • • Set expiration dates
  • • Assign role-based permissions
  • • Revoke keys instantly
  • • Track key usage

Collections Tab

Managing Collections

View Collections

The Collections tab displays all your collections with:

  • • Collection name
  • • Total document count
  • • Quick action buttons (View, Delete)

Create a Collection

  1. Click the "Create Collection" button
  2. Enter a collection name (e.g., "users", "products")
  3. Click "Create"
  4. Your new collection appears immediately

Delete a Collection

Deleting a collection requires confirmation:

  1. Click the "Delete" button next to the collection
  2. A modal appears warning you about permanent deletion
  3. Type DELETE to confirm
  4. Click "Delete Collection" button

⚠️ This action is irreversible! All documents in the collection will be permanently deleted.

Documents Tab

Working with Documents

View Modes

Switch between two viewing modes:

  • Table View: Spreadsheet-like interface with columns for each field
  • JSON View: Raw JSON format for developers

Pagination

Browse large collections easily:

  • • 50 documents per page by default
  • • Previous/Next buttons for navigation
  • • Page indicator shows current position
  • • Automatically handles large datasets

Create a Document

  1. Click "New Document" button
  2. Enter your document as JSON in the editor
  3. Click "Create Document"
  4. Document is instantly added to the collection

Edit a Document

  1. Click the "Edit" button on any document
  2. Modify the JSON in the editor
  3. Click "Update Document"
  4. Changes are saved immediately

Delete a Document

Single document deletion with confirmation:

  1. Click the "Delete" button on the document
  2. A modal appears with the document ID
  3. Type DELETE to confirm
  4. Click "Delete Document"

Bulk Delete Documents

Delete multiple documents at once:

  1. Check the boxes next to documents you want to delete
  2. Use the "Select All" checkbox to select everything on the page
  3. Click the "Delete Selected" button that appears
  4. A modal shows how many documents will be deleted
  5. Type DELETE to confirm
  6. Click "Delete Documents"

The system will delete each document individually and report success/failures.

Users Tab

User Management (Admin Only)

Create a User

  1. Click "Create User" button
  2. Enter username (e.g., "alice", "backend_service")
  3. Enter password
  4. Select role: Admin, Write, Read, or Guest
  5. Click "Create User"

User Roles Explained

Admin
Full access to everything: collections, documents, users, API keys, settings
Write
Can read, insert, update, and delete documents. Cannot manage users or collections.
Read
Read-only access. Can query documents and perform vector searches.
Guest
Limited read access to public collections only. Rate limited to 10 requests/min.

Change Password

  1. Click "Change Password" button for the user
  2. Enter new password
  3. Confirm password
  4. Click "Update Password"

Password changes take effect immediately. The user will need to use the new password for their next login.

Delete a User

  1. Click the "Delete" button next to the user
  2. Confirm the deletion

⚠️ You cannot delete the root user. This ensures you always have admin access.

API Keys Tab

Managing API Keys

Generate an API Key

  1. Click "Generate API Key" button
  2. Enter a username/service name (e.g., "backend_api", "mobile_app")
  3. Select role (Admin, Write, Read, Guest)
  4. Set expiration in days (e.g., 90, 365, or 0 for no expiration)
  5. Click "Generate Key"
  6. Copy the generated key immediately

⚠️ API keys are shown only ONCE! Save it securely - you won't be able to see it again.

Using API Keys

# Use the API key in X-API-Key header
curl -X GET http://localhost:6969/collections \
  -H "X-API-Key: nxdb_abc123def456..."

Revoke an API Key

  1. Find the key in the list
  2. Click "Revoke" button
  3. Confirm the revocation

Revoked keys stop working immediately. Any requests using the revoked key will be rejected.

Security Features

🔒 Confirmation Modals

All destructive actions (delete collection, delete document, bulk delete) require typing DELETE to confirm. This prevents accidental data loss.

👁️ Role-Based UI

Buttons and features are automatically hidden based on your role. Write users won't see user management, Read users won't see delete buttons.

🔐 Session Management

Sessions expire after 24 hours. You'll be automatically logged out for security. Simply log in again to continue.

🚨 Error Handling

Bulk operations report partial successes. If deleting 10 documents fails for 2, you'll see "Deleted 8 documents, 2 failed" instead of silent failures.

Keyboard Shortcuts

Close modalEsc
Submit formEnter

🎉 Ready to Explore!

The admin panel makes database management visual and intuitive. Start exploring your data without writing a single line of code!

$ nexadb admin