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..1525246 --- /dev/null +++ b/.gitapp/manifest.json @@ -0,0 +1,56 @@ +{ + "name": "pocketbase-lite", + "version": "0.1.0", + "paths": { + "data": "collections/", + "media": "media/", + "indexes": ".gitapp/indexes/" + }, + "schemas": [ + { + "id": "users", + "file": "schemas/users.json", + "glob": "collections/users/*.json" + }, + { + "id": "labels", + "file": "schemas/labels.json", + "glob": "collections/labels/*.json" + }, + { + "id": "projects", + "file": "schemas/projects.json", + "glob": "collections/projects/*.json" + }, + { + "id": "sprints", + "file": "schemas/sprints.json", + "glob": "collections/sprints/*.json" + }, + { + "id": "issues", + "file": "schemas/issues.json", + "glob": "collections/issues/*.json" + }, + { + "id": "comments", + "file": "schemas/comments.json", + "glob": "collections/comments/*.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/comments.json b/.gitapp/schemas/comments.json new file mode 100644 index 0000000..eef578d --- /dev/null +++ b/.gitapp/schemas/comments.json @@ -0,0 +1,32 @@ +{ + "$id": "comments", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "content" + ], + "properties": { + "content": { + "type": "string", + "minLength": 1 + }, + "date": { + "type": "string", + "format": "date-time" + }, + "issue": { + "type": "string", + "x-relation": { + "collection": "issues", + "type": "single" + } + }, + "author": { + "type": "string", + "x-relation": { + "collection": "users", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/issues.json b/.gitapp/schemas/issues.json new file mode 100644 index 0000000..ad4e748 --- /dev/null +++ b/.gitapp/schemas/issues.json @@ -0,0 +1,95 @@ +{ + "$id": "issues", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "title", + "type", + "status" + ], + "properties": { + "title": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "bug", + "feature", + "task", + "story", + "epic" + ] + }, + "priority": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "status": { + "type": "string", + "enum": [ + "backlog", + "todo", + "in_progress", + "review", + "done" + ] + }, + "estimate": { + "type": "integer", + "minimum": 0 + }, + "dueDate": { + "type": "string", + "format": "date" + }, + "project": { + "type": "string", + "x-relation": { + "collection": "projects", + "type": "single" + } + }, + "assignee": { + "type": "string", + "x-relation": { + "collection": "users", + "type": "single" + } + }, + "reporter": { + "type": "string", + "x-relation": { + "collection": "users", + "type": "single" + } + }, + "labels": { + "type": "array", + "items": { + "type": "string" + }, + "x-relation": { + "collection": "labels", + "type": "multiple", + "maxItems": 5 + } + }, + "sprint": { + "type": "string", + "x-relation": { + "collection": "sprints", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/labels.json b/.gitapp/schemas/labels.json new file mode 100644 index 0000000..17f2f45 --- /dev/null +++ b/.gitapp/schemas/labels.json @@ -0,0 +1,21 @@ +{ + "$id": "labels", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "color" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "color": { + "type": "string" + }, + "description": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/projects.json b/.gitapp/schemas/projects.json new file mode 100644 index 0000000..667eae2 --- /dev/null +++ b/.gitapp/schemas/projects.json @@ -0,0 +1,42 @@ +{ + "$id": "projects", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "key" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "key": { + "type": "string", + "minLength": 2, + "maxLength": 5 + }, + "description": { + "type": "string" + }, + "color": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "on-hold", + "completed", + "archived" + ] + }, + "lead": { + "type": "string", + "x-relation": { + "collection": "users", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/sprints.json b/.gitapp/schemas/sprints.json new file mode 100644 index 0000000..ec2191e --- /dev/null +++ b/.gitapp/schemas/sprints.json @@ -0,0 +1,34 @@ +{ + "$id": "sprints", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "startDate", + "endDate" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "startDate": { + "type": "string", + "format": "date" + }, + "endDate": { + "type": "string", + "format": "date" + }, + "goal": { + "type": "string" + }, + "project": { + "type": "string", + "x-relation": { + "collection": "projects", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/users.json b/.gitapp/schemas/users.json new file mode 100644 index 0000000..7047b19 --- /dev/null +++ b/.gitapp/schemas/users.json @@ -0,0 +1,32 @@ +{ + "$id": "users", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "email" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "email": { + "type": "string", + "format": "email" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "enum": [ + "admin", + "developer", + "designer", + "qa", + "pm" + ] + } + } +} \ No newline at end of file diff --git a/collections/comments/.gitkeep b/collections/comments/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/issues/.gitkeep b/collections/issues/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/labels/.gitkeep b/collections/labels/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/projects/.gitkeep b/collections/projects/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/sprints/.gitkeep b/collections/sprints/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/users/.gitkeep b/collections/users/.gitkeep new file mode 100644 index 0000000..e69de29