> ## Documentation Index
> Fetch the complete documentation index at: https://archie.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Working with a service

> Open a service to see its live version, its code, its deployments, and its environment variables. Edit files in the browser, commit your changes, and decide when to deploy.

Click a service in the **Logic** list to open it. This page walks through what you see and how the code editor works. For the deploy side, see [Deployments](https://archie.com/docs/backend/logic/deployments.md). For configuration, see [Environment variables](https://archie.com/docs/backend/logic/environment-variables.md).

The service page is scoped to the [environment](https://archie.com/docs/backend/environments.md) you picked in the Backend Console. In the screenshots, the environment is `master`.

## The service page

![The self-signup service page with the header, the version bar, and the Code, Deployments, Environment variables, and Logs tabs.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/33-logic-service-code.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=9397fd29b138808edf3787407c704c0b)

### Header

The header shows:

* The service name and its language, such as **Go**.
* Status badges. **Live** means a version is running. **Last deploy failed** means the most recent deploy didn't succeed. Other states you may see are **Never deployed**, **Deploying**, **Disconnected**, **Unavailable**, and **Deleting…**.
* **Generate with AI**, **Delete**, and **Deploy**.

Click **Back to Services** to return to the list.

### Version bar

The bar under the header compares three things:

| Item | Meaning |
| - | - |
| **Live version** | The commit that is running now, with the date it went live. |
| **Head** | The latest commit in the service's repository. Archie flags **Undeployed changes** when Head is newer than the live version. |
| **Last deploy** | The outcome of the most recent deploy, such as **Failed · Oct 21**. |

**Undeployed changes** doesn't mean you have unsaved edits. It means the repository has a commit that isn't live yet. Click **Deploy** to build the latest commit.

## The Code tab

The **Code** tab is an in-browser editor for the service's repository.

![The Code tab with the file tree on the left and archie.deploy.json open in the editor.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/34-logic-code-deploy-config.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=79b8cccf675a5cd5ae47f2a04f526247)

The panel on the left has four views:

* The file tree, with a **Search files** box. This is the view that opens first.
* **Changes**, which lists the files you edited but haven't saved. It shows a count and reads **No changes** when everything is saved.
* A diagnostics view for problems in your code.
* A search view for searching across files.

The four views are icons at the top of the panel.

Select a file to open it. Until you do, the editor reads **Select a file to view**.

### What's in a service

A service created from scratch is a small, working server. The Go template includes:

| File or folder | What it holds |
| - | - |
| `main.go` | The program entry point. It reads the `PORT` environment variable and starts the server. |
| `graph`, `rest`, `server`, `internal`, `archie` | The server code, including the GraphQL and REST handlers. |
| `gqlgen.yml`, `go.mod`, `go.sum` | Go and GraphQL generator configuration. |
| `Dockerfile` | How Archie builds the image. |
| `archie.deploy.json` | The deploy settings. See below. |
| `README.md` | How to run the service locally. |

Other languages use their own layout. Open `README.md` in your service to see the commands for running it on your machine.

### The deploy file

Every service has an `archie.deploy.json` file. Archie needs it to deploy, and you can't delete it. The Go template contains:

```json theme={null}
{"build":"docker","port":8080,"healthPath":"/health","start":"/app/server","startupSeconds":30}
```

| Property | What it sets |
| - | - |
| `build` | How Archie builds the service. The template uses `docker`. |
| `port` | The port the service listens on. |
| `healthPath` | The path Archie uses to check that the service is healthy. |
| `start` | The command that starts the service. |
| `startupSeconds` | How long Archie waits for the service to start before it considers it down. |

The editor validates this file as you type. It reports invalid JSON, a file that isn't a JSON object, unknown properties, missing properties, and invalid values.

### Save and commit

Edit a file, then click **Save** or press <kbd>⌘</kbd> + <kbd>S</kbd>. Archie asks for a **Commit message**. Each save creates a commit in the service's repository, and the editor then shows **Saved · not deployed**.

Saving doesn't change what's live. To run your changes, click **Deploy**. See [Deployments](https://archie.com/docs/backend/logic/deployments.md).

A few limits apply:

* Files larger than 1 MiB open as read-only.
* The repository has no conflict protection, so the last save wins. If someone saved a newer version while you had unsaved changes, the editor offers to **Review** or **Discard** your draft.
* If a service shows **Disconnected**, its code is safe but the deploy service no longer knows it. Click **Re-register** to reconnect it before you edit or deploy.

## Logs

The **Logs** tab doesn't show logs itself. It reads "Logs live in your environment" and points to the environment logs. This service's output appears there together with the other services in the environment. Per-service logs are marked as coming later.

![The Logs tab reading "Logs live in your environment" with an Open environment logs button.](https://mintcdn.com/archie-e998dbf6/FcInvfd50seksJIy/images/38-logic-logs-tab.png?fit=max\&auto=format\&n=FcInvfd50seksJIy\&q=85\&s=429c8c12c508371fe498b89d877606fe)

Click **Open environment logs** to go to **Backend → Logs**. See [Logs](https://archie.com/docs/backend/logs.md) for filtering and searching.

## Generate with AI

Click **Generate with AI** in the header to add a function to an existing service. A panel opens on the right.

![The Generate with AI panel with Function name and Description fields, an Improve with AI button, and a Continue button.](https://mintcdn.com/archie-e998dbf6/JW67AKv9r3EIl9M1/images/41-logic-generate-with-ai.png?fit=max\&auto=format\&n=JW67AKv9r3EIl9M1\&q=85\&s=c297ccbfbd73e7d09d0c1789db4b5c0f)

1. Enter a **Function name**. Use 3–40 characters: lowercase letters, numbers, and hyphens.
2. Describe what the function should do in **Description**. Write at least 20 characters. Click **Improve with AI** to refine your text.
3. Click **Continue**.

To plan a whole new service from a description, use [Add With AI](https://archie.com/docs/backend/logic/creating-with-ai.md) instead.

## Delete a service

Click **Delete** in the header, or open the **Actions** menu on the [Logic list](https://archie.com/docs/backend/logic.md) and choose **Delete**. Archie asks you to type the service name to confirm.

![The delete confirmation dialog asking you to type self-signup to confirm.](https://mintcdn.com/archie-e998dbf6/JW67AKv9r3EIl9M1/images/40-logic-delete-dialog.png?fit=max\&auto=format\&n=JW67AKv9r3EIl9M1\&q=85\&s=555561d4986be82a519446240bae1404)

Deleting removes the service, its code repository, and its deployment. You can't undo it. If you imported the service from your own repository, Archie doesn't delete that repository.

> [!WARNING]
>
> Deleting a service is permanent. Download or copy any code you want to keep before you confirm.

## FAQ

> **What's the difference between a service and a function?**
>
> A service is the deployable unit: one repository, one language, one deploy history. A function is one operation inside it, such as a GraphQL query, a GraphQL mutation, or a REST route. A service can hold several functions, and each deploy ships them all together.

> **Why does Head differ from the live version?**
>
> Head is the latest commit. The live version is the last commit that deployed successfully. They differ after you save and before you deploy, or after a failed deploy.

> **Can I open a service in a new tab?**
>
> Yes. In the **Logic** list, open the **Actions** menu on a row and choose **Open in new tab**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.