Generate custom building instructions for QR codes and mosaics using bricks! Brickify helps you convert WiFi credentials or images into scannable QR codes and mosaics made from standard brick parts.
- QR code builder: encode your WiFi network, get a parts list and instructions
- Mosaic builder: turn any image into a brick mosaic (coming soon)
- Optimized for real brick parts and colors
- Deployable to GitHub Pages
- Modern Nuxt UI components with Tailwind CSS
Visit the live application: https://robokozo.github.io/brickify/
This project is configured for automatic deployment to GitHub Pages.
-
Enable GitHub Pages
- Go to your repository settings
- Navigate to "Pages" section
- Source: Select "GitHub Actions"
-
Push to main branch
git push origin main
The GitHub Actions workflow will automatically build and deploy your site to:
https://robokozo.github.io/brickify/
To deploy manually:
npm run generateThen upload the contents of .output/public/ to your hosting provider.
- Node.js 18.x or higher
- npm or yarn
-
Clone the repository
git clone https://github.com/robokozo/lego-wifi-qr-builder.git cd lego-wifi-qr-builder -
Install dependencies
npm install
-
Run development server
npm run dev
The application will be available at
http://localhost:3000 -
Build for production
npm run generate
The static files will be generated in
.output/public/
The application uses an intelligent greedy algorithm to optimize brick placement:
- Large bricks: 2Γ8, 2Γ6, 2Γ4 plates
- Medium bricks: 2Γ3, 2Γ2, 1Γ4, 1Γ3 plates
- Small bricks: 1Γ2, 1Γ1 plates/tiles
- Scan the QR grid from top-left to bottom-right
- Try largest bricks first at each position
- Test both orientations (horizontal and vertical)
- Place brick if all cells match color and are unused
- Mark cells as used and continue
- Fallback to smaller bricks if large ones don't fit
- Time Complexity: O(n Γ m Γ k) where:
- n = grid height
- m = grid width
- k = number of brick types (9)
- Space Complexity: O(n Γ m) for tracking used cells
- Typical Savings: 40-60% reduction in pieces
For a 37Γ37 QR code (1,369 studs):
- Before: 1,369 pieces (all 1Γ1)
- After: 643 pieces (optimized)
- Breakdown: 28Γ 2Γ4, 24Γ 1Γ4, 104Γ 2Γ2, 75Γ 1Γ2, 62Γ 1Γ1
- Savings: 53% (726 fewer pieces)
WiFi QR codes follow this format:
WIFI:T:WPA;S:mynetwork;P:mypassword;H:true;;
Where:
T= Security type (WPA, WEP, or nopass)S= SSID (network name)P= PasswordH= Hidden network (optional)
The application uses Level H (High) error correction, which allows for:
- Up to 30% of the QR code to be damaged/obscured
- Best for physical builds where some bricks might be misaligned
Uses the WCAG 2.1 contrast ratio formula:
- Excellent: 7:1 or higher (WCAG AAA)
- Good: 4.5:1 or higher (WCAG AA)
- Poor: Below 4.5:1 (may be difficult to scan)
- 1Γ scale: Each QR pixel = 1Γ1 stud
- 2Γ scale: Each QR pixel = 2Γ2 studs
- 3Γ scale: Each QR pixel = 3Γ3 studs
- 4Γ scale: Each QR pixel = 4Γ4 studs
Larger scales are easier to build but require more bricks.
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
-
Color Selection: Use high-contrast colors for reliable scanning
- Black on white is always a safe choice
- Avoid light-on-light or dark-on-dark combinations
-
Baseplate Size: Larger baseplates allow for bigger QR codes
- Start with 32Γ32 for most networks
- Use 48Γ48 for complex passwords or higher scales
-
Building Tips:
- Use 1Γ1 tiles for a smooth finish
- Use 1Γ1 plates if tiles aren't available
- Build on a flat baseplate for best results
- Double-check alignment before scanning
-
Testing: Always test your QR code with multiple devices before committing to a large build!
- Check contrast ratio (should be "Good" or "Excellent")
- Ensure all bricks are properly aligned
- Try increasing the scale factor
- Test in good lighting conditions
- Make sure camera is perpendicular to the build
- Choose a larger baseplate
- Reduce the scale factor
- Use a shorter SSID or password if possible
For questions, suggestions, or issues, please open an issue on GitHub.
Happy Building! π§±π±