Initial commit: Korrith website, assessment API, PocketBase schema, Docker/Coolify deployment

This commit is contained in:
Korrith
2026-09-17 20:47:51 +00:00
commit c17f11f591
248 changed files with 39721 additions and 0 deletions
@@ -0,0 +1,159 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((app) => {
const collection = new Collection({
"createRule": "",
"deleteRule": "@request.auth.collectionName = 'users' && @request.auth.role = 'admin'",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text9973129546",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "text7224323192",
"name": "firstName",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text",
"autogeneratePattern": "",
"max": 0,
"min": 0,
"pattern": ""
},
{
"hidden": false,
"id": "text8927180967",
"name": "lastName",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text",
"autogeneratePattern": "",
"max": 0,
"min": 0,
"pattern": ""
},
{
"hidden": false,
"id": "email3000958229",
"name": "email",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "email",
"exceptDomains": [],
"onlyDomains": []
},
{
"hidden": false,
"id": "json4467574208",
"name": "websites",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "json",
"maxSize": 0
},
{
"hidden": false,
"id": "json7565497650",
"name": "apps",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "json",
"maxSize": 0
},
{
"hidden": false,
"id": "json2686026609",
"name": "systems",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "json",
"maxSize": 0
},
{
"hidden": false,
"id": "text2579574645",
"name": "industry",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text",
"autogeneratePattern": "",
"max": 0,
"min": 0,
"pattern": ""
},
{
"hidden": false,
"id": "autodate2823430259",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate7741794431",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"id": "pbc_3506166606",
"indexes": [],
"listRule": "@request.auth.collectionName = 'users' && @request.auth.role = 'admin'",
"name": "assessments",
"system": false,
"type": "base",
"updateRule": "@request.auth.collectionName = 'users' && @request.auth.role = 'admin'",
"viewRule": "@request.auth.collectionName = 'users' && @request.auth.role = 'admin'"
});
try {
return app.save(collection);
} catch (e) {
if (e.message.includes("Collection name must be unique")) {
console.log("Collection already exists, skipping");
return;
}
throw e;
}
}, (app) => {
try {
const collection = app.findCollectionByNameOrId("pbc_3506166606");
return app.delete(collection);
} catch (e) {
if (e.message.includes("no rows in result set")) {
console.log("Collection not found, skipping revert");
return;
}
throw e;
}
})