diff --git a/.gitignore b/.gitignore index 162b4db..5365bd0 100644 --- a/.gitignore +++ b/.gitignore @@ -166,3 +166,7 @@ cython_debug/ # Volumes volumes/ + +# Environment Variable +backend/.env +frontend/.env diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ab31fd5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "editor.bracketPairColorization.enabled": true, + "editor.guides.bracketPairs": true, + "editor.formatOnSave": true, + "editor.defaultFormatter": "dbaeumer.vscode-eslint", + "editor.codeActionsOnSave": [ + "source.fixAll.eslint" + ], + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "vue" + ], + "prettier.configPath": ".prettierrc.json" +} diff --git a/README.md b/README.md index 4e76f3e..60dfffe 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,15 @@ docker build -t test . ``` ``` -docker run --rm -it -p 8080:80 --net test -e POSTGRES_URL=postgresql+asyncpg://user:password@hostname/database test +docker network create --driver bridge test +``` + +``` +docker run --rm -d --name postgres --net=test -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password postgres:15.3-alpine +``` + +``` +docker run --rm -it -p 8080:80 --net test -e POSTGRES_URL=postgresql+asyncpg://user:password@hostname/ test ``` Visit `http://127.0.0.1:8080/admin` diff --git a/frontend/.env b/frontend/.env deleted file mode 100644 index 1ad7f5a..0000000 --- a/frontend/.env +++ /dev/null @@ -1,3 +0,0 @@ -APP_PATH = /admin # relative base path where the frontend is served from, resulting in https://example.com/admin -API_PATH = /api/v0/ # relative base path where the API is served from, resulting in https://example.com/api/v0/ -#SHORTENED_URL_BASE_PATH = https://r.example.com/ # (vanity, only used to display urls) absolute base path for shortened links, resulting in https://r.example.com/abc123, define this env if you wanna overwrite default value `${location.origin}/` diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000..35d2603 --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1,3 @@ +APP_PATH = /admin # relative base path where the frontend is served from, resulting in https://example.com/admin +API_PATH = /api/v0/ # relative base path where the API is served from, resulting in https://example.com/api/v0/ +SHORTENED_URL_BASE_PATH = https://r.example.com/ # (vanity, only used to display urls) absolute base path for shortened links, resulting in https://r.example.com/abc123, define this env if you wanna overwrite default value `${location.origin}/` diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index e1c4dd6..348c1b9 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -5,7 +5,7 @@ module.exports = { root: true, parserOptions: { - ecmaVersion: 2021, // Allows for the parsing of modern ECMAScript features + ecmaVersion: 2021 // Allows for the parsing of modern ECMAScript features }, env: { @@ -33,7 +33,7 @@ module.exports = { plugins: [ // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files // required to lint *.vue files - 'vue', + 'vue' ], @@ -47,7 +47,11 @@ module.exports = { __QUASAR_SSR_PWA__: 'readonly', process: 'readonly', Capacitor: 'readonly', - chrome: 'readonly' + chrome: 'readonly', + defineProps: 'readonly', + defineEmits: 'readonly', + defineExpose: 'readonly', + withDefaults: 'readonly' }, // add your custom rules here diff --git a/frontend/.nvmrc b/frontend/.nvmrc new file mode 100644 index 0000000..5e0828a --- /dev/null +++ b/frontend/.nvmrc @@ -0,0 +1 @@ +v18.16.1 diff --git a/frontend/.prettierrc.json b/frontend/.prettierrc.json new file mode 100644 index 0000000..d1df35f --- /dev/null +++ b/frontend/.prettierrc.json @@ -0,0 +1,21 @@ +{ + "arrowParens": "always", + "bracketSameLine": false, + "bracketSpacing": true, + "embeddedLanguageFormatting": "auto", + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxSingleQuote": true, + "printWidth": 80, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, + "semi": false, + "singleAttributePerLine": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false, + "vueIndentScriptAndStyle": false +} diff --git a/frontend/src/components/URLsList.vue b/frontend/src/components/URLsList.vue index a756dae..e5e744d 100644 --- a/frontend/src/components/URLsList.vue +++ b/frontend/src/components/URLsList.vue @@ -8,8 +8,11 @@ :columns="columns" row-key="id" hide-bottom - :pagination="{ rowsPerPage: 0 }" + v-model:pagination="queryParams" no-data-label="No items to show" + :loading="isURLsListLoading" + @request="onURLsRequest" + binary-state-sort > + + + + + + + + +
Add tags
+
+ + + + + + + +
+ +
+
+ + + +
+
+ + + +
Add tags for filtering
+
+ + + + + +
+ +
+
+ + + +
+
+ + + + +
+
Delete the tag «{{ deletableTag.name }}»
+
Are you sure you want to delete this tag?
+
+
+ + + + +
+
diff --git a/frontend/src/components/tags/TagList.vue b/frontend/src/components/tags/TagList.vue new file mode 100644 index 0000000..4dbf88a --- /dev/null +++ b/frontend/src/components/tags/TagList.vue @@ -0,0 +1,123 @@ + + + diff --git a/frontend/src/composables/useShowNotif.js b/frontend/src/composables/useShowNotif.js index 3f1cbe0..dc9a13e 100644 --- a/frontend/src/composables/useShowNotif.js +++ b/frontend/src/composables/useShowNotif.js @@ -1,6 +1,6 @@ import { Notify } from 'quasar' -const showNotif = ({ message, color, reloadBtn }) => { +const showNotif = ({ message, color, reloadBtn, timeout = 0 }) => { const actions = [] if (reloadBtn) { @@ -17,7 +17,7 @@ const showNotif = ({ message, color, reloadBtn }) => { color, textColor: 'white', position: 'bottom-right', - timeout: 0, + timeout, group: true, actions })