arunbandari / mongo-gui

A web-based MongoDB graphical user interface
http://20.106.238.56:4321/
MIT License
280 stars 84 forks source link
angular gui mongodb nodejs npm-package user-interface

npm version Known Vulnerabilities GitHub stars

Mongo GUI

A web-based MongoDB graphical user interface.

Demo

Read-only demo: http://20.106.238.56:4321/

Mongo GUI Features

How to install and run MongoDB GUI

The following are the different ways to install mongo-gui.

From npm:

From Docker Hub:

Docker compose

version: '3'

services:
  mongo-gui:
    container_name: "mongo-gui"
    image: ugleiton/mongo-gui
    restart: always
    ports:
      - "4321:4321"
    environment:
      - MONGO_URL=mongodb://localhost:27017

Mongo GUI Usage

The commands mongo-gui and npm start or node server.js start the application with the following configuaration:

To connect to any other mongodb instance, pass mongo connection string as an argument, eg:

Available options:

Authentication in Mongo GUI

When you want to use the interface on a remote server, you need to protect your data. Mongo-gui provides you with a simple authentication facility for this. This is completely optional, if you don't want authorization you don't use it. To use authorization, follow these steps:

That's it. If you are working on your own computer, or if you do not need security, you can turn off the variables you have defined in the .env file by putting a comment before them, e.g.

Or you can delete your .env file.

So mongo-gui will now continue to run without asking for authorization. Don't forget to restart your server after these actions!

Setting Up the OpenAI Prompt Query

To enable the OpenAI-powered prompt querying in Mongo GUI, you'll need to obtain an API key from OpenAI and add it to your project. Here's a step-by-step guide:

  1. Obtain an OpenAI API Key:

    • Visit OpenAI's platform
    • Sign up or log in, and navigate to the API section to generate your unique API key.
  2. Add the API Key to Your Project:

    • In the root directory of your project, look for a .env file (or create one if it doesn't exist).
    • Add the following line to the .env file:
      OPENAI_API_KEY=YOUR_API_KEY_HERE

      Replace YOUR_API_KEY_HERE with the API key you obtained from OpenAI.

  3. Save the .env file and restart Mongo GUI if it's currently running. With this, the AI-powered prompt querying should be activated!

🔐 Security Note: Remember to keep your .env file confidential. Never push it to public repositories or share it. It contains sensitive information.


This setup guide should provide your users with all they need to integrate the OpenAI prompt query into the tool. Adjust as needed to fit your specific application and user needs.

Screenshots

Controls:

mongo-gui-controls-v2

License

MIT