This is a Laser Control Bridge application that provides a web interface for controlling laser engravers/cutters. The system bridges LightBurn software to GRBL-based laser controllers via serial communication, with support for air assist GPIO control on Raspberry Pi. The web dashboard allows real-time laser control, G-code generation from text/fonts, macro management, and configuration of serial/TCP/GPIO settings.
Preferred communication style: Simple, everyday language.
- Framework: React 18 with TypeScript
- Routing: Wouter (lightweight client-side routing)
- State Management: TanStack React Query for server state
- UI Components: shadcn/ui component library built on Radix UI primitives
- Styling: Tailwind CSS with CSS variables for theming (industrial dark/light theme)
- Build Tool: Vite with HMR support
- Framework: Express.js with TypeScript
- Pattern: RESTful API endpoints defined in shared route schemas
- Validation: Zod schemas shared between client and server for type-safe API contracts
- File Storage: Local filesystem for uploaded fonts and G-code files
- Configuration: INI file-based storage for bridge settings (
config.ini)
- ORM: Drizzle ORM configured for PostgreSQL
- Schema Location:
shared/schema.tscontains Zod schemas for validation - Database: PostgreSQL (requires
DATABASE_URLenvironment variable)
- Purpose:
lightburn_bridge.pyruns on Raspberry Pi to bridge TCP connections to serial GRBL controller - GPIO Control: WiringPi for air assist relay control
- Configuration: Reads from
config.inifor serial port, baudrate, GPIO pins
-
Shared Schema Pattern: Zod schemas in
shared/are used for both frontend form validation and backend request validation, ensuring type safety across the stack. -
API Contract Structure: Routes defined in
shared/routes.tswith method, path, input schema, and response schemas - enabling typed API calls. -
Hybrid Storage: Configuration uses INI files (for compatibility with Python bridge), while file uploads use local filesystem.
-
Component Library: shadcn/ui provides accessible, customizable components without heavy dependencies.
- PostgreSQL: Primary database, connection via
DATABASE_URLenvironment variable - Drizzle Kit: Database migrations stored in
./migrations
- opentype.js: Font parsing for text-to-G-code conversion
- No external APIs: Application runs fully self-contained
- Serial connection to GRBL controller (default:
/dev/ttyUSB0) - WiringPi GPIO library for air assist control
- Python dependencies:
serial,wiringpi,configparser
@tanstack/react-query: Server state managementdrizzle-orm/drizzle-zod: Database ORM with Zod integrationexpress: HTTP serverzod: Runtime type validationreact-hook-form/@hookform/resolvers: Form handling with Zod validation