Skip to content

Add live refresh using Vite in Docker runtime environment#4

Open
mikhail-shevtsov-wiregate wants to merge 2 commits into
CNCKitchen:mainfrom
mikhail-shevtsov-wiregate:main
Open

Add live refresh using Vite in Docker runtime environment#4
mikhail-shevtsov-wiregate wants to merge 2 commits into
CNCKitchen:mainfrom
mikhail-shevtsov-wiregate:main

Conversation

@mikhail-shevtsov-wiregate

@mikhail-shevtsov-wiregate mikhail-shevtsov-wiregate commented Apr 4, 2026

Copy link
Copy Markdown

Closes #21

Goal

Add ability to run project locally without worrying about installation of node.js

New Dependencies

  • Docker

New Features

  • Project source is constantly watched by VITE dev server and browser page automatically refreshes if changes are found;
  • Production build compresses/minifies HTML, JS and CSS;
  • Production build automatically adds HASH sum to generated files - necessary for serving latest version to clients without worrying about cache;
  • Production build is hosted in Docker using nginx - MAX performance;

Affected flow

  • Current flow not affected;
  • Source codes moved to src/ directory;
  • Source codes are not modified;

Future recommendations

  • Add GitHub pipelines for automated build/deploy;
  • Add automatic image compression;

Demo

stlTexturizer-vite-docker.mp4

@mikhail-shevtsov-wiregate

Copy link
Copy Markdown
Author

@CNCKitchen I've rebased my PR according to latest commit to resolve conflicts. Please review. Let me know if you have any question/suggestion.

Configure Vite for building and serving the application.
Introduce Docker-based development and production environments.
Add multi-stage Dockerfile for building and serving the application.
Provide docker-compose configuration for container orchestration.
Include Nginx configuration template for production deployment.
Update README with instructions for Docker-based workflows.
Define project dependencies and scripts in package.json.
Update gitignore to exclude build artifacts and dependencies.
@mikhail-shevtsov-wiregate

Copy link
Copy Markdown
Author

@CNCKitchen I've rebased my PR according to latest commit to resolve any conflicts. Tested build - everything works as expected.

123aanthony added a commit to 123aanthony/stlTexturizer that referenced this pull request Jun 28, 2026
8 findings (confirmés/suspectés) avec file:line. Deux racines : double-état
global↔slot (CNCKitchen#4 = étape 3) et persistance sédimentée (CNCKitchen#1 clé morte, CNCKitchen#2 clé
surchargée, CNCKitchen#3 dérive d'échelle cylindrique, CNCKitchen#8 formats divergents). Ordre de
correction proposé.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
123aanthony added a commit to 123aanthony/stlTexturizer that referenced this pull request Jun 28, 2026
CNCKitchen#4 (source unique de vérité)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
123aanthony added a commit to 123aanthony/stlTexturizer that referenced this pull request Jun 28, 2026
… lecteurs de slot

Premier pas vers la source unique de vérité. Les lecteurs choisissaient chacun
leur source (globals du slot actif vs champs stockés) → divergences :
slotHasContent OR-ait les deux ; getSlotFaceCount ne lisait que les champs stockés
(donc faux pour le slot actif non encore sauvegardé).

resolveSlotState(slot, isActive, liveGlobals) canalise TOUT lecteur par une règle
unique : globals live pour le slot actif (autoritaires car les plus frais), champs
stockés sinon. + stateHasContent / stateFaceCount dérivés. Logique pure dans
slotState.js, 4 tests headless (dont "le live vide gagne sur le champ stocké
périmé" — le vrai sens de CNCKitchen#4). main.js délègue via getSlotState/liveSlotGlobals.

Changement de comportement (voulu) : le slot actif ne signale plus de contenu
"fantôme" venant de champs stockés périmés ; il reflète l'état live. liveSlotGlobals
n'est calculé que pour le slot actif (évite N× computeAssignedFaces au refresh).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
123aanthony added a commit to 123aanthony/stlTexturizer that referenced this pull request Jun 28, 2026
…State

Suite de la source unique de vérité. Migrés vers resolveSlotState/getSlotState :
- getSlotOverlapCount : résout les assignedFaces de CHAQUE slot une fois (le slot
  actif via les globals live) → l'overlap ne se calcule plus contre le set stocké
  périmé du slot actif.
- getSlotTooltip : map/mode/faces via l'état résolu.
- renderTextureTabs (meta + miniature) : map/entry via l'état résolu.

Restant légitime : restoreSlotState (= le point de sync slot→globals) et
serializeProjectTextureSlots (commence par saveActiveSlotState, donc lit du frais).
Tous les lecteurs d'UI live sont désormais cohérents — plus aucun ne peut diverger
sur l'état du slot actif. Suite verte (10 ok).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
123aanthony added a commit to 123aanthony/stlTexturizer that referenced this pull request Jun 28, 2026
… ; mirror-removal optionnel

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@EllaFoxo EllaFoxo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition; Vite is quite handy to have. Could also be extended later into the CI/CD pipeline. I'd recommend checking with @CNCKitchen first about the change of directory structure.

Comment thread Dockerfile
@@ -0,0 +1,32 @@
FROM node:24-alpine AS base

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would recommend pinning to lts-alpine instead

Comment thread README.md
- **Texture smoothing** — configurable blur to soften the displacement map before applying

### Projection Modes

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would recommend not changing the formatting in places you don't need to; keeps this PR easy to rebase then.

@mikhail-shevtsov-wiregate

Copy link
Copy Markdown
Author

Nice addition; Vite is quite handy to have. Could also be extended later into the CI/CD pipeline. I'd recommend checking with @CNCKitchen first about the change of directory structure.

I don't mind updating to the latest branch - it's just would be good to hear owner @CNCKitchen opinion on this. If he ever needs it.

@TimGoll

TimGoll commented Jul 14, 2026

Copy link
Copy Markdown

This is exactly what I was looking for. I'd really appreciate if this was merged into main!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker-compose for faster and easier local deployment

3 participants