From 9df80dd4e1c5cb5d333568637e2a6692abddf9a5 Mon Sep 17 00:00:00 2001 From: bonamin Date: Tue, 16 Jun 2026 12:15:25 +0300 Subject: [PATCH] fix: vite server hotfix --- docker-compose.yml | 5 --- frontend/Dockerfile | 12 +++++- frontend/nginx.prod.conf | 17 ++++++++ nginx/nginx.conf | 2 +- strategies/PROMPT.txt | 42 ++++++++++++++++++++ strategies/todo-features.txt | 76 ++++++++++++++++++++++++++++++++++++ 6 files changed, 146 insertions(+), 8 deletions(-) create mode 100644 frontend/nginx.prod.conf create mode 100644 strategies/PROMPT.txt create mode 100644 strategies/todo-features.txt diff --git a/docker-compose.yml b/docker-compose.yml index 86242b5..cd2da27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,11 +21,6 @@ services: frontend: build: ./frontend container_name: bellsystems-frontend - volumes: - - ./frontend:/app - - /app/node_modules - ports: - - "5173:5174" networks: - internal diff --git a/frontend/Dockerfile b/frontend/Dockerfile index ba0b89d..3906841 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,5 @@ -FROM node:20-alpine +# Stage 1: build +FROM node:20-alpine AS builder WORKDIR /app @@ -6,5 +7,12 @@ COPY package.json package-lock.json ./ RUN npm ci COPY . . +RUN npm run build -CMD ["npm", "run", "dev"] +# Stage 2: serve with nginx +FROM nginx:alpine + +COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.prod.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 diff --git a/frontend/nginx.prod.conf b/frontend/nginx.prod.conf new file mode 100644 index 0000000..ba76f06 --- /dev/null +++ b/frontend/nginx.prod.conf @@ -0,0 +1,17 @@ +server { + listen 80; + + root /usr/share/nginx/html; + index index.html; + + # SPA fallback — all unknown routes serve index.html + location / { + try_files $uri $uri/ /index.html; + } + + # Cache static assets + location ~* \.(js|css|png|svg|ico|woff2?)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +} diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 2f3b83a..9674f17 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -11,7 +11,7 @@ http { resolver 127.0.0.11 valid=5s; set $backend_upstream http://backend:8000; - set $frontend_upstream http://frontend:5174; + set $frontend_upstream http://frontend:80; location /ota/ { root /srv; diff --git a/strategies/PROMPT.txt b/strategies/PROMPT.txt new file mode 100644 index 0000000..6f5f7a8 --- /dev/null +++ b/strategies/PROMPT.txt @@ -0,0 +1,42 @@ +frontend\src\pages\bellcloud\devices\notes +frontend\src\pages\bellcloud\devices\DeviceForm.jsx +frontend\src\pages\bellcloud\mqtt + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + +Read CLAUDE.md and DESIGN.md and use your /frontend-design for this task ! + +Build PAGE at PAGEURL + +REFERENCE (logic only — do not copy styling): +- Archive: ARCHIVEPAGEURL +- Use this ONLY to understand: API endpoints, data fields, user actions + +DESIGN REFERENCE: +- Style guide: frontend/src/pages/dev/StyleGuide.jsx +- Match components, spacing, and patterns exactly as shown there +- Use only components from frontend/src/components/ui/ +- Use only CSS token variables — no hardcoded values + +When done, replace the for this route in frontend/src/router/index.jsx + + +STITCH REFERENCE: +- frontend/src/_archive/stitch-references/PageName.html +- Use this as visual/layout inspiration for this specific page +- Translate the layout and visual structure into React using our design system +- Do not copy Stitch's inline styles — use our tokens instead + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + +Apply the same glass effect as the DataTable and Card components to [component/page name]. + +Replace any solid background: var(--color-bg-*) with rgba(28, 32, 38, 0.30) (or 0.40 for elevated/nested surfaces) +Add backdrop-filter: var(--blur-modal) and -webkit-backdrop-filter: var(--blur-modal) +Replace any solid hover/active/selected background colors with their semi-transparent equivalents (rgba(49, 53, 60, 0.50)) +Keep borders and shadows unchanged + diff --git a/strategies/todo-features.txt b/strategies/todo-features.txt new file mode 100644 index 0000000..58dfff7 --- /dev/null +++ b/strategies/todo-features.txt @@ -0,0 +1,76 @@ +TODO FEATURES AND FIXES + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + +// CONSOLE: + +- Add an option to view all melodies for a user, delete them (one by one or flush), and edit them / reorder them. + +- Automate the adding of a device on the cloud after it has been sold. Not necessarily claim it, but add it on the cloud with Subscription settings in place. + +- Device Subscription Start (subscrStart) value on Firestore should be timestamp not string. + +- Automate the whole 'device settings' process with a step-menu modal. + +- On the Firmware Release Upload modal, do not close when clicking outside. Only with CLOSE button or ESC key. + +- Implement a system to allow only approved users, to register an account on our app or automate the user creation from the console, and in turn: +- Automate (properly) the device assignment to the users. + +- When editing a location allow to show the map even withour coordinates, and add them when I first CLICK on the map. + +- On the Quotations page, add "Add Legacy" option. + +- Add Uptime Indicator per device + +- Add "Retired" option for Melodies + +- On the MAIL modal add option to "Seach for Customer" on the email field. When searching and selecting a customer, allow us to choose WHICH email, if they have multiple. + +## Customer/FinanceTab: + +- The overall Financial Status should be smaller, more compact and differentiated than the active order statuses. + +- When an order is complete in terms of finance, make it really obvious (maybe make the whole payment container green) + +- Do not allow negative numbers in Amount fields. + + +## Device Inventory Page: + +- Add a button somewhere to "Send APP Link via mail" + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + +// FIRMWARE: + +- When Resetting Settings, via the S1 Key, if on AP Mode, switch back to STA Mode. + +- On the /{deviceip}/settings page, add basic auth with pass: "bsvspr8998" + +- Add AutoDST switch (figure out the system behind it) + +- Add + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + +// FLUTTER APP: + +- Add a post to firestore each time the app LOGS IN, or Loads the Playback Menu + +- Add a option/system to allow the Console to REFRESH the melodies list with the new Titles/Descriptions/Info + +- Add option to DELETE melodies + +- Add option in the Settings to Test Fire a bell + +