Infrastructure & External Services
This document outlines the server architecture and key third-party services that the Merq backend relies on for its core functionality.
Server & Hosting Architecture
Section titled “Server & Hosting Architecture”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-networkconfiguration indocker-compose.ymlsuggests the application is intended to be deployed within a Dokploy environment, which is a PaaS for deploying applications on a user’s own servers.
External Service Integrations
Section titled “External Service Integrations”The backend integrates with several external services, as evidenced by environment variables in docker-compose.yml and code references throughout the merq-backend repository.
Key Integrations
Section titled “Key Integrations”-
Typesense (Search)
- Purpose: Provides fast, typo-tolerant search capabilities for core domain models like Users, Products, Projects, etc.
- Implementation: The
internal/platform/searchdirectory contains the client and repository for interacting with the Typesense API. Services likeproduct_service.gouse 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/firebasepackage contains the client for initializing the Firebase app and sending messages. It requires aservice-account.jsoncredentials 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/emailpackage.
- Purpose: An external API (
Potential & Unconfirmed Integrations
Section titled “Potential & Unconfirmed Integrations”- Google Maps / Geolocation
- A comment in
utils/gps_spoofing.gosuggests 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-webalso includes@vis.gl/react-google-maps, confirming map features on the frontend.
- A comment in