chore: initial commit — monorepo ReadaBook (API NestJS, web PWA, Docker)
This commit is contained in:
7
apps/web/public/icons/readabook.svg
Normal file
7
apps/web/public/icons/readabook.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="ReadaBook">
|
||||
<rect width="512" height="512" rx="96" fill="#20150e"/>
|
||||
<path d="M96 112h128c31 0 56 25 56 56v232c0 9-10 14-17 8-15-13-34-20-54-20H96z" fill="#e8d2a6"/>
|
||||
<path d="M416 112H288c-31 0-56 25-56 56v232c0 9 10 14 17 8 15-13 34-20 54-20h113z" fill="#c05a3a"/>
|
||||
<circle cx="256" cy="220" r="46" fill="#29524a"/>
|
||||
<path d="M256 154l14 42 45 1-36 27 13 43-36-25-36 25 13-43-36-27 45-1z" fill="#f5c84b"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 506 B |
18
apps/web/public/manifest.webmanifest
Normal file
18
apps/web/public/manifest.webmanifest
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "ReadaBook",
|
||||
"short_name": "ReadaBook",
|
||||
"description": "Cabinet de curiosites numerique pour bibliotheques EPUB et PDF.",
|
||||
"start_url": "/home",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#20150e",
|
||||
"theme_color": "#20150e",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icons/readabook.svg",
|
||||
"sizes": "any",
|
||||
"type": "image/svg+xml",
|
||||
"purpose": "any maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
22
apps/web/public/sw.js
Normal file
22
apps/web/public/sw.js
Normal file
@ -0,0 +1,22 @@
|
||||
const CACHE_NAME = "readabook-shell-v1";
|
||||
const SHELL = ["/", "/home", "/manifest.webmanifest", "/icons/readabook.svg"];
|
||||
|
||||
self.addEventListener("install", (event) => {
|
||||
event.waitUntil(caches.open(CACHE_NAME).then((cache) => cache.addAll(SHELL)));
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener("activate", (event) => {
|
||||
event.waitUntil(
|
||||
caches.keys().then((keys) => Promise.all(keys.filter((key) => key !== CACHE_NAME).map((key) => caches.delete(key))))
|
||||
);
|
||||
self.clients.claim();
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
const url = new URL(event.request.url);
|
||||
if (event.request.method !== "GET" || ["/auth", "/admin", "/books", "/progress"].some((path) => url.pathname.startsWith(path))) {
|
||||
return;
|
||||
}
|
||||
event.respondWith(fetch(event.request).catch(() => caches.match(event.request).then((hit) => hit || caches.match("/"))));
|
||||
});
|
||||
Reference in New Issue
Block a user