> For the complete documentation index, see [llms.txt](https://atomic-blend.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://atomic-blend.gitbook.io/docs/developers/backend/getting-started.md).

# Getting Started

## Prerequisites

| Tool                    | Version  | Notes                                                  |
| ----------------------- | -------- | ------------------------------------------------------ |
| Go                      | ≥ 1.24.5 | [golang.org](https://golang.org/dl/)                   |
| Docker & Docker Compose | Latest   | [docs.docker.com](https://docs.docker.com/get-docker/) |
| Git                     | Any      |                                                        |

## 1. Clone the Repository

```bash
git clone https://gitlab.com/atomic-blend/backend/atomic-blend.git
cd atomic-blend
```

> The `atomic-blend` meta-repo uses git submodules or a workspace approach. Refer to its README for initial setup.

## 2. Configure the Environment

Copy the example environment file:

```bash
cp docker/.env.example docker/.env
```

Generate a strong secret for `SSO_SECRET`:

```bash
openssl rand 256 | base64 -w0
```

Paste the output as the value of `SSO_SECRET` in `docker/.env`.

## 3. Set Up Go Workspace (for local builds & IDE)

The backend uses a **Go workspace** (`go.work`) to resolve all internal modules locally without needing to push to remote repositories.

```bash
# From the backend root
ls go.work   # Should exist; if not, see infrastructure/local-dev.md
```

See [Local Development](/docs/developers/infrastructure/local-dev.md) for the full workspace setup guide.

## 4. Start the Stack with Docker Compose

```bash
cd docker
docker-compose -f docker-compose-dev.yaml up -d
```

This starts:

* **auth**, **productivity**, **calendar**, **mail**, **mail-server** services
* **Nginx** reverse proxy on `:8080`
* **MongoDB** replica set on `:27017`
* **RabbitMQ** on `:5672` (management UI: `:15672`)
* **MinIO** (S3-compatible) on `:9000`
* **Rspamd** (spam filter)

All services use **Air** for hot-reload. Code changes are picked up automatically.

## 5. Verify the Stack

```bash
curl http://localhost:8080/auth/health
# Expected: {"status": "ok"}

curl http://localhost:8080/productivity/health
# Expected: {"status": "ok"}
```

## 6. Run Tests

Tests must be run from the **backend root** (where `go.work` lives):

```bash
cd /path/to/backend/root
go test ./auth/api/...
go test ./productivity/api/...
go test ./calendar/api/...
go test ./mail/api/...
go test ./shared/...

# Or run all at once
bash run-all-tests.sh
```

## 7. Explore the API

The Bruno collection at `backend/bruno/` contains all HTTP requests. Import it in [Bruno](https://www.usebruno.com/) to explore the API interactively.

> **Full API reference:** Swagger UI is coming soon.

## Next Steps

* [Conventions](/docs/developers/backend/conventions.md) — project layout, naming, error handling
* [Services](/docs/developers/services/auth.md) — per-service documentation
* [Patterns](/docs/developers/patterns/controller-service-repo.md) — architectural patterns
* [New Service](/docs/developers/patterns/new-service.md) — scaffold a new microservice


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://atomic-blend.gitbook.io/docs/developers/backend/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
