feat: Add PWA support with service worker and caching

- Implemented service worker registration in main.js
- Added icons for PWA in manifest.json
- Created a basic service worker (sw.js) for caching static assets
- Generated a list of files to cache using a Node.js script (generate-pwa-cache-list.js)
- Added icon images (icon-192.png and icon-512.png) for PWA
- Defined PWA manifest with app details and icon references
This commit is contained in:
sHa
2025-06-11 22:36:48 +03:00
parent 1c0d303adc
commit 0650c40199
13 changed files with 175 additions and 14 deletions

View File

@@ -6,21 +6,19 @@ CONTAINER_NAME = slogos-dev
DEV_PORT = 5006
# Main targets
.PHONY: all build start stop restart logs clean scan-logos dev rebuild favicon deps-favicon build-with-favicons sync-packages convert-colors generate-svg-variants
.PHONY: all build start stop restart logs clean scan-logos dev rebuild favicon build-with-favicons generate-svg-variants pwa-cache-list run update-lock
all: build start
# Development mode with hot reloading
dev:
dev: pwa-cache-list
$(DOCKER_COMPOSE) -f compose.dev.yml up --build
# Build the Docker container
build:
@echo "Building the Logo Gallery container..."
$(DOCKER_COMPOSE) -f compose.dev.yml build
# Start the application in the background
start:
start: pwa-cache-list
@echo "Starting Logo Gallery application on port $(DEV_PORT)..."
$(DOCKER_COMPOSE) -f compose.dev.yml up -d
@echo "Application is running at http://localhost:$(DEV_PORT)"
@@ -81,3 +79,9 @@ generate-svg-variants:
@echo "Generating SVG variants with color sets..."
$(DOCKER_COMPOSE) -f compose.dev.yml run --rm $(CONTAINER_NAME) node scripts/generate-svg-variants.js
@echo "SVG variants have been generated"
# Generate PWA cache list
pwa-cache-list:
@echo "Generating PWA cache list..."
$(DOCKER_COMPOSE) -f compose.dev.yml run --rm $(CONTAINER_NAME) npm run pwa-cache-list