How to Install and Use Prostgles – Your Ultimate UISQL Editor for Postgres

Aug 6, 2024 | Programming

Welcome to the world of Prostgles, a powerful UISQL editor and internal tool builder specially designed for PostgreSQL. Whether you’re a novice navigating the database seas or a seasoned sailor, this guide will walk you through the process of installing and using Prostgles with clarity and ease.

Features of Prostgles

Prostgles boasts an impressive array of features, particularly beneficial for data explorers and SQL enthusiasts:

  • SQL Editor with context-aware schema auto-completion and documentation extracts and hints.
  • Real-time data exploration dashboard with a versatile layout system (tab and side-by-side view).
  • Table view controls for viewing related data, sorting, filtering, and cross-filtering.
  • Support for Map and Time charts with aggregations.
  • Data insert/update forms that feature autocomplete.
  • Role-based access control rules.
  • Isomorphic TypeScript API ensuring end-to-end type safety and React hooks.
  • File uploads, either locally or to the cloud.
  • Search all tables from the public schema.
  • Media file display support (audio, video, images, HTML, SVG).
  • Data import capabilities (CSV, JSON, and GeoJSON).
  • Backup and restore options (locally or to the cloud).
  • TypeScript server-side functions (experimental).
  • Mobile-friendly interface.
  • LISTEN NOTIFY support for efficient database communication.

Installation Steps

Let’s dive into the installation processes you can follow:

Option 1: Docker Compose (Recommended)

For the easiest installation, Docker Compose is your friend. Follow these steps:

  • Download the source code:
  • sh
    git clone https://github.com/prostgles/ui.git
    cd ui
    
  • Set up Docker:
  • sh
    docker compose up
    
  • To use a custom port (e.g., 3099) or a custom binding address:
  • sh
    PRGL_DOCKER_IP=0.0.0.0 PRGL_DOCKER_PORT=3099 docker compose up
    

Option 2: Utilize an Existing PostgreSQL Instance

If you prefer to use your existing database for storing Prostgles metadata, complete the following:

  • Download the source code:
  • sh
    git clone https://github.com/prostgles/ui.git prostgles
    cd prostgles
    
  • Build and run the Docker image:
  • sh
    docker -run.sh
    docker build -t prostgles .
    docker run -d -p 127.0.0.1:3004:3004 \
        -e POSTGRES_HOST=172.17.0.1 \
        -e POSTGRES_PORT=5432 \
        -e POSTGRES_DB=postgres \
        -e POSTGRES_USER=postgres \
        -e POSTGRES_PASSWORD=postgres \
        -e PROSTGLES_UI_HOST=0.0.0.0 \
        -e IS_DOCKER=yes \
        -e NODE_ENV=production \
        prostgles
    

Your server will now be running at localhost:3004.

Development Setup

To create the perfect development environment, follow these steps:

  1. Install dependencies such as NodeJS and Postgres (for complete feature support, postgresql-15-postgis-3 is recommended).
  2. Create a database and user, then update your .env file:
  3. sh
    sudo su - postgres
    createuser --superuser usr
    psql -c "alter user usr with encrypted password 'psw'"
    createdb db -O usr
    
  4. Start the app in development mode:
  5. sh
    ./start.sh
    

Testing Your Setup

Finally, to ensure everything is working smoothly, perform the following:

sh
cd e2e
npm test-local

Troubleshooting

If you encounter any issues during installation or usage, consider these troubleshooting ideas:

  • Double-check your Docker installation for any configuration errors.
  • Ensure that your PostgreSQL credentials in the .env file are correct.
  • Restart your Docker service if the app does not launch correctly.
  • Check for the compatibility of installed versions of NodeJS and Postgres.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

By following this guide, you should be able to install and navigate Prostgles with ease, unlocking its multitude of features to streamline your database interactions. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox