diff --git a/README.md b/README.md index 7355c55..f8bc350 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # SST Alumni Web App -This repository contains both the web app and the API for the SST Alumni platform. +This repository contains the following for the SST Alumni App Platform (SSTAAP): -[iOS App](https://github.com/sstalumniassociation/ios) +* Web PWA +* Admin Dashboard +* API ## Getting Started @@ -10,3 +12,23 @@ Please get access or set up the following services: * Turso * Firebase + +You will need to provide the following env vars in a `.env` file: + +| Name | Purpose | +| -------------------------------- | -------------------------------- | +| `FIREBASE_APP_CHECK_DEBUG_TOKEN` | Firebase App Check Debug Token | +| `TURSO_URL` | Database to connect to | +| `TURSO_AUTH_TOKEN` | Token to authenticate with Turso | + +### Development + +Start the dev server: + +```bash +pnpm dev +``` + +## Sibling projects + +[iOS App](https://github.com/sstalumniassociation/ios) diff --git a/nuxt.config.ts b/nuxt.config.ts index 543d653..53a8257 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -11,6 +11,35 @@ export default defineNuxtConfig({ ], pwa: { + devOptions: { enabled: true }, + registerType: 'autoUpdate', + workbox: { + globPatterns: ['**/*.{js,json,css,html,txt,svg,png,ico,webp,woff,woff2,ttf,eot,otf,wasm}'], + }, + manifest: { + name: 'SSTAA', + short_name: 'SSTAA', + description: 'The SST Alumni App', + theme_color: '#000000', + icons: [ + { + src: '/pwa-64x64.png', + sizes: '64x64', + type: 'image/png', + }, + { + src: '/pwa-192x192.png', + sizes: '192x192', + type: 'image/png', + }, + { + src: '/pwa-512x512.png', + sizes: '512x512', + type: 'image/png', + }, + + ], + }, }, vuefire: { diff --git a/package.json b/package.json index aeae324..ca5bd16 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,15 @@ "postinstall": "nuxt prepare", "db:generate": "drizzle-kit generate:sqlite", "db:push": "drizzle-kit push:sqlite", - "db:drop": "drizzle-kit drop" + "db:drop": "drizzle-kit drop", + "pwa:generate-assets": "pwa-assets-generator --preset minimal public/logo.png" }, "devDependencies": { "@antfu/eslint-config": "^0.42.0", "@libsql/client": "^0.3.4", "@nuxt/devtools": "latest", "@paralleldrive/cuid2": "^2.2.2", + "@vite-pwa/assets-generator": "^0.0.10", "@vite-pwa/nuxt": "^0.1.1", "dayjs": "^1.11.9", "dotenv": "^16.3.1", diff --git a/pages/app.vue b/pages/app.vue index 0ba0f56..10c8b92 100644 --- a/pages/app.vue +++ b/pages/app.vue @@ -27,8 +27,30 @@ const appRoutes = [ }, ] +useSeoMeta({ + description: 'The SST Alumni App', +}) + useHeadSafe({ - titleTemplate: 'SSTAA - %s', + titleTemplate: (titleChunk) => { + return titleChunk ? `${titleChunk} - SSTAA` : 'SSTAA' + }, + link: [ + { + rel: 'icon', + href: '/favicon.ico', + }, + { + rel: 'apple-touch-icon', + href: '/apple-touch-icon-180x180.png', + sizes: '180x180', + }, + { + rel: 'mask-icon', + href: '/maskable-icon-512x512.png', + color: '#ffffff', + }, + ], meta: [ { name: 'viewport', @@ -46,10 +68,6 @@ useHeadSafe({ name: 'theme-color', content: '#000000', }, - { - name: 'apple-touch-icon', - content: 'logo.png', - }, ], }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43dd186..44b588b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ devDependencies: '@paralleldrive/cuid2': specifier: ^2.2.2 version: 2.2.2 + '@vite-pwa/assets-generator': + specifier: ^0.0.10 + version: 0.0.10 '@vite-pwa/nuxt': specifier: ^0.1.1 version: 0.1.1(@nuxt/kit@3.7.3)(vite-plugin-pwa@0.16.5) @@ -741,7 +744,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.19 - '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-remap-async-to-generator': 7.22.20(@babel/core@7.22.19) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.19) @@ -811,7 +814,7 @@ packages: '@babel/core': 7.22.19 '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.22.5 '@babel/helper-optimise-call-expression': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 @@ -1423,6 +1426,10 @@ packages: to-fast-properties: 2.0.0 dev: true + /@canvas/image-data@1.0.0: + resolution: {integrity: sha512-BxOqI5LgsIQP1odU5KMwV9yoijleOPzHL18/YvNqF9KFSGF2K/DLlYAbDQsWqd/1nbaFuSkYD/191dpMtNh4vw==} + dev: true + /@cloudflare/kv-asset-handler@0.3.0: resolution: {integrity: sha512-9CB/MKf/wdvbfkUdfrj+OkEwZ5b7rws0eogJ4293h+7b6KX5toPwym+VQKmILafNB9YiehqY0DlNrDcDhdWHSQ==} dependencies: @@ -3717,6 +3724,19 @@ packages: - supports-color dev: true + /@vite-pwa/assets-generator@0.0.10: + resolution: {integrity: sha512-Ya3iE0EWIV+0g0XFXIjqSU8ZnhpJeLi9/xx+VfbSyXThKjk168GUYqd1z+SOuRO03bSRFDeK8wGixtwWuedjqg==} + engines: {node: '>=16.14.0'} + hasBin: true + dependencies: + cac: 6.7.14 + colorette: 2.0.20 + consola: 3.2.3 + sharp: 0.32.6 + sharp-ico: 0.1.5 + unconfig: 0.3.10 + dev: true + /@vite-pwa/nuxt@0.1.1(@nuxt/kit@3.7.3)(vite-plugin-pwa@0.16.5): resolution: {integrity: sha512-wrIeo8ATGc3Nny+MiK/KSklRer22TKrAlRnkqszdM2r+0mHQ3FDQQGZdt/MFu1V/F4TEcacrx2NiU/MYVRV86A==} peerDependencies: @@ -4576,11 +4596,26 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true + /color-string@1.9.1: + resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} + dependencies: + color-name: 1.1.4 + simple-swizzle: 0.2.2 + dev: true + /color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true dev: true + /color@4.2.3: + resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} + engines: {node: '>=12.5.0'} + dependencies: + color-convert: 2.0.1 + color-string: 1.9.1 + dev: true + /colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} dev: true @@ -4871,6 +4906,23 @@ packages: ms: 2.1.2 dev: true + /decode-bmp@0.2.1: + resolution: {integrity: sha512-NiOaGe+GN0KJqi2STf24hfMkFitDUaIoUU3eKvP/wAbLe8o6FuW5n/x7MHPR0HKvBokp6MQY/j7w8lewEeVCIA==} + engines: {node: '>=8.6.0'} + dependencies: + '@canvas/image-data': 1.0.0 + to-data-view: 1.1.0 + dev: true + + /decode-ico@0.4.1: + resolution: {integrity: sha512-69NZfbKIzux1vBOd31al3XnMnH+2mqDhEgLdpygErm4d60N+UwA5Sq5WFjmEDQzumgB9fElojGwWG0vybVfFmA==} + engines: {node: '>=8.6'} + dependencies: + '@canvas/image-data': 1.0.0 + decode-bmp: 0.2.1 + to-data-view: 1.1.0 + dev: true + /decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -6640,6 +6692,10 @@ packages: ms: 2.1.3 dev: true + /ico-endec@0.1.6: + resolution: {integrity: sha512-ZdLU38ZoED3g1j3iEyzcQj+wAkY2xfWNkymszfJPoxucIUhK7NayQ+/C4Kv0nDFMIsbtbEHldv3V8PU494/ueQ==} + dev: true + /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -6773,6 +6829,10 @@ packages: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true + /is-arrayish@0.3.2: + resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + dev: true + /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: @@ -7841,6 +7901,10 @@ packages: semver: 7.5.4 dev: true + /node-addon-api@6.1.0: + resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} + dev: true + /node-addon-api@7.0.0: resolution: {integrity: sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==} dev: true @@ -9421,6 +9485,29 @@ packages: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} dev: true + /sharp-ico@0.1.5: + resolution: {integrity: sha512-a3jODQl82NPp1d5OYb0wY+oFaPk7AvyxipIowCHk7pBsZCWgbe0yAkU2OOXdoH0ENyANhyOQbs9xkAiRHcF02Q==} + dependencies: + decode-ico: 0.4.1 + ico-endec: 0.1.6 + sharp: 0.32.6 + dev: true + + /sharp@0.32.6: + resolution: {integrity: sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==} + engines: {node: '>=14.15.0'} + requiresBuild: true + dependencies: + color: 4.2.3 + detect-libc: 2.0.2 + node-addon-api: 6.1.0 + prebuild-install: 7.1.1 + semver: 7.5.4 + simple-get: 4.0.1 + tar-fs: 3.0.4 + tunnel-agent: 0.6.0 + dev: true + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -9488,6 +9575,12 @@ packages: - supports-color dev: true + /simple-swizzle@0.2.2: + resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + dependencies: + is-arrayish: 0.3.2 + dev: true + /sirv@2.0.3: resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} engines: {node: '>= 10'} @@ -9857,6 +9950,14 @@ packages: tar-stream: 2.2.0 dev: true + /tar-fs@3.0.4: + resolution: {integrity: sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==} + dependencies: + mkdirp-classic: 0.5.3 + pump: 3.0.0 + tar-stream: 3.1.6 + dev: true + /tar-stream@2.2.0: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} engines: {node: '>=6'} @@ -9934,6 +10035,10 @@ packages: engines: {node: '>=12'} dev: true + /to-data-view@1.1.0: + resolution: {integrity: sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ==} + dev: true + /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} @@ -10132,6 +10237,15 @@ packages: which-boxed-primitive: 1.0.2 dev: true + /unconfig@0.3.10: + resolution: {integrity: sha512-tj317lhIq2iZF/NXrJnU1t2UaGUKKz1eL1sK2t63Oq66V9BxqvZV12m55fp/fpQJ+DDmVlLgo7cnLVOZkhlO/A==} + dependencies: + '@antfu/utils': 0.7.6 + defu: 6.1.2 + jiti: 1.20.0 + mlly: 1.4.2 + dev: true + /uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} dev: true diff --git a/public/apple-touch-icon-180x180.png b/public/apple-touch-icon-180x180.png new file mode 100644 index 0000000..408da96 Binary files /dev/null and b/public/apple-touch-icon-180x180.png differ diff --git a/public/favicon.ico b/public/favicon.ico index 18993ad..d91646c 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/maskable-icon-512x512.png b/public/maskable-icon-512x512.png new file mode 100644 index 0000000..e55f1c5 Binary files /dev/null and b/public/maskable-icon-512x512.png differ diff --git a/public/pwa-192x192.png b/public/pwa-192x192.png new file mode 100644 index 0000000..90c1843 Binary files /dev/null and b/public/pwa-192x192.png differ diff --git a/public/pwa-512x512.png b/public/pwa-512x512.png new file mode 100644 index 0000000..4a6a014 Binary files /dev/null and b/public/pwa-512x512.png differ diff --git a/public/pwa-64x64.png b/public/pwa-64x64.png new file mode 100644 index 0000000..17e4f56 Binary files /dev/null and b/public/pwa-64x64.png differ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..c2a49f4 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Allow: /