Skip to content

Database Setup

Now we will show you how to connect to your Mongo and PostreSQL databases from your docker containers or production build. If you’re connecting to your local databases, make sure you successfully executed your docker compose in the back-end repo.

You can find your connection credentials for docker in the docker-compose.yml file in /SNAPCASTER-BACKEND. If you want to connect to the production, refer to your cloud hosting service for the database private URL for your connection string.

MongoDB Compass (GUI)

You can use the MongoDB Compass GUI tool for connecting to your Mongo databases. In MongoDB Compass, click New Connection and enter your SRV URI connection string. The format of this connection string is mongodb://[user:password ]@[hostIP:port ]/ which you will find in the docker-compose.yml file.

PgAdmin 4 (GUI)

If you want to use PgAdmin 4 as your GUI management tool for PostgreSQL, you can download the latest version here.

In PgAdmin:

  1. Right click Servers

  2. Under General enter any server name of your choice

  3. Under Connection, enter your host name/address, port, maintenance database, and username. This information can be found in your docker-compose.yml file, or if you’re connecting to your production you can find this information in the settings of your service providers settings

  4. Click save and ensure the that the you can view your tables

  • Directorysnapcaster-backend
    • Directoryservices
      • Directoryuser
        • Directorypostgres-init
          • v1_create_users_table.sql
          • v2_create_stripe_customers_table.sql
          • v3_users_table_update.sql
          • v4_add_wishlists.sql
          • v5_users_discord_id.sql
          • v6_rm_wishlist_add_website.sql
          • v7_coupon_codes.sql
          • v8_snapshots.sql