diff options
| author | Dhravya Shah <[email protected]> | 2024-08-09 19:49:38 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-08-09 19:49:38 -0700 |
| commit | 3c56094613b96435ba75f4bea63a7a97e48da00d (patch) | |
| tree | d9fd9b90ab0f6ed8d7e28ef79190a47711e211aa /apps | |
| parent | Merge pull request #231 from supermemoryai/kush/be-queue-fixes (diff) | |
| parent | update lockfile (diff) | |
| download | archived-supermemory-3c56094613b96435ba75f4bea63a7a97e48da00d.tar.xz archived-supermemory-3c56094613b96435ba75f4bea63a7a97e48da00d.zip | |
Merge pull request #235 from supermemoryai/feat/pwa
Add PWA Support for Web App
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/cf-ai-backend/src/helper.ts | 2 | ||||
| -rw-r--r-- | apps/web/.gitignore | 11 | ||||
| -rw-r--r-- | apps/web/app/layout.tsx | 1 | ||||
| -rw-r--r-- | apps/web/next.config.mjs | 15 | ||||
| -rw-r--r-- | apps/web/package.json | 1 | ||||
| -rw-r--r-- | apps/web/public/manifest.webmanifest | 21 |
6 files changed, 46 insertions, 5 deletions
diff --git a/apps/cf-ai-backend/src/helper.ts b/apps/cf-ai-backend/src/helper.ts index 1c4dd69f..d8dbf9f7 100644 --- a/apps/cf-ai-backend/src/helper.ts +++ b/apps/cf-ai-backend/src/helper.ts @@ -41,7 +41,7 @@ export async function initQuery(env: Env, model: string = "gemini-1.5-pro") { baseURL: "https://gateway.ai.cloudflare.com/v1/47c2b4d598af9d423c06fc9f936226d5/supermemory/google-vertex-ai", }); - selectedModel = googleai.chat("models/gemini-pro"); + selectedModel = googleai.chat("models/gemini-1.5-flash-8b"); console.log("Selected model: ", selectedModel); break; case "gpt-4o": diff --git a/apps/web/.gitignore b/apps/web/.gitignore index 7d7c7a5f..4d28f221 100644 --- a/apps/web/.gitignore +++ b/apps/web/.gitignore @@ -1,3 +1,14 @@ # Sentry Config File .env.sentry-build-plugin + +# next-pwa +/public/sw.js +/public/workbox-*.js +/public/worker-*.js +/public/fallback-*.js +/public/precache.*.*.js.map +/public/sw.js.map +/public/workbox-*.js.map +/public/worker-*.js.map +/public/fallback-*.js
\ No newline at end of file diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 49805c16..f74ee232 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -59,6 +59,7 @@ export const metadata: Metadata = { }, ], }, + manifest: "/manifest.webmanifest", }; export default function RootLayout({ diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 307d5bdc..ef57aecc 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,6 +1,6 @@ import MillionLint from "@million/lint"; import { setupDevPlatform } from "@cloudflare/next-on-pages/next-dev"; - +import pwa from "next-pwa"; /** @type {import('next').NextConfig} */ const baseNextConfig = { transpilePackages: ["@repo/ui"], @@ -13,15 +13,22 @@ const baseNextConfig = { }, }; -let selectedCofig = baseNextConfig; +const withPWA = pwa({ + dest: "public", + disable: process.env.NODE_ENV === "development", + register: true, + skipWaiting: true, +}); + +let selectedConfig = baseNextConfig; if (process.env.NODE_ENV === "development") { - selectedCofig = MillionLint.next({ + selectedConfig = MillionLint.next({ rsc: true, })(baseNextConfig); } -export default selectedCofig; +export default withPWA(selectedConfig); // we only need to use the utility during development so we can check NODE_ENV // (note: this check is recommended but completely optional) diff --git a/apps/web/package.json b/apps/web/package.json index 4c0d57cd..109d7907 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -28,6 +28,7 @@ "lowlight": "^3.1.0", "million": "^3.1.6", "next": "^14.1.1", + "next-pwa": "^5.6.0", "novel": "^0.4.2", "nuqs": "^1.17.4", "posthog-js": "^1.154.5", diff --git a/apps/web/public/manifest.webmanifest b/apps/web/public/manifest.webmanifest new file mode 100644 index 00000000..5d4c0bd7 --- /dev/null +++ b/apps/web/public/manifest.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "Supermemory - your second brain.", + "short_name": "Supermemory", + "icons": [ + { + "src": "/icons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/icons/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "scope": "/", + "start_url": "/", + "display": "standalone" +} |