Skip to content

Infrastructure & External Services

This document outlines the server architecture and key third-party services that the Merq backend relies on for its core functionality.

The Merq backend is designed to run as a containerized application using Docker. The docker-compose.yml file defines the services and their relationships, indicating a microservices-friendly architecture.

The main components of the stack are:

  • Go Application Server: The primary backend service running the Gin web framework.
  • PostgreSQL: The main relational database for persistent data storage.
  • Redis: Used for caching, session management, and potentially as a message broker.
  • Typesense: A fast, open-source search engine used to power the platform’s search features.
  • Dokploy Network: The dokploy-network configuration in docker-compose.yml suggests the application is intended to be deployed within a Dokploy environment, which is a PaaS for deploying applications on a user’s own servers.

The backend integrates with several external services, as evidenced by environment variables in docker-compose.yml and code references throughout the merq-backend repository.

  • Typesense (Search)

    • Purpose: Provides fast, typo-tolerant search capabilities for core domain models like Users, Products, Projects, etc.
    • Implementation: The internal/platform/search directory contains the client and repository for interacting with the Typesense API. Services like product_service.go use a “search repository” to index and search documents.
  • Firebase (Push Notifications)

    • Purpose: Used for sending push notifications to mobile devices via Firebase Cloud Messaging (FCM).
    • Implementation: The internal/platform/firebase package contains the client for initializing the Firebase app and sending messages. It requires a service-account.json credentials file.
  • DigitalOcean Spaces (Object Storage)

    • Purpose: Used for storing user-generated files, such as images or other media uploads. It is an S3-compatible object storage service.
    • Implementation: Configured via DO_SPACES_* environment variables.
  • Unsend (Email)

    • Purpose: An external API (UNSEND_API_URL) is used for sending transactional emails, such as password resets or notifications.
    • Implementation: The email client is likely configured within the internal/platform/email package.
  • Google Maps / Geolocation
    • A comment in utils/gps_spoofing.go suggests a potential future integration with the Google Geolocation API to enhance location-based features and remove rate limits from the current IP-based lookup.
    • merq-web also includes @vis.gl/react-google-maps, confirming map features on the frontend.