diff --git a/README.md b/README.md index 36f6709..d5c936f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ -# OYS Borrow a Boat (bab-project) +# OYS Borrow a Boat (oys_bab) Manage a Borrow a Boat program for a Yacht Club ## Install the dependencies + ```bash yarn # or @@ -10,32 +11,33 @@ npm install ``` ### Start the app in development mode (hot-code reloading, error reporting, etc.) + ```bash quasar dev ``` - ### Lint the files + ```bash yarn lint # or npm run lint ``` - ### Format the files + ```bash yarn format # or npm run format ``` - - ### Build the app for production + ```bash quasar build ``` ### Customize the configuration + See [Configuring quasar.config.js](https://v2.quasar.dev/quasar-cli-vite/quasar-config-js). diff --git a/package.json b/package.json index 901371a..6ec4356 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "bab-project", + "name": "oys_bab", "version": "0.0.1", "description": "Manage a Borrow a Boat program for a Yacht Club", "productName": "OYS Borrow a Boat", @@ -15,6 +15,7 @@ "dependencies": { "@quasar/extras": "^1.16.4", "appwrite": "^13.0.0", + "pinia": "^2.1.7", "quasar": "^2.6.0", "vue": "^3.0.0", "vue-router": "^4.0.0" diff --git a/quasar.config.js b/quasar.config.js index 46e5c8d..aeeb676 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -185,7 +185,7 @@ module.exports = configure(function (/* ctx */) { builder: { // https://www.electron.build/configuration/configuration - appId: 'bab-project', + appId: 'oys_bab', }, }, diff --git a/src/App.vue b/src/App.vue index ddfb546..4023881 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,6 +6,6 @@ import { defineComponent } from 'vue'; export default defineComponent({ - name: 'App' + name: 'OYS Borrow-a-Boat', }); diff --git a/src/assets/oys_lighthouse.jpg b/src/assets/oys_lighthouse.jpg new file mode 100644 index 0000000..3d13209 Binary files /dev/null and b/src/assets/oys_lighthouse.jpg differ diff --git a/src/assets/oys_lighthouse_modern.jpg b/src/assets/oys_lighthouse_modern.jpg new file mode 100644 index 0000000..123b2a8 Binary files /dev/null and b/src/assets/oys_lighthouse_modern.jpg differ diff --git a/src/boot/appwrite.ts b/src/boot/appwrite.ts index 93c1527..785dfd0 100644 --- a/src/boot/appwrite.ts +++ b/src/boot/appwrite.ts @@ -1,5 +1,5 @@ import { boot } from 'quasar/wrappers'; -import { Client, Account, ID } from 'appwrite'; +import { Client, Account } from 'appwrite'; export const client = new Client(); @@ -7,13 +7,17 @@ client .setEndpoint('https://cloud.appwrite.io/v1') .setProject('653ef6f76baf06d68034'); +client.subscribe('account', (response) => { + console.log(response); +}); + export const account = new Account(client); -// "async" is optional; -// more info on params: https://v2.quasar.dev/quasar-cli/boot-files -export default boot(async ({ app }) => { - console.log('Appwrite Instantiation'); - app.config.globalProperties.$appwrite_client = client; - app.config.globalProperties.$appwrite_account = account; - app.config.globalProperties.$appwrite_ID = ID; +export default boot(({ app, urlPath, redirect }) => { + // Redirect to login page if unauthenticated. + try { + const current = await account.get(); + } catch (err) { + redirect('/Login'); + } }); diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 3996ce1..9f2ae80 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -12,14 +12,14 @@ // to match your app's branding. // Tip: Use the "Theme Builder" on Quasar's documentation website. -$primary : #1976D2; -$secondary : #26A69A; -$accent : #9C27B0; +$primary: #14539a; +$secondary: #999999; +$accent: #ed323a; -$dark : #1D1D1D; -$dark-page : #121212; +$dark: #1d1d1d; +$dark-page: #121212; -$positive : #21BA45; -$negative : #C10015; -$info : #31CCEC; -$warning : #F2C037; +$positive: #21ba45; +$negative: #c10015; +$info: #31ccec; +$warning: #f2c037; diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 4c347c2..cb85f42 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -11,25 +11,13 @@ @click="toggleLeftDrawer" /> - - Quasar App - - -
Quasar v{{ $q.version }}
+ OYS Borrow a Boat - + - - Essential Links - + Essential Links diff --git a/src/pages/LoginPage.vue b/src/pages/LoginPage.vue index 9200906..da70783 100644 --- a/src/pages/LoginPage.vue +++ b/src/pages/LoginPage.vue @@ -1,41 +1,136 @@ - diff --git a/src/router/routes.ts b/src/router/routes.ts index 2d34fc1..220a014 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -6,7 +6,10 @@ const routes: RouteRecordRaw[] = [ component: () => import('layouts/MainLayout.vue'), children: [{ path: '', component: () => import('pages/IndexPage.vue') }], }, - + { + path: '/Login', + component: () => import('pages/LoginPage.vue'), + }, // Always leave this as last one, // but you can also remove it { diff --git a/src/stores/account.ts b/src/stores/account.ts new file mode 100644 index 0000000..101ad52 --- /dev/null +++ b/src/stores/account.ts @@ -0,0 +1,19 @@ +import { defineStore } from 'pinia'; + +export const useCounterStore = defineStore('counter', { + state: () => ({ + counter: 0 + }), + + getters: { + doubleCount (state) { + return state.counter * 2; + } + }, + + actions: { + increment () { + this.counter++; + } + } +}); diff --git a/yarn.lock b/yarn.lock index d975975..9e0cadb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3987,6 +3987,14 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +pinia@^2.1.7: + version "2.1.7" + resolved "https://registry.yarnpkg.com/pinia/-/pinia-2.1.7.tgz#4cf5420d9324ca00b7b4984d3fbf693222115bbc" + integrity sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ== + dependencies: + "@vue/devtools-api" "^6.5.0" + vue-demi ">=0.14.5" + postcss-selector-parser@^6.0.13: version "6.0.13" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" @@ -4899,6 +4907,11 @@ vite@^2.9.13: optionalDependencies: fsevents "~2.3.2" +vue-demi@>=0.14.5: + version "0.14.6" + resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.6.tgz#dc706582851dc1cdc17a0054f4fec2eb6df74c92" + integrity sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w== + vue-eslint-parser@^9.3.1: version "9.3.2" resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-9.3.2.tgz#6f9638e55703f1c77875a19026347548d93fd499"