Update ARHUT adding a new dataset tutorial authored by vinnetu's avatar vinnetu
Let us assume that we have a project called TheProject, so
# 📘 User Manual: Creating New Data Structures in Directus for your project
Let us assume that we have a project called TheProject that needs some new data tables to be used and shared in directus.io
# Create Data Model
## Create subfolder for the project
## 1. 🔐 Log into Admin Panel
Visit your Directus instance in the browser:
```
http://db.arh.ut.ee
```
Log in with an **admin account**.
---
## 2. 📁 Create a New Collection
This is carried out by database manager, contact the person.
1. In the left sidebar, click **Settings → Collections & Fields**.
2. Click the ➕ button in the top-right corner.
3. Name your collection, e.g. `academic_works`.
4. Optionally set:
- Icon: `book-open`
- Note: *Academic theses and dissertations*
5. Click **Save Collection**.
---
## 3. 🧱 Add Fields
Add your required fields one by one. For example for "theses" data table we required thoe fields,
and more:
| Field Name | Type | Interface | Required? |
|--------------|------------|------------------|-----------|
| `aasta` | Integer | Input | ✅ |
| `autor` | String | Input | ✅ |
| `pealkiri` | Text | Textarea or Input| ✅ |
| `asutus` | String | Input | ✅ |
| `juhendaja` | String | Input | ❌ |
| `asukoht` | Text | Textarea | ❌ |
> ℹ️ You can use the "Add Field" button to define each field, set its name, interface, and whether it's required.
Similarly create all your required collections
Similarly to Kohainfo, TARA etc.
---
## 4. 🔽 For a Select Field add
1. Add a new field:
- Name: `töö_tüüp`
- Type: `String`
- Interface: `Select Dropdown`
2. In **Options**, define choices:
```json
[
{ "text": "Magistritöö", "value": "magistritoo" },
{ "text": "Doktoritöö", "value": "doktoritoo" }
]
```
3. Enable “Allow None” if the field can be empty.
---
## 5. 🗂 Create subfolder for the project
Similarly and drag your newly created collections under it. (See Kohainfo, TARA etc.)
Then navigate to data management->ARHUT settings->Databases (Andmebaasid)(https://db.arh.ut.ee/admin/content/databases) and add a record for the folder to recently added.
Then navigate to related Views (Vaated, https://db.arh.ut.ee/admin/content/views) and a record for each of your newly created records.
## Create collections
Can a project manager do it or should it be done by a dedicated person?
## Associate data with other tables
......@@ -30,4 +97,14 @@ Create policies that allow required access to specific tables that are required
Webapp uses the same user policies as in Directus. Read more [how to make collection/view accessible via Arhut webapp](How-to-Make-Collection-Accessible-in-ARHUT-WebApp).
## 🔗 Resources
- 📘 [Directus UI Guide](https://docs.directus.io/guides/collections-fields/)
- 🔧 [Field Interfaces](https://docs.directus.io/reference/system/fields/#interfaces)
- 📥 [Importing Data](https://docs.directus.io/guides/import-csv/)
---
Experimental: [Creating data structures via API](Creating-data-structures-via-API)
\ No newline at end of file