> For the complete documentation index, see [llms.txt](https://grouple.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://grouple.gitbook.io/docs/backend-api/backend-api-overview.md).

# Backend API Overview

### Overview

The Grouple backend API is a Node.js/TypeScript server running in Docker containers on AWS ECS, behind an Application Load Balancer.

### &#x20;Infrastructure

```
Route 53 (api.grouple.pro)
        ↓
Application Load Balancer (grouple-api-lb)
  ├── HTTP → redirects to HTTPS
  └── HTTPS → SSL terminated via ACM Certificate
        ↓
ECS Cluster (grouple-api-cluster)
  └── Auto Scaling Group (EC2 instances)
      └── ECS Tasks (API Containers)
          └── Docker image pulled from ECR (grouple-api)
```

### [​](https://grouple.mintlify.app/backend/overview#server-entry-point)Server Entry Point <a href="#server-entry-point" id="server-entry-point"></a>

**`server/index.ts`** — main Express server **`server/node-build.ts`** — build script **`server/routes/demo.ts`** — route definitions

### [​](https://grouple.mintlify.app/backend/overview#authentication)Authentication <a href="#authentication" id="authentication"></a>

All API requests require a valid Supabase JWT passed as:

```
Authorization: Bearer <supabase_jwt>
```

The API validates JWT against Supabase Auth before processing requests.

### [​](https://grouple.mintlify.app/backend/overview#environment-&-secrets)Environment & Secrets <a href="#environment-and-secrets" id="environment-and-secrets"></a>

* Environment variables injected at runtime by **AWS Secrets Manager**
* Supabase URL and service role key
* Amazon Bedrock credentials
* Other third-party service keys

### [​](https://grouple.mintlify.app/backend/overview#deployment)Deployment <a href="#deployment" id="deployment"></a>

```
GitHub push to main
        ↓
GitHub Actions (github-actions-user IAM)
        ↓
Build Docker image → push to ECR (grouple-api)
        ↓
ECS rolling deployment → new task definitions
        ↓
ALB routes traffic to new containers
```

### [​](https://grouple.mintlify.app/backend/overview#observability)Observability <a href="#observability" id="observability"></a>

<table><thead><tr><th width="231.90802001953125">Tool</th><th>Purpose</th></tr></thead><tbody><tr><td>CloudWatch Logs</td><td>ECS task logs (<code>/ecs/grouple-api-task</code>)</td></tr><tr><td>AWS X-Ray</td><td>Distributed tracing</td></tr><tr><td>ECS Console</td><td>Container health, task status</td></tr></tbody></table>
