diff --git a/.gitapp/.gitkeep b/.gitapp/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/manifest.json b/.gitapp/manifest.json new file mode 100644 index 0000000..be518db --- /dev/null +++ b/.gitapp/manifest.json @@ -0,0 +1,46 @@ +{ + "name": "pocketbase-lite", + "version": "0.1.0", + "paths": { + "data": "collections/", + "media": "media/", + "indexes": ".gitapp/indexes/" + }, + "schemas": [ + { + "id": "tags", + "file": "schemas/tags.json", + "glob": "collections/tags/*.json" + }, + { + "id": "folders", + "file": "schemas/folders.json", + "glob": "collections/folders/*.json" + }, + { + "id": "albums", + "file": "schemas/albums.json", + "glob": "collections/albums/*.json" + }, + { + "id": "media", + "file": "schemas/media.json", + "glob": "collections/media/*.json" + } + ], + "operations": [ + "create-record", + "update-record", + "delete-record" + ], + "policies": { + "roles": [ + "viewer", + "editor" + ], + "acl": null + }, + "lfs": { + "enabled": false + } +} \ No newline at end of file diff --git a/.gitapp/operations/.gitkeep b/.gitapp/operations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/operations/create-record.yaml b/.gitapp/operations/create-record.yaml new file mode 100644 index 0000000..1037449 --- /dev/null +++ b/.gitapp/operations/create-record.yaml @@ -0,0 +1,20 @@ +name: create-record +version: 1 +scope: + subtree: "collections/" +input: + $schema: zod + schema: | + z.object({ + collection: z.string().min(1), + id: z.string().min(1), + data: z.record(z.unknown()) + }) +preconditions: [] +mutations: + - type: create_file + path: "collections/${input.collection}/${input.id}.json" + content: "${JSON.stringify(input.data, null, 2)}" +commit: + message: "feat(data): create ${input.collection} record ${input.id}" + updateRef: "refs/heads/main" diff --git a/.gitapp/operations/delete-record.yaml b/.gitapp/operations/delete-record.yaml new file mode 100644 index 0000000..e2425c8 --- /dev/null +++ b/.gitapp/operations/delete-record.yaml @@ -0,0 +1,20 @@ +name: delete-record +version: 1 +scope: + subtree: "collections/" +input: + $schema: zod + schema: | + z.object({ + collection: z.string().min(1), + id: z.string().min(1) + }) +preconditions: + - type: path_exists + path: "collections/${input.collection}/${input.id}.json" +mutations: + - type: delete_file + path: "collections/${input.collection}/${input.id}.json" +commit: + message: "feat(data): delete ${input.collection} record ${input.id}" + updateRef: "refs/heads/main" diff --git a/.gitapp/operations/update-record.yaml b/.gitapp/operations/update-record.yaml new file mode 100644 index 0000000..bb9ece0 --- /dev/null +++ b/.gitapp/operations/update-record.yaml @@ -0,0 +1,22 @@ +name: update-record +version: 1 +scope: + subtree: "collections/" +input: + $schema: zod + schema: | + z.object({ + collection: z.string().min(1), + id: z.string().min(1), + data: z.record(z.unknown()) + }) +preconditions: + - type: path_exists + path: "collections/${input.collection}/${input.id}.json" +mutations: + - type: create_file + path: "collections/${input.collection}/${input.id}.json" + content: "${JSON.stringify(input.data, null, 2)}" +commit: + message: "feat(data): update ${input.collection} record ${input.id}" + updateRef: "refs/heads/main" diff --git a/.gitapp/schemas/.gitkeep b/.gitapp/schemas/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/schemas/albums.json b/.gitapp/schemas/albums.json new file mode 100644 index 0000000..60b7a06 --- /dev/null +++ b/.gitapp/schemas/albums.json @@ -0,0 +1,21 @@ +{ + "$id": "albums", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string" + }, + "coverImage": { + "type": "string", + "description": "URL or path to cover image" + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/folders.json b/.gitapp/schemas/folders.json new file mode 100644 index 0000000..5739a12 --- /dev/null +++ b/.gitapp/schemas/folders.json @@ -0,0 +1,24 @@ +{ + "$id": "folders", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string" + }, + "parent": { + "type": "string", + "x-relation": { + "collection": "folders", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/media.json b/.gitapp/schemas/media.json new file mode 100644 index 0000000..f66eb83 --- /dev/null +++ b/.gitapp/schemas/media.json @@ -0,0 +1,78 @@ +{ + "$id": "media", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "title" + ], + "properties": { + "title": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string" + }, + "file": { + "type": "object", + "description": "File metadata (path, filename, mimeType, size)", + "x-file": { + "maxSize": 10485760, + "mimeTypes": [ + "image/jpeg", + "image/png", + "image/webp", + "image/gif" + ] + } + }, + "width": { + "type": "integer", + "minimum": 1, + "description": "Image width in pixels" + }, + "height": { + "type": "integer", + "minimum": 1, + "description": "Image height in pixels" + }, + "format": { + "type": "string", + "description": "Image format (jpeg, png, webp, gif)" + }, + "fileSize": { + "type": "integer", + "minimum": 0, + "description": "File size in bytes" + }, + "folder": { + "type": "string", + "x-relation": { + "collection": "folders", + "type": "single" + } + }, + "albums": { + "type": "array", + "items": { + "type": "string" + }, + "x-relation": { + "collection": "albums", + "type": "multiple", + "maxItems": 10 + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "x-relation": { + "collection": "tags", + "type": "multiple", + "maxItems": 20 + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/tags.json b/.gitapp/schemas/tags.json new file mode 100644 index 0000000..bfb365e --- /dev/null +++ b/.gitapp/schemas/tags.json @@ -0,0 +1,22 @@ +{ + "$id": "tags", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "slug" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "slug": { + "type": "string" + }, + "color": { + "type": "string", + "description": "Hex color for UI badges" + } + } +} \ No newline at end of file diff --git a/collections/albums/.gitkeep b/collections/albums/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/folders/.gitkeep b/collections/folders/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/media/.gitkeep b/collections/media/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/tags/.gitkeep b/collections/tags/.gitkeep new file mode 100644 index 0000000..e69de29