# FT4 accounts configuration · A simple Chromia app with Rell and React · Learn Chromia

> Here you install the FT4 library and set up accounts.

Source: https://chromia.com/learn/my-news-feed/module-one/create-accounts/install-configure-ft4/

A simple Chromia app with Rell and ReactLesson 8 of 27

1. [01Building a simple Chromia app with Rell, React and FT4](https://chromia.com/learn/my-news-feed/introduction/)
2. [02Project setup complete](https://chromia.com/learn/my-news-feed/setup/)

Module 1: A Rell backend with FT accounts

1. [03Overview](https://chromia.com/learn/my-news-feed/module-one/)
2. [04Part 1: Designing the database schema](https://chromia.com/learn/my-news-feed/module-one/data-modeling/)
3. [05The data model](https://chromia.com/learn/my-news-feed/module-one/data-modeling/tables/)
4. [06Code the model in Rell](https://chromia.com/learn/my-news-feed/module-one/data-modeling/model/)
5. [07Part 2: Set up accounts](https://chromia.com/learn/my-news-feed/module-one/create-accounts/)
6. [08FT4 accounts configuration](https://chromia.com/learn/my-news-feed/module-one/create-accounts/install-configure-ft4/)
7. [09Authentication with FT4 accounts](https://chromia.com/learn/my-news-feed/module-one/create-accounts/authentication/)
8. [10Part 3: A closer look at operations and queries](https://chromia.com/learn/my-news-feed/module-one/operations-queries/)
9. [11Basic operations](https://chromia.com/learn/my-news-feed/module-one/operations-queries/basic-operations/)
10. [12Basic queries](https://chromia.com/learn/my-news-feed/module-one/operations-queries/write-queries/)
11. [13Part 4: Validating and verifying input](https://chromia.com/learn/my-news-feed/module-one/input-verification/)
12. [14Verify inputs](https://chromia.com/learn/my-news-feed/module-one/input-verification/input-verification/)
13. [15Run unit tests](https://chromia.com/learn/my-news-feed/module-one/input-verification/tests/)
14. [16Part 5: How the dapp project is organized](https://chromia.com/learn/my-news-feed/module-one/project-structure/)
15. [17Work with Rell modules](https://chromia.com/learn/my-news-feed/module-one/project-structure/modules/)
16. [18Add modules to your dapp](https://chromia.com/learn/my-news-feed/module-one/project-structure/incorporate-modules/)
17. [19Part 6: Sign up users with an EVM wallet](https://chromia.com/learn/my-news-feed/module-one/register-evm-accounts/)
18. [20Sign up accounts with EVM wallets](https://chromia.com/learn/my-news-feed/module-one/register-evm-accounts/register-evm-accounts/)
19. [21Test the registration](https://chromia.com/learn/my-news-feed/module-one/register-evm-accounts/test-registration/)

Module 2: The React project

1. [22Overview](https://chromia.com/learn/my-news-feed/module-two/)
2. [23Set up the project](https://chromia.com/learn/my-news-feed/module-two/setup/)
3. [24Project scaffold](https://chromia.com/learn/my-news-feed/module-two/scaffold/)
4. [25Connect the client](https://chromia.com/learn/my-news-feed/module-two/connecting-the-client/)
5. [26Summary and manual testing](https://chromia.com/learn/my-news-feed/module-two/summary-and-tests/)

1. [27What is next?](https://chromia.com/learn/my-news-feed/what-next/)

[Learn](https://chromia.com/learn/)[A simple Chromia app with Rell and React](https://chromia.com/learn/my-news-feed/)

08 / 27Module 1: A Rell backend with FT accountsBeginner

# FT4 accounts configuration

Here you install the FT4 library and set up accounts.

## Install the FT4 library

Account management depends on the FT4 library, so add it first. Put the following configuration in your `chromia.yml` file:

chromia.yml

```
libs:
  ft4:
    registry: https://gitlab.com/chromaway/ft4-lib.git
    path: rell/src/lib/ft4
    tagOrBranch: v1.2.0r
    rid: x"E96915FD7C9A5DD4E183D86F4A5B4BB5083A7CC1EDEB1465EDFFC926E67C93F6"
    insecure: false
  iccf:
    registry: https://gitlab.com/chromaway/core/directory-chain
    path: src/lib/iccf
    tagOrBranch: 1.87.0
    rid: x"9C359787B75927733034EA1CEE74EEC8829D2907E4FC94790B5E9ABE4396575D"
    insecure: false
```

## Configure FT4 accounts

Next, you add FT4 accounts to the app's model to strengthen how users authenticate.

Begin with the required module imports:

src/registration/module.rell

```nolines
import lib.ft4.core.accounts.strategies.open. { ras_open };
import lib.ft4.accounts.strategies. { register_account };
```

Then give the `user` entity an account field:

src/news\_feed/model.rell

```
entity user {
  mutable name;
  key id: byte_array;
  key account;
}
```

With this, each user maps to exactly one FT4 account, and each account to exactly one user. Update the `create_user` operation so it creates an FT4 account as well:

src/registration/module.rell

```
operation register_user(name) {
    val account = register_account();
    val user = create user ( name, account.id, account );
    create follower ( user = user, follower = user );
}
```

The [FT4 accounts and tokens documentation](https://docs.chromia.com/build/ft4/intro/) covers account permissions and the FT4 framework in depth.

In `chromia.yml`, move the test section so it sits under the blockchain tag, and add the admin public key:

chromia.yml

```
blockchains:
  newschain:
    module: main
    moduleArgs:
      lib.ft4.core.auth:
        evm_signatures_authorized_operations:
          - register_user
      lib.ft4.core.admin:
          admin_pubkey: "0359A8F2CE1BEF95F583169B7DF053AA227A93B2652B0A9C22975FEED638032610"
    test:
      modules:
        - test
compile:
  rellVersion: 0.14.9
database:
  schema: schema_newschain
  
libs:
  ft4:
    registry: https://gitlab.com/chromaway/ft4-lib.git
    path: rell/src/lib/ft4
    tagOrBranch: v1.2.0r
    rid: x"E96915FD7C9A5DD4E183D86F4A5B4BB5083A7CC1EDEB1465EDFFC926E67C93F6"
    insecure: false
  iccf:
    registry: https://gitlab.com/chromaway/core/directory-chain
    path: src/lib/iccf
    tagOrBranch: 1.87.0
    rid: x"9C359787B75927733034EA1CEE74EEC8829D2907E4FC94790B5E9ABE4396575D"
    insecure: false
```

To learn more about the options available in `chromia.yml`, see the [Chromia project configuration documentation](https://docs.chromia.com/build/configuration/project-structure/).

Written for this site from Chromia’s public course. Code samples are the course’s own.

[← Previous**Part 2: Set up accounts**](https://chromia.com/learn/my-news-feed/module-one/create-accounts/)[Next →**Authentication with FT4 accounts**](https://chromia.com/learn/my-news-feed/module-one/create-accounts/authentication/)

On this page

* [Install the FT4 library](#install-the-ft4-library)
* [Configure FT4 accounts](#configure-ft4-accounts)
