Skip to content

Commit

Permalink
mvp
Browse files Browse the repository at this point in the history
  • Loading branch information
lastarc committed Jun 24, 2024
1 parent 8b4631d commit ccd191d
Show file tree
Hide file tree
Showing 28 changed files with 1,023 additions and 37 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ Thumbs.db
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# Intellij
.idea

# PocketBase
/pb_data
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "niko",
"name": "nikk",
"version": "0.0.1",
"private": true,
"scripts": {
Expand All @@ -20,21 +20,24 @@
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^8.56.7",
"bulma": "^1.0.1",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"sass": "^1.77.5",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0-alpha.20",
"vite": "^5.0.3",
"vitest": "^1.2.0",
"bulma": "^1.0.1",
"sass": "^1.77.5"
"vitest": "^1.2.0"
},
"type": "module"
"type": "module",
"dependencies": {
"pocketbase": "^0.21.3"
}
}
60 changes: 60 additions & 0 deletions pb_migrations/1718834233_created_profiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const collection = new Collection({
id: 'etdl54k56vwybrn',
created: '2024-06-19 21:57:13.774Z',
updated: '2024-06-19 21:57:13.774Z',
name: 'profiles',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'vodgbchi',
name: 'user',
type: 'relation',
required: true,
presentable: false,
unique: false,
options: {
collectionId: '_pb_users_auth_',
cascadeDelete: true,
minSelect: null,
maxSelect: 1,
displayFields: null
}
},
{
system: false,
id: 'ykt3zolr',
name: 'name',
type: 'text',
required: true,
presentable: false,
unique: false,
options: {
min: null,
max: null,
pattern: ''
}
}
],
indexes: ['CREATE INDEX `idx_VTowXf1` ON `profiles` (`name`)'],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {}
});

return Dao(db).saveCollection(collection);
},
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('etdl54k56vwybrn');

return dao.deleteCollection(collection);
}
);
81 changes: 81 additions & 0 deletions pb_migrations/1718834453_created_characters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const collection = new Collection({
id: 'i7mafqbep52hivh',
created: '2024-06-19 22:00:53.918Z',
updated: '2024-06-19 22:00:53.918Z',
name: 'characters',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'mn4unycx',
name: 'name',
type: 'text',
required: true,
presentable: false,
unique: false,
options: {
min: null,
max: null,
pattern: ''
}
},
{
system: false,
id: '47sgeg6w',
name: 'displayName',
type: 'text',
required: true,
presentable: false,
unique: false,
options: {
min: null,
max: null,
pattern: ''
}
},
{
system: false,
id: 'urnacitl',
name: 'element',
type: 'select',
required: true,
presentable: false,
unique: false,
options: {
maxSelect: 1,
values: ['pyro', 'hydro', 'anemo', 'electro', 'dendro', 'cryo', 'geo']
}
},
{
system: false,
id: 'mhmjqqet',
name: 'visible',
type: 'bool',
required: false,
presentable: false,
unique: false,
options: {}
}
],
indexes: ['CREATE UNIQUE INDEX `idx_Fd6ZMqS` ON `characters` (`name`)'],
listRule: 'visible = true',
viewRule: 'visible = true',
createRule: null,
updateRule: null,
deleteRule: null,
options: {}
});

return Dao(db).saveCollection(collection);
},
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('i7mafqbep52hivh');

return dao.deleteCollection(collection);
}
);
27 changes: 27 additions & 0 deletions pb_migrations/1718834489_updated_profiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('etdl54k56vwybrn');

collection.listRule = '@request.auth.id = user.id';
collection.viewRule = '@request.auth.id = user.id';
collection.createRule = '@request.auth.id = user.id';
collection.updateRule = '@request.auth.id = user.id';
collection.deleteRule = '@request.auth.id = user.id';

return dao.saveCollection(collection);
},
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('etdl54k56vwybrn');

collection.listRule = null;
collection.viewRule = null;
collection.createRule = null;
collection.updateRule = null;
collection.deleteRule = null;

return dao.saveCollection(collection);
}
);
76 changes: 76 additions & 0 deletions pb_migrations/1718834637_created_votes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const collection = new Collection({
id: '2q5l1u64zseldm9',
created: '2024-06-19 22:03:57.192Z',
updated: '2024-06-19 22:03:57.192Z',
name: 'votes',
type: 'base',
system: false,
schema: [
{
system: false,
id: 'reelx3nj',
name: 'profile',
type: 'relation',
required: true,
presentable: false,
unique: false,
options: {
collectionId: 'etdl54k56vwybrn',
cascadeDelete: true,
minSelect: null,
maxSelect: 1,
displayFields: null
}
},
{
system: false,
id: 'oryeao7u',
name: 'character',
type: 'relation',
required: true,
presentable: false,
unique: false,
options: {
collectionId: 'i7mafqbep52hivh',
cascadeDelete: true,
minSelect: null,
maxSelect: 1,
displayFields: null
}
},
{
system: false,
id: 'sllown1l',
name: 'nick',
type: 'text',
required: true,
presentable: false,
unique: false,
options: {
min: null,
max: null,
pattern: ''
}
}
],
indexes: ['CREATE UNIQUE INDEX `idx_TdQeCRY` ON `votes` (\n `profile`,\n `character`\n)'],
listRule: '@request.auth.id != ""',
viewRule: '@request.auth.id != ""',
createRule: '@request.auth.id = profile.user.id',
updateRule: '@request.auth.id = profile.user.id',
deleteRule: '@request.auth.id = profile.user.id',
options: {}
});

return Dao(db).saveCollection(collection);
},
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('2q5l1u64zseldm9');

return dao.deleteCollection(collection);
}
);
21 changes: 21 additions & 0 deletions pb_migrations/1718834662_updated_profiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('etdl54k56vwybrn');

collection.listRule = '@request.auth.id != ""';
collection.viewRule = '@request.auth.id != ""';

return dao.saveCollection(collection);
},
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('etdl54k56vwybrn');

collection.listRule = '@request.auth.id = user.id';
collection.viewRule = '@request.auth.id = user.id';

return dao.saveCollection(collection);
}
);
21 changes: 21 additions & 0 deletions pb_migrations/1718834688_updated_characters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('i7mafqbep52hivh');

collection.listRule = '@request.auth.id != "" && visible = true';
collection.viewRule = '@request.auth.id != "" && visible = true';

return dao.saveCollection(collection);
},
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('i7mafqbep52hivh');

collection.listRule = 'visible = true';
collection.viewRule = 'visible = true';

return dao.saveCollection(collection);
}
);
25 changes: 25 additions & 0 deletions pb_migrations/1718838136_updated_votes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/// <reference path="../pb_data/types.d.ts" />
migrate(
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('2q5l1u64zseldm9');

collection.name = 'nicks';
collection.indexes = [
'CREATE UNIQUE INDEX `idx_TdQeCRY` ON `nicks` (\n `profile`,\n `character`\n)'
];

return dao.saveCollection(collection);
},
(db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId('2q5l1u64zseldm9');

collection.name = 'votes';
collection.indexes = [
'CREATE UNIQUE INDEX `idx_TdQeCRY` ON `votes` (\n `profile`,\n `character`\n)'
];

return dao.saveCollection(collection);
}
);
Loading

0 comments on commit ccd191d

Please sign in to comment.