Initial commit

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-11 15:55:14 -04:00
commit 290ff0bc1e
41 changed files with 7998 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
# Directus Setup Contract
This repository uses Directus as a content-only CMS. Layout stays in Astro.
## Collections
- `news`
- `events`
- `notices`
- `fuel_prices`
- `documents`
- `contacts`
- `tags`
## Important relations
- `news` many-to-many `tags`
- `events` many-to-many `tags`
## Runtime configuration
All deploy-time settings live in the root `.env` file and are consumed by Docker Compose.
Required variables include:
- `POSTGRES_DB`
- `POSTGRES_USER`
- `POSTGRES_PASSWORD`
- `DIRECTUS_KEY`
- `DIRECTUS_SECRET`
- `DIRECTUS_ADMIN_EMAIL`
- `DIRECTUS_ADMIN_PASSWORD`
- `DIRECTUS_PUBLIC_URL`
- `DIRECTUS_CORS_ORIGIN`
- `PUBLIC_SITE_URL`
- `DIRECTUS_URL`
- `FRONTEND_PORT`
- `DIRECTUS_PORT`
+180
View File
@@ -0,0 +1,180 @@
{
"version": 1,
"collections": [
{
"collection": "tags",
"meta": {
"icon": "sell",
"hidden": false,
"singleton": false,
"note": "Managed by directus/schema-snapshot.json"
},
"fields": [
{
"field": "id",
"type": "integer",
"meta": { "hidden": true }
},
{
"field": "name",
"type": "string",
"meta": { "required": true, "interface": "input" },
"schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false }
},
{
"field": "slug",
"type": "string",
"meta": { "required": true, "interface": "input" },
"schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false }
}
]
},
{
"collection": "news",
"meta": { "icon": "article", "hidden": false, "singleton": false, "note": "Managed by directus/schema-snapshot.json" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "title", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "slug", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "body", "type": "text", "meta": { "interface": "input-multiline" }, "schema": { "data_type": "text" } },
{ "field": "summary", "type": "text", "meta": { "interface": "input-multiline" }, "schema": { "data_type": "text" } },
{ "field": "featured_image", "type": "uuid", "meta": { "interface": "select-dropdown-m2o" }, "schema": { "data_type": "uuid" } },
{ "field": "status", "type": "string", "schema": { "data_type": "varchar", "max_length": 255 } },
{ "field": "publish_date", "type": "timestamp", "meta": { "interface": "datetime" }, "schema": { "data_type": "timestamp with time zone" } },
{ "field": "author", "type": "string", "schema": { "data_type": "varchar", "max_length": 255 } }
]
},
{
"collection": "events",
"meta": { "icon": "event", "hidden": false, "singleton": false, "note": "Managed by directus/schema-snapshot.json" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "title", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "slug", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "description", "type": "text", "meta": { "interface": "input-multiline" }, "schema": { "data_type": "text" } },
{ "field": "start_datetime", "type": "timestamp", "meta": { "required": true, "interface": "datetime" }, "schema": { "data_type": "timestamp with time zone", "is_nullable": false } },
{ "field": "end_datetime", "type": "timestamp", "meta": { "interface": "datetime" }, "schema": { "data_type": "timestamp with time zone" } },
{ "field": "location_text", "type": "string", "schema": { "data_type": "varchar", "max_length": 255 } },
{ "field": "image", "type": "uuid", "meta": { "interface": "select-dropdown-m2o" }, "schema": { "data_type": "uuid" } },
{ "field": "registration_link", "type": "string", "schema": { "data_type": "varchar", "max_length": 500 } },
{ "field": "status", "type": "string", "schema": { "data_type": "varchar", "max_length": 255 } },
{ "field": "is_featured", "type": "boolean", "meta": { "interface": "boolean" }, "schema": { "data_type": "boolean", "default_value": false } }
]
},
{
"collection": "notices",
"meta": { "icon": "campaign", "hidden": false, "singleton": false, "note": "Managed by directus/schema-snapshot.json" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "title", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "message", "type": "text", "meta": { "required": true, "interface": "input-multiline" }, "schema": { "data_type": "text", "is_nullable": false } },
{ "field": "severity", "type": "string", "meta": { "interface": "select-dropdown" }, "schema": { "data_type": "varchar", "max_length": 20, "default_value": "info" } },
{ "field": "start_date", "type": "date", "meta": { "interface": "datetime" }, "schema": { "data_type": "date" } },
{ "field": "end_date", "type": "date", "meta": { "interface": "datetime" }, "schema": { "data_type": "date" } },
{ "field": "active", "type": "boolean", "meta": { "interface": "boolean" }, "schema": { "data_type": "boolean", "default_value": true } },
{ "field": "priority", "type": "integer", "meta": { "interface": "input" }, "schema": { "data_type": "integer", "default_value": 0 } }
]
},
{
"collection": "fuel_prices",
"meta": { "icon": "local_gas_station", "hidden": false, "singleton": false, "note": "Managed by directus/schema-snapshot.json" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "fuel_type", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "price_per_litre", "type": "decimal", "meta": { "required": true }, "schema": { "data_type": "decimal", "numeric_precision": 10, "numeric_scale": 2, "is_nullable": false } },
{ "field": "currency", "type": "string", "schema": { "data_type": "varchar", "max_length": 3, "default_value": "GBP" } },
{ "field": "last_updated", "type": "timestamp", "meta": { "interface": "datetime" }, "schema": { "data_type": "timestamp with time zone" } },
{ "field": "notes", "type": "text", "meta": { "interface": "input-multiline" }, "schema": { "data_type": "text" } }
]
},
{
"collection": "documents",
"meta": { "icon": "description", "hidden": false, "singleton": false, "note": "Managed by directus/schema-snapshot.json" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "title", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "file", "type": "uuid", "meta": { "interface": "select-dropdown-m2o" }, "schema": { "data_type": "uuid" } },
{ "field": "category", "type": "string", "schema": { "data_type": "varchar", "max_length": 255 } },
{ "field": "description", "type": "text", "meta": { "interface": "input-multiline" }, "schema": { "data_type": "text" } },
{ "field": "uploaded_at", "type": "timestamp", "meta": { "interface": "datetime" }, "schema": { "data_type": "timestamp with time zone" } }
]
},
{
"collection": "contacts",
"meta": { "icon": "contacts", "hidden": false, "singleton": false, "note": "Managed by directus/schema-snapshot.json" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "name", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "role", "type": "string", "schema": { "data_type": "varchar", "max_length": 255 } },
{ "field": "email", "type": "string", "meta": { "required": true }, "schema": { "data_type": "varchar", "max_length": 255, "is_nullable": false } },
{ "field": "phone", "type": "string", "schema": { "data_type": "varchar", "max_length": 20 } },
{ "field": "is_public", "type": "boolean", "meta": { "interface": "boolean" }, "schema": { "data_type": "boolean", "default_value": true } },
{ "field": "order", "type": "integer", "meta": { "interface": "input" }, "schema": { "data_type": "integer", "default_value": 0 } }
]
},
{
"collection": "news_tags",
"meta": { "icon": "link", "hidden": true, "singleton": false, "note": "Junction for news → tags M2M" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "news_id", "type": "integer", "meta": { "required": true }, "schema": { "data_type": "integer", "is_nullable": false } },
{ "field": "tag_id", "type": "integer", "meta": { "required": true }, "schema": { "data_type": "integer", "is_nullable": false } }
]
},
{
"collection": "events_tags",
"meta": { "icon": "link", "hidden": true, "singleton": false, "note": "Junction for events → tags M2M" },
"fields": [
{ "field": "id", "type": "integer", "meta": { "hidden": true } },
{ "field": "event_id", "type": "integer", "meta": { "required": true }, "schema": { "data_type": "integer", "is_nullable": false } },
{ "field": "tag_id", "type": "integer", "meta": { "required": true }, "schema": { "data_type": "integer", "is_nullable": false } }
]
}
],
"relations": [
{
"collection": "news_tags",
"field": "news_id",
"related_collection": "news",
"schema": { "on_delete": "CASCADE" },
"meta": {
"one_collection": "news",
"one_field": "tags",
"one_deselect_action": "nullify"
}
},
{
"collection": "news_tags",
"field": "tag_id",
"related_collection": "tags",
"schema": { "on_delete": "CASCADE" },
"meta": {
"one_collection": "tags",
"one_field": "news_items",
"one_deselect_action": "nullify"
}
},
{
"collection": "events_tags",
"field": "event_id",
"related_collection": "events",
"schema": { "on_delete": "CASCADE" },
"meta": {
"one_collection": "events",
"one_field": "tags",
"one_deselect_action": "nullify"
}
},
{
"collection": "events_tags",
"field": "tag_id",
"related_collection": "tags",
"schema": { "on_delete": "CASCADE" },
"meta": {
"one_collection": "tags",
"one_field": "events_items",
"one_deselect_action": "nullify"
}
}
]
}
+89
View File
@@ -0,0 +1,89 @@
{
"collections": {
"news": {
"fields": [
"title",
"slug",
"body",
"summary",
"featured_image",
"status",
"publish_date",
"author",
"tags"
]
},
"events": {
"fields": [
"title",
"slug",
"description",
"start_datetime",
"end_datetime",
"location_text",
"image",
"registration_link",
"status",
"is_featured",
"tags"
]
},
"notices": {
"fields": [
"title",
"message",
"severity",
"start_date",
"end_date",
"active",
"priority"
]
},
"fuel_prices": {
"fields": [
"fuel_type",
"price_per_litre",
"currency",
"last_updated",
"notes"
]
},
"documents": {
"fields": [
"title",
"file",
"category",
"description",
"uploaded_at"
]
},
"contacts": {
"fields": [
"name",
"role",
"email",
"phone",
"is_public",
"order"
]
},
"tags": {
"fields": [
"name",
"slug"
]
}
},
"relations": {
"news_tags": {
"left": "news",
"right": "tags",
"type": "many-to-many"
},
"events_tags": {
"left": "events",
"right": "tags",
"type": "many-to-many"
}
}
}