feat(templates): create schemas for cuisines, tags, users, recipes, ingredients
This commit is contained in:
parent
e82e39165d
commit
d69b4a063b
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "pocketbase-lite",
|
||||
"version": "0.1.0",
|
||||
"paths": {
|
||||
"data": "collections/",
|
||||
"media": "media/",
|
||||
"indexes": ".gitapp/indexes/"
|
||||
},
|
||||
"schemas": [
|
||||
{
|
||||
"id": "cuisines",
|
||||
"file": "schemas/cuisines.json",
|
||||
"glob": "collections/cuisines/*.json"
|
||||
},
|
||||
{
|
||||
"id": "tags",
|
||||
"file": "schemas/tags.json",
|
||||
"glob": "collections/tags/*.json"
|
||||
},
|
||||
{
|
||||
"id": "users",
|
||||
"file": "schemas/users.json",
|
||||
"glob": "collections/users/*.json"
|
||||
},
|
||||
{
|
||||
"id": "recipes",
|
||||
"file": "schemas/recipes.json",
|
||||
"glob": "collections/recipes/*.json"
|
||||
},
|
||||
{
|
||||
"id": "ingredients",
|
||||
"file": "schemas/ingredients.json",
|
||||
"glob": "collections/ingredients/*.json"
|
||||
}
|
||||
],
|
||||
"operations": [],
|
||||
"policies": {
|
||||
"roles": [
|
||||
"viewer",
|
||||
"editor"
|
||||
],
|
||||
"acl": null
|
||||
},
|
||||
"lfs": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$id": "cuisines",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"region"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"region": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"flag": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"$id": "ingredients",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"quantity"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"quantity": {
|
||||
"type": "string"
|
||||
},
|
||||
"unit": {
|
||||
"type": "string"
|
||||
},
|
||||
"notes": {
|
||||
"type": "string"
|
||||
},
|
||||
"recipe": {
|
||||
"type": "string",
|
||||
"x-relation": {
|
||||
"collection": "recipes",
|
||||
"type": "single"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"$id": "recipes",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"title",
|
||||
"description"
|
||||
],
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"prepTime": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"cookTime": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"servings": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"instructions": {
|
||||
"type": "string"
|
||||
},
|
||||
"difficulty": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"easy",
|
||||
"medium",
|
||||
"hard"
|
||||
]
|
||||
},
|
||||
"author": {
|
||||
"type": "string",
|
||||
"x-relation": {
|
||||
"collection": "users",
|
||||
"type": "single"
|
||||
}
|
||||
},
|
||||
"cuisine": {
|
||||
"type": "string",
|
||||
"x-relation": {
|
||||
"collection": "cuisines",
|
||||
"type": "single"
|
||||
}
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"x-relation": {
|
||||
"collection": "tags",
|
||||
"type": "multiple",
|
||||
"maxItems": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"$id": "tags",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"color": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"$id": "users",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"bio": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue