feat: integrate PWA support with manifest, service workers, and viewport configuration

This commit is contained in:
Firman Ramdhani
2026-09-03 12:56:42 +07:00
parent aca2b325f2
commit 83a09a4c03
16 changed files with 1483 additions and 26 deletions
+7
View File
@@ -39,3 +39,10 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
# PWA generated files
public/sw.js
public/sw.js.map
public/workbox-*.js
public/workbox-*.js.map
public/swe-worker-*.js
+16 -1
View File
@@ -1,7 +1,22 @@
import type { NextConfig } from "next";
import withPWAInit from "@ducanh2912/next-pwa";
const withPWA = withPWAInit({
dest: "public",
disable: process.env.NODE_ENV === "development",
register: true,
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
workboxOptions: {
skipWaiting: true,
disableDevLogs: true,
},
});
const nextConfig: NextConfig = {
/* config options here */
turbopack: {},
};
export default nextConfig;
export default withPWA(nextConfig);
+3 -2
View File
@@ -4,13 +4,14 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build": "next build --webpack",
"start": "next start",
"lint": "eslint",
"postinstall": "prisma skills sync || exit 0"
},
"dependencies": {
"@base-ui/react": "^1.7.0",
"@ducanh2912/next-pwa": "^10.2.9",
"@hookform/resolvers": "^5.9.1",
"@prisma/client": "^5.22.0",
"bcryptjs": "^3.0.3",
@@ -49,4 +50,4 @@
"prisma": {
"seed": "tsx prisma/seed.ts"
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

+73
View File
@@ -0,0 +1,73 @@
{
"name": "TitipIn - Sistem Titip Pesanan",
"short_name": "TitipIn",
"description": "Platform jasa titip pesanan bersama yang modern, cepat, dan transparan.",
"start_url": "/",
"display": "standalone",
"orientation": "portrait",
"theme_color": "#1B2CC1",
"background_color": "#F4F6FB",
"categories": ["productivity", "utilities"],
"icons": [
{
"src": "/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-maskable-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/icons/icon-maskable-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
+29 -1
View File
@@ -1,4 +1,4 @@
import type { Metadata } from "next";
import type { Metadata, Viewport } from "next";
import { Roboto, Open_Sans } from "next/font/google";
import "./globals.css";
@@ -16,9 +16,36 @@ const openSans = Open_Sans({
display: "swap",
});
export const viewport: Viewport = {
themeColor: "#1B2CC1",
width: "device-width",
initialScale: 1,
maximumScale: 1,
userScalable: false,
};
export const metadata: Metadata = {
title: "TitipIn - Sistem Titip Pesanan",
description: "Platform jasa titip pesanan bersama yang modern, cepat, dan transparan.",
manifest: "/manifest.json",
appleWebApp: {
capable: true,
statusBarStyle: "black-translucent",
title: "TitipIn",
},
formatDetection: {
telephone: false,
},
icons: {
icon: [
{ url: "/icons/icon-192x192.png", sizes: "192x192", type: "image/png" },
{ url: "/icons/icon-512x512.png", sizes: "512x512", type: "image/png" },
],
apple: [
{ url: "/icons/icon-152x152.png", sizes: "152x152", type: "image/png" },
{ url: "/icons/icon-192x192.png", sizes: "192x192", type: "image/png" },
],
},
};
export default function RootLayout({
@@ -41,3 +68,4 @@ export default function RootLayout({
</html>
);
}
+1355 -22
View File
File diff suppressed because it is too large Load Diff