# 10 - Services

This section documents each deployable service (sub-project) in the Amanat/Escrow platform. Each article covers the service's purpose, configuration, build process, and operational notes.

See also: [[01 - Architecture]] · [[08 - Operations]] · [[03 - API Reference]]

---

## Service Inventory

| Service | Language / Framework | Status | URL | Doc |
|---|---|---|---|---|
| Backend | Node.js / TypeScript (Express) | Live | `api.dev.amn.gg` | [[backend]] |
| Frontend | Next.js / React / TypeScript | Live | `dev.amn.gg` | [[frontend]] |
| Scanner | Go | Live | internal | [[scanner]] |
| Amanat Assist | Node.js / TypeScript + LLM proxy | Live | `assist.dev.amn.gg` | [[amanat-assist]] |
| Deployment | Docker Compose + Caddy + Watchtower | Live | — | [[deployment]] |

---

## Architecture Overview

```
Browser / Telegram Mini App
        │
        ▼
  infra-caddy (reverse proxy, TLS)
  ├── dev.amn.gg          → [[frontend]]   (Next.js SSR)
  ├── api.dev.amn.gg      → [[backend]]    (Express REST + WebSocket)
  └── assist.dev.amn.gg   → [[amanat-assist]] (LLM proxy / Telegram bot)

[[backend]]
  ├── MongoDB / PostgreSQL  (dual-write seam, PG cutover in progress)
  ├── Redis                 (sessions, rate-limit, pub-sub)
  └── emits payment events
        │
        ▼
  [[scanner]]  (Go — watches EVM chains for on-chain payments)
        │  webhook callback
        └──────────────────▶ [[backend]] /api/payment/callback
```

- All containers share the `shared-web` Docker network managed by [[deployment]].
- [[amanat-assist]] is a separate Telegram Mini App; it calls [[backend]] APIs on behalf of users.
- [[scanner]] is stateless; it probes RPC endpoints and forwards confirmations to the backend.

---

## Related Sections

- [[01 - Architecture]] — system-wide design decisions, data model, and sequence diagrams
- [[03 - API Reference]] — REST endpoints, WebSocket events, auth headers
- [[08 - Operations]] — deployment runbooks, monitoring, secrets management
