Skip to content

Quickstart

This guide will help you get started with Gateway using Docker, discover your database and launch API on top of it.

Prerequisites

Installation and Launching Steps

1. Binary Installation

Choose your operating system below for specific installation instructions for Linux:

Terminal window
# Download the latest binary for Linux
wget https://github.com/centralmind/gateway/releases/latest/download/gateway-linux-amd64.tar.gz
# Extract the archive
tar -xzf gateway-linux-amd64.tar.gz
mv gateway-linux-amd64 gateway
# Make the binary executable
chmod +x gateway
Windows (Intel)
Terminal window
# Download the latest binary for Windows
Invoke-WebRequest -Uri https://github.com/centralmind/gateway/releases/latest/download/gateway-windows-amd64.zip -OutFile gateway-windows.zip
# Extract the archive
Expand-Archive -Path gateway-windows.zip -DestinationPath .
# Rename
Rename-Item -Path "gateway-windows-amd64.exe" -NewName "gateway.exe"
macOS (Intel)
Terminal window
# Download the latest binary for macOS (Intel)
curl -LO https://github.com/centralmind/gateway/releases/latest/download/gateway-darwin-amd64.tar.gz
# Extract the archive
tar -xzf gateway-darwin-amd64.tar.gz
mv gateway-darwin-amd64 gateway
# Make the binary executable
chmod +x gateway
macOS (Apple Silicon)
Terminal window
# Download the latest binary for macOS (Apple Silicon)
curl -LO https://github.com/centralmind/gateway/releases/latest/download/gateway-darwin-arm64.tar.gz
# Extract the archive
tar -xzf gateway-darwin-arm64.tar.gz
mv gateway-darwin-arm64 gateway
# Make the binary executable
chmod +x gateway

2. Create a connection.yaml configuration file:

Terminal window
echo 'hosts:
- localhost
user: "your-database-user"
password: "your-database-password"
database: "your-database-name"
port: 5432' > connection.yaml

3. Run the discovery process with AI-powered API generation:

Terminal window
./gateway discover \
--config connection.yaml \
--db-type postgres \
--ai-api-key $OPENAI_KEY \
--prompt "Develop an API that enables a chatbot to retrieve information about data. \
Try to place yourself as analyst and think what kind of data you will require, \
based on that come up with useful API methods for that"

4. Start the REST server:

Terminal window
./gateway --config gateway.yaml start rest

Verification

After starting the REST server, you can verify the installation by accessing the Swagger UI:

http://localhost:9090/swagger/