Skip to content

Commit

Permalink
feat: pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Sep 20, 2023
1 parent 31e6a2f commit 688b567
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 10 deletions.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# 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

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)
29 changes: 29 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
28 changes: 23 additions & 5 deletions pages/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -46,10 +68,6 @@ useHeadSafe({
name: 'theme-color',
content: '#000000',
},
{
name: 'apple-touch-icon',
content: 'logo.png',
},
],
})
Expand Down
118 changes: 116 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file added public/maskable-icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/pwa-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/pwa-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/pwa-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Allow: /

0 comments on commit 688b567

Please # to comment.