Skip to content

Commit

Permalink
feature: Initial attempt at making the app a PWA
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Mar 4, 2024
1 parent af01de8 commit 19f17b4
Show file tree
Hide file tree
Showing 9 changed files with 2,232 additions and 133 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ next-env.d.ts

# The sqlite database
**/dev.db

# PWA Files
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
9 changes: 9 additions & 0 deletions packages/web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Hoarder",
applicationName: "Hoarder",
description: "Your AI powered second brain",
manifest: "/manifest.json",
appleWebApp: {
capable: true,
title: "Hoarder",
},
formatDetection: {
telephone: false,
},
};

export const viewport: Viewport = {
Expand Down
11 changes: 9 additions & 2 deletions packages/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import pwa from "next-pwa";

const withPWA = pwa({
dest: "public",
disable: process.env.NODE_ENV != "production",
});

/** @type {import('next').NextConfig} */
const nextConfig = {
const nextConfig = withPWA({
output: "standalone",
async headers() {
return [
Expand Down Expand Up @@ -27,6 +34,6 @@ const nextConfig = {
},
];
},
};
});

export default nextConfig;
1 change: 1 addition & 0 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"meilisearch": "^0.37.0",
"next": "14.1.1",
"next-auth": "^4.24.5",
"next-pwa": "^5.6.0",
"prettier": "^3.2.5",
"react": "^18",
"react-dom": "^18",
Expand Down
Binary file added packages/web/public/icons/logo-128.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 packages/web/public/icons/logo-16.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 packages/web/public/icons/logo-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions packages/web/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Hoarder",
"short_name": "Hoarder",
"icons": [
{
"src": "/icons/logo-16.png",
"sizes": "16x16",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/icons/logo-48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "/icons/logo-128.png",
"sizes": "128x128",
"type": "image/png"
}
],
"start_url": "/",
"display": "standalone",
"orientation": "portrait"
}
Loading

0 comments on commit 19f17b4

Please sign in to comment.