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

# The Atoti Admin UI Starter

## Introduction

The Atoti Admin UI Starter automatically sets up an Atoti Server application to work with Atoti
Admin UI, while
still allowing custom settings to overrule default behaviors.<br />
Admin UI application is accessible at this URL `http://<application-url>:<port>/admin/ui`.

## How to set up Atoti Admin UI

### 1. Add the maven dependency

To use the starter, add the following dependency to your `pom.xml`.

```xml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
<dependency>
  <groupId>com.activeviam.springboot</groupId>
  <artifactId>atoti-admin-ui-starter</artifactId>
  <version>${project.version}</version>
</dependency>
```

This starter automatically uses a suitable Atoti Admin UI version for your Atoti Server version.
Nevertheless, the `admin-ui.version` maven property may be set to the desired version to override
the default.
However, only official versions 5.2+ are supported.

### 2. Provide the `env.js` file

Atoti Admin UI needs a JavaScript file named `env.js` during startup to locate the Content Server and the Atoti Server.
Without `env.js`, Atoti Admin UI cannot determine where to connect.

#### Content

`env.js` file content structure is described in Atoti UI set up [documentation](/data-visualization/atoti-ui/5.2/developer-guide/install-and-start/set-up#use-atoti-ui).

| Property        | Required | Effect                                                                     |
| --------------- | -------- | -------------------------------------------------------------------------- |
| `jwtServer`     | Yes      | Server used for authentication. All requests carry a JWT obtained from it. |
| `contentServer` | No       | Enables the **Content** tab.                                               |
| `atotiServers`  | No       | Enables the **Database**, **Measure lineage**, **Query history** tabs.     |

`atotiServers` is a key-value map: the key identifies the server, the value is a `{ url, version }` object.<br />
Only the first server is used by Admin UI.
Remove `contentServer` or `atotiServers` to hide the tabs you do not need.

#### Location

There are three ways to configure the `env.js` file's location:

1. Without any additional configuration, Atoti Admin UI Starter automatically loads any `resources/static/atoti-admin-ui/env.js` file provided by the application.
2. (Optional) Set the `atoti.admin-ui.env-js-resource` property to change the location of the `env.js` file.
   It must contain the path to the folder containing the `env.js` file.
3. (Optional) Create an `AdminUiEnvJs` bean, defined so that its `getResource()` method returns a Spring `Resource` containing the content of the `env.js` file.
   As any implementation of `Resource` may be used, this content does not necessarily come from a file.
   ```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
   @Bean
   public AdminUiEnvJs adminUiProperties() {
     final Resource adminUiEnvJs = adminUiEnvJs();
     return () -> adminUiEnvJs;
   }
   ```

### 3. Define Security

This starter defines a security rule to control the access to Atoti Admin UI and its web resources.
Like Atoti Server Starter, it automatically uses
an [`HumanToMachineDsl`](atoti_starter#human-to-machine-dsl) to configure general security
rules.

Should a different behavior be needed, the `atoti.server.security.adminui.enabled` property can
be set
to `false` to disable this default rule and replace it with one of your own.
