Quickstart

This guide walks you through setting up the DealDome API locally and making your first authenticated request. By the end you will have the Go server running, connected to PostgreSQL, and be able to fetch products from the API.

Prerequisites

Before you start, make sure you have the following installed and available:

  • Go 1.22+ — the backend is written in Go and uses newer language features
  • PostgreSQL 16+ with the pgvector extension enabled
  • API keys — you will need keys for Anthropic (Claude), OpenAI (embeddings), and a Telegram bot token

Environment variables

Create a .env file in the project root with the following variables:

.env

# Database
DATABASE_URL=postgres://dealdome:secret@localhost:5432/dealdome?sslmode=disable

# AI providers
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...

# Telegram
TELEGRAM_BOT_TOKEN=123456:ABC-DEF...

# Server
API_PORT=8080
BASE_URL=https://api.dealdome.eu
JWT_SECRET=your-jwt-secret-here

# Observability (optional)
SENTRY_DSN=https://...@sentry.io/...
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
BETTERSTACK_SOURCE_TOKEN=...

Setup

Clone the repository, set up the database, and start the server:

git clone https://github.com/dealdome/api.git
cd api
go mod download

Once the server is running you should see output like:

INFO  server started on :8080
INFO  telegram bot connected
INFO  migrations complete

First API request

Now that the server is running, let's authenticate and fetch some data. DealDome uses JWT tokens for authentication — you obtain one by posting your credentials to the login endpoint.

Step 1: Log in

POST
/auth/login
curl -X POST https://api.dealdome.eu/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@dealdome.eu",
    "password": "your-password"
  }'

Response

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expires_at": "2026-04-14T12:00:00Z"
}

Step 2: Fetch products

Use the token from the previous step to make an authenticated request:

GET
/products
curl https://api.dealdome.eu/products \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Response

{
  "data": [
    {
      "id": "prod_8xKz2mNqR",
      "name": "LED Sunset Lamp",
      "shopify_store": "dealdome-uk",
      "cost_price": 4.20,
      "selling_price": 19.99,
      "status": "active",
      "created_at": "2026-03-10T09:15:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 42
  }
}

What's next?

You are all set up and ready to explore the DealDome API. Here are some useful next steps:

Was this page helpful?