Merge pull request #235 from supermemoryai/feat/pwa

Add PWA Support for Web App
This commit is contained in:
Dhravya Shah 2024-08-09 19:49:38 -07:00 • committed by GitHub
commit 3c56094613
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 620 additions and 185 deletions

View file

@ -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":

11
apps/web/.gitignore vendored
View file

@ -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

View file

@ -59,6 +59,7 @@ export const metadata: Metadata = {
},
],
},
manifest: "/manifest.webmanifest",
};
export default function RootLayout({

View file

@ -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)

View file

@ -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",

View file

@ -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"
}

754
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff