feat: integrate Tailwind CSS for improved styling and layout

- Added Tailwind CSS and its Vite plugin to the frontend project.
- Updated App.svelte to enhance UI with Tailwind classes, including a new layout for the serial monitor and command tester.
- Improved logging functionality by increasing log history and adding more detailed log messages.
- Refactored SendBox.svelte for consistent styling with Tailwind.
- Enhanced Pico firmware to support structured event logging and command parsing.
- Updated README_PICO_SERIAL.md to provide comprehensive documentation on serial communication and backend integration.
- Added .dockerignore to optimize Docker builds by excluding unnecessary files.
This commit is contained in:
2025-08-30 14:18:57 +02:00
parent d607308b1d
commit 46899ef7be
13 changed files with 1258 additions and 184 deletions

View File

@@ -1,20 +1,48 @@
# Multi-stage build for SvelteKit (static client + node server fallback)
FROM node:20-bookworm-slim AS builder
WORKDIR /app
######## Combined Frontend + Backend build (single Node runtime) ########
# This Dockerfile now builds BOTH the Svelte frontend and the NestJS backend
# and serves the compiled frontend through the backend (Express static).
# Install deps (use package-lock if present)
COPY package*.json ./
########################
# 1) Frontend build #
########################
FROM node:20-bookworm-slim AS frontend-build
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm install --no-audit --no-fund
# Copy sources and build
COPY . .
COPY frontend/ .
RUN npm run build
# Use a lightweight nginx to serve the client build output
FROM nginx:alpine AS runner
COPY --from=builder /app/dist /usr/share/nginx/html
########################
# 2) Backend build #
########################
FROM node:20-bookworm-slim AS backend-build
WORKDIR /app
COPY backend/package*.json ./
RUN npm install --no-audit --no-fund
COPY backend/ .
# Copy compiled frontend into backend/public (served statically by Nest)
COPY --from=frontend-build /frontend/dist ./public
RUN npm run build
# Default nginx port
EXPOSE 80
########################
# 3) Production image #
########################
FROM node:20-bookworm-slim AS runner
ENV NODE_ENV=production
WORKDIR /app
CMD ["nginx", "-g", "daemon off;"]
# Install only production deps (reuse original package.json)
COPY backend/package*.json ./
RUN npm install --omit=dev --no-audit --no-fund
# Copy backend dist + public assets
COPY --from=backend-build /app/dist ./dist
COPY --from=backend-build /app/public ./public
# Environment (override at runtime as needed)
ENV PORT=3000 \
SERIAL_BAUD=115200
EXPOSE 3000
CMD ["node", "dist/main.js"]