Update favicon and add PWA

This commit is contained in:
2023-10-30 17:39:35 -04:00
parent 027609d8fa
commit e37998f188
45 changed files with 2540 additions and 72 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

19
src/boot/appwrite.ts Normal file
View File

@@ -0,0 +1,19 @@
import { boot } from 'quasar/wrappers';
import { Client, Account, ID } from 'appwrite';
export const client = new Client();
client
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('653ef6f76baf06d68034');
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;
});

41
src/pages/LoginPage.vue Normal file
View File

@@ -0,0 +1,41 @@
<template>
<div>
<p>
{{ loggedInUser ? `Logged in as ${loggedInUser.name}` : 'Not logged in' }}
</p>
<form>
<input type="email" placeholder="Email" v-model="email" />
<input type="password" placeholder="Password" v-model="password" />
<input type="text" placeholder="Name" v-model="name" />
<button type="button" @click="login(email, password)">Login</button>
<button type="button" @click="register">Register</button>
<button type="button" @click="logout">Logout</button>
</form>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { account, ID } from './lib/appwrite.js';
const loggedInUser = ref(null);
const email = ref('');
const password = ref('');
const name = ref('');
const login = async (email, password) => {
await account.createEmailSession(email, password);
loggedInUser.value = await account.get();
};
const register = async () => {
await account.create(ID.unique(), email.value, password.value, name.value);
login(email.value, password.value);
};
const logout = async () => {
await account.deleteSession('current');
loggedInUser.value = null;
};
</script>