Skip to content
This repository was archived by the owner on Oct 5, 2025. It is now read-only.

Commit d4982f5

Browse files
committed
feat: add PWA support with service worker, manifest, and responsive design enhancements
1 parent 6ac632e commit d4982f5

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ dependencies {
4242
implementation("ai.djl:api:0.26.0")
4343
implementation("ai.djl.pytorch:pytorch-engine:0.26.0")
4444
implementation("ai.djl.huggingface:tokenizers:0.26.0")
45+
implementation("io.jsonwebtoken:jjwt-api:0.12.6")
46+
implementation("io.jsonwebtoken:jjwt-impl:0.12.6")
47+
implementation("io.jsonwebtoken:jjwt-jackson:0.12.6")
4548
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
4649
runtimeOnly("com.mysql:mysql-connector-j")
4750
testImplementation("org.springframework.boot:spring-boot-starter-test")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "ㄹㅈㄷ 맛집탐방",
3+
"short_name": "맛집탐방",
4+
"start_url": "/index.html",
5+
"display": "standalone",
6+
"background_color": "#f0f2f5",
7+
"theme_color": "#5c6bc0",
8+
"icons": [
9+
{
10+
"src": "/icons/icon-192.png",
11+
"sizes": "192x192",
12+
"type": "image/png"
13+
},
14+
{
15+
"src": "/icons/icon-512.png",
16+
"sizes": "512x512",
17+
"type": "image/png"
18+
}
19+
]
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const CACHE_NAME = "pwa-cache-v1";
2+
const urlsToCache = [
3+
"/",
4+
"/index.html",
5+
"/manifest.json",
6+
"/style.css",
7+
"/app.js"
8+
];
9+
10+
self.addEventListener("install", event => {
11+
event.waitUntil(
12+
caches.open(CACHE_NAME)
13+
.then(cache => cache.addAll(urlsToCache))
14+
);
15+
});
16+
17+
self.addEventListener("fetch", event => {
18+
event.respondWith(
19+
caches.match(event.request).then(response =>
20+
response || fetch(event.request)
21+
)
22+
);
23+
});

src/main/resources/templates/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
<meta charset="UTF-8"/>
55
<meta name="viewport" content="width=device-width,initial-scale=1"/>
66
<title>ㄹㅈㄷ 맛집탐방</title>
7+
<link rel="manifest" href="/manifest.json" />
8+
<meta name="theme-color" content="#5c6bc0" />
9+
<link rel="icon" href="/icons/icon-192.png" />
10+
<script>
11+
if ('serviceWorker' in navigator) {
12+
navigator.serviceWorker.register('/service-worker.js');
13+
}
14+
</script>
715
<style>
816
:root {
917
--primary: #5c6bc0;
@@ -294,6 +302,15 @@
294302
width: 100%;
295303
}
296304
}
305+
306+
@media (max-width: 414px) {
307+
.sidebar {
308+
width: 100%;
309+
}
310+
.cards {
311+
grid-template-columns: 1fr;
312+
}
313+
}
297314
</style>
298315
</head>
299316
<body data-theme="light">

0 commit comments

Comments
 (0)