From d4f4d73aef06d6c96878a6f5feff0f939ed802f2 Mon Sep 17 00:00:00 2001 From: GitApp Date: Fri, 19 Dec 2025 16:02:44 +0000 Subject: [PATCH] feat(templates): create schemas for genres, people, movies, cast, reviews --- .gitapp/.gitkeep | 0 .gitapp/manifest.json | 51 ++++++++++++++++++++++++ .gitapp/operations/.gitkeep | 0 .gitapp/operations/create-record.yaml | 20 ++++++++++ .gitapp/operations/delete-record.yaml | 20 ++++++++++ .gitapp/operations/update-record.yaml | 22 +++++++++++ .gitapp/schemas/.gitkeep | 0 .gitapp/schemas/cast.json | 31 +++++++++++++++ .gitapp/schemas/genres.json | 21 ++++++++++ .gitapp/schemas/movies.json | 56 +++++++++++++++++++++++++++ .gitapp/schemas/people.json | 27 +++++++++++++ .gitapp/schemas/reviews.json | 37 ++++++++++++++++++ collections/cast/.gitkeep | 0 collections/genres/.gitkeep | 0 collections/movies/.gitkeep | 0 collections/people/.gitkeep | 0 collections/reviews/.gitkeep | 0 17 files changed, 285 insertions(+) create mode 100644 .gitapp/.gitkeep create mode 100644 .gitapp/manifest.json create mode 100644 .gitapp/operations/.gitkeep create mode 100644 .gitapp/operations/create-record.yaml create mode 100644 .gitapp/operations/delete-record.yaml create mode 100644 .gitapp/operations/update-record.yaml create mode 100644 .gitapp/schemas/.gitkeep create mode 100644 .gitapp/schemas/cast.json create mode 100644 .gitapp/schemas/genres.json create mode 100644 .gitapp/schemas/movies.json create mode 100644 .gitapp/schemas/people.json create mode 100644 .gitapp/schemas/reviews.json create mode 100644 collections/cast/.gitkeep create mode 100644 collections/genres/.gitkeep create mode 100644 collections/movies/.gitkeep create mode 100644 collections/people/.gitkeep create mode 100644 collections/reviews/.gitkeep 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..7421382 --- /dev/null +++ b/.gitapp/manifest.json @@ -0,0 +1,51 @@ +{ + "name": "pocketbase-lite", + "version": "0.1.0", + "paths": { + "data": "collections/", + "media": "media/", + "indexes": ".gitapp/indexes/" + }, + "schemas": [ + { + "id": "genres", + "file": "schemas/genres.json", + "glob": "collections/genres/*.json" + }, + { + "id": "people", + "file": "schemas/people.json", + "glob": "collections/people/*.json" + }, + { + "id": "movies", + "file": "schemas/movies.json", + "glob": "collections/movies/*.json" + }, + { + "id": "cast", + "file": "schemas/cast.json", + "glob": "collections/cast/*.json" + }, + { + "id": "reviews", + "file": "schemas/reviews.json", + "glob": "collections/reviews/*.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/cast.json b/.gitapp/schemas/cast.json new file mode 100644 index 0000000..fda2370 --- /dev/null +++ b/.gitapp/schemas/cast.json @@ -0,0 +1,31 @@ +{ + "$id": "cast", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "character" + ], + "properties": { + "character": { + "type": "string" + }, + "billing": { + "type": "integer", + "minimum": 1 + }, + "movie": { + "type": "string", + "x-relation": { + "collection": "movies", + "type": "single" + } + }, + "actor": { + "type": "string", + "x-relation": { + "collection": "people", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/genres.json b/.gitapp/schemas/genres.json new file mode 100644 index 0000000..23db17d --- /dev/null +++ b/.gitapp/schemas/genres.json @@ -0,0 +1,21 @@ +{ + "$id": "genres", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "slug" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "slug": { + "type": "string" + }, + "description": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/movies.json b/.gitapp/schemas/movies.json new file mode 100644 index 0000000..1ef381e --- /dev/null +++ b/.gitapp/schemas/movies.json @@ -0,0 +1,56 @@ +{ + "$id": "movies", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "title", + "year" + ], + "properties": { + "title": { + "type": "string", + "minLength": 1 + }, + "year": { + "type": "integer", + "minimum": 1900, + "maximum": 2030 + }, + "runtime": { + "type": "integer", + "minimum": 1 + }, + "plot": { + "type": "string" + }, + "poster": { + "type": "string" + }, + "rating": { + "type": "number", + "minimum": 0, + "maximum": 10 + }, + "budget": { + "type": "string" + }, + "director": { + "type": "string", + "x-relation": { + "collection": "people", + "type": "single" + } + }, + "genres": { + "type": "array", + "items": { + "type": "string" + }, + "x-relation": { + "collection": "genres", + "type": "multiple", + "maxItems": 5 + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/people.json b/.gitapp/schemas/people.json new file mode 100644 index 0000000..dea5090 --- /dev/null +++ b/.gitapp/schemas/people.json @@ -0,0 +1,27 @@ +{ + "$id": "people", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "bio": { + "type": "string" + }, + "birthDate": { + "type": "string", + "format": "date" + }, + "photo": { + "type": "string" + }, + "knownFor": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/reviews.json b/.gitapp/schemas/reviews.json new file mode 100644 index 0000000..ae74010 --- /dev/null +++ b/.gitapp/schemas/reviews.json @@ -0,0 +1,37 @@ +{ + "$id": "reviews", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "rating", + "content" + ], + "properties": { + "rating": { + "type": "number", + "minimum": 1, + "maximum": 10 + }, + "content": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date-time" + }, + "movie": { + "type": "string", + "x-relation": { + "collection": "movies", + "type": "single" + } + }, + "author": { + "type": "string", + "x-relation": { + "collection": "people", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/collections/cast/.gitkeep b/collections/cast/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/genres/.gitkeep b/collections/genres/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/movies/.gitkeep b/collections/movies/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/people/.gitkeep b/collections/people/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/reviews/.gitkeep b/collections/reviews/.gitkeep new file mode 100644 index 0000000..e69de29