Files
portfolio/directus-schema/tech-stack-schema.json
denshooter e431ff50fc feat: Add Directus setup scripts for collections, fields, and relations
- Created setup-directus-collections.js to automate the creation of tech stack collections, fields, and relations in Directus.
- Created setup-directus-hobbies.js for setting up hobbies collection with translations.
- Created setup-directus-projects.js for establishing projects collection with comprehensive fields and translations.
- Added setup-tech-stack-directus.js to populate tech_stack_items with predefined data.
2026-01-23 02:53:31 +01:00

405 lines
10 KiB
JSON

{
"version": 1,
"directus": "10.x",
"collections": [
{
"collection": "tech_stack_categories",
"meta": {
"icon": "layers",
"display_template": "{{translations.name}}",
"hidden": false,
"singleton": false,
"translations": [
{
"language": "en-US",
"translation": "Tech Stack Categories"
},
{
"language": "de-DE",
"translation": "Tech Stack Kategorien"
}
],
"sort_field": "sort"
},
"schema": {
"name": "tech_stack_categories"
},
"fields": [
{
"field": "id",
"type": "uuid",
"meta": {
"hidden": true,
"readonly": true,
"interface": "input",
"special": ["uuid"]
},
"schema": {
"is_primary_key": true,
"has_auto_increment": false
}
},
{
"field": "status",
"type": "string",
"meta": {
"width": "full",
"options": {
"choices": [
{ "text": "Published", "value": "published" },
{ "text": "Draft", "value": "draft" },
{ "text": "Archived", "value": "archived" }
]
},
"interface": "select-dropdown",
"display": "labels",
"display_options": {
"choices": [
{
"text": "Published",
"value": "published",
"foreground": "#FFFFFF",
"background": "#00C897"
},
{
"text": "Draft",
"value": "draft",
"foreground": "#18222F",
"background": "#D3DAE4"
},
{
"text": "Archived",
"value": "archived",
"foreground": "#FFFFFF",
"background": "#F7971C"
}
]
}
},
"schema": {
"default_value": "draft",
"is_nullable": false
}
},
{
"field": "sort",
"type": "integer",
"meta": {
"interface": "input",
"hidden": true
},
"schema": {}
},
{
"field": "key",
"type": "string",
"meta": {
"interface": "input",
"width": "half",
"options": {
"placeholder": "e.g. frontend, backend, devops"
},
"note": "Unique identifier for the category (no spaces, lowercase)"
},
"schema": {
"is_unique": true,
"is_nullable": false
}
},
{
"field": "icon",
"type": "string",
"meta": {
"interface": "select-dropdown",
"width": "half",
"options": {
"choices": [
{ "text": "Globe (Frontend)", "value": "Globe" },
{ "text": "Server (Backend)", "value": "Server" },
{ "text": "Wrench (Tools)", "value": "Wrench" },
{ "text": "Shield (Security)", "value": "Shield" },
{ "text": "Code", "value": "Code" },
{ "text": "Database", "value": "Database" },
{ "text": "Cloud", "value": "Cloud" }
]
},
"note": "Icon from lucide-react library"
},
"schema": {
"default_value": "Code"
}
},
{
"field": "date_created",
"type": "timestamp",
"meta": {
"special": ["date-created"],
"interface": "datetime",
"readonly": true,
"hidden": true,
"width": "half",
"display": "datetime",
"display_options": {
"relative": true
}
},
"schema": {}
},
{
"field": "date_updated",
"type": "timestamp",
"meta": {
"special": ["date-updated"],
"interface": "datetime",
"readonly": true,
"hidden": true,
"width": "half",
"display": "datetime",
"display_options": {
"relative": true
}
},
"schema": {}
},
{
"field": "translations",
"type": "alias",
"meta": {
"special": ["translations"],
"interface": "translations",
"options": {
"languageField": "languages_code"
}
}
}
]
},
{
"collection": "tech_stack_categories_translations",
"meta": {
"hidden": true,
"icon": "import_export",
"translations": [
{
"language": "en-US",
"translation": "Tech Stack Categories Translations"
}
]
},
"schema": {
"name": "tech_stack_categories_translations"
},
"fields": [
{
"field": "id",
"type": "integer",
"meta": {
"hidden": true
},
"schema": {
"is_primary_key": true,
"has_auto_increment": true
}
},
{
"field": "tech_stack_categories_id",
"type": "uuid",
"meta": {
"hidden": true
},
"schema": {}
},
{
"field": "languages_code",
"type": "string",
"meta": {
"width": "half",
"interface": "select-dropdown-m2o",
"options": {
"template": "{{name}}"
}
},
"schema": {}
},
{
"field": "name",
"type": "string",
"meta": {
"interface": "input",
"options": {
"placeholder": "e.g. Frontend & Mobile"
},
"note": "Translated category name"
},
"schema": {}
}
]
},
{
"collection": "tech_stack_items",
"meta": {
"icon": "code",
"display_template": "{{name}} ({{category.translations.name}})",
"hidden": false,
"singleton": false,
"translations": [
{
"language": "en-US",
"translation": "Tech Stack Items"
},
{
"language": "de-DE",
"translation": "Tech Stack Items"
}
],
"sort_field": "sort"
},
"schema": {
"name": "tech_stack_items"
},
"fields": [
{
"field": "id",
"type": "uuid",
"meta": {
"hidden": true,
"readonly": true,
"interface": "input",
"special": ["uuid"]
},
"schema": {
"is_primary_key": true,
"has_auto_increment": false
}
},
{
"field": "sort",
"type": "integer",
"meta": {
"interface": "input",
"hidden": true
},
"schema": {}
},
{
"field": "category",
"type": "uuid",
"meta": {
"interface": "select-dropdown-m2o",
"width": "half",
"display": "related-values",
"display_options": {
"template": "{{translations.name}}"
}
},
"schema": {}
},
{
"field": "name",
"type": "string",
"meta": {
"interface": "input",
"width": "half",
"options": {
"placeholder": "e.g. Next.js, Docker, Tailwind CSS"
},
"note": "Technology name (same in all languages)"
},
"schema": {
"is_nullable": false
}
},
{
"field": "url",
"type": "string",
"meta": {
"interface": "input",
"width": "half",
"options": {
"placeholder": "https://nextjs.org"
},
"note": "Official website (optional)"
},
"schema": {}
},
{
"field": "icon_url",
"type": "string",
"meta": {
"interface": "input",
"width": "half",
"options": {
"placeholder": "https://..."
},
"note": "Custom icon/logo URL (optional)"
},
"schema": {}
},
{
"field": "date_created",
"type": "timestamp",
"meta": {
"special": ["date-created"],
"interface": "datetime",
"readonly": true,
"hidden": true
},
"schema": {}
},
{
"field": "date_updated",
"type": "timestamp",
"meta": {
"special": ["date-updated"],
"interface": "datetime",
"readonly": true,
"hidden": true
},
"schema": {}
}
]
}
],
"relations": [
{
"collection": "tech_stack_categories_translations",
"field": "tech_stack_categories_id",
"related_collection": "tech_stack_categories",
"meta": {
"one_field": "translations",
"sort_field": null,
"one_deselect_action": "delete"
},
"schema": {
"on_delete": "CASCADE"
}
},
{
"collection": "tech_stack_categories_translations",
"field": "languages_code",
"related_collection": "languages",
"meta": {
"one_field": null,
"sort_field": null,
"one_deselect_action": "nullify"
},
"schema": {
"on_delete": "SET NULL"
}
},
{
"collection": "tech_stack_items",
"field": "category",
"related_collection": "tech_stack_categories",
"meta": {
"one_field": "items",
"sort_field": "sort",
"one_deselect_action": "nullify"
},
"schema": {
"on_delete": "SET NULL"
}
}
]
}