A high-performance, cross-platform QR code generator written in Rust with WebAssembly support. This project aims to provide a robust, efficient, and flexible solution for generating QR codes across different platforms and use cases.
- Create a performant QR code generation library in Rust
- Provide WebAssembly bindings for web applications
- Support multiple output formats (PNG, SVG, etc.)
- Enable customization of QR code appearance and properties
- Maintain high code quality and comprehensive test coverage
- Offer a simple, intuitive API for developers
- HAVE FUN! I'm having fun coding. Maybe this will be ready for production one day, right now it's not.
- Experiment with AI code assistants.
- 🚀 High-performance QR code generation using Rust
- 🌐 WebAssembly support for web applications
- 🎨 Customizable QR code appearance
- 📦 Multiple output format support
- 🔒 Error correction levels
- 🧪 Comprehensive test suite
- 📚 Well-documented API
Try the web example live: https://themcmurder.github.io/qrcode/
The demo showcases:
- Real-time QR code generation
- Customizable shapes and colors
- WebAssembly performance
- Responsive design
qrcode/
├── core/ # Core Rust library
├── bindings/ # Platform-specific bindings
│ └── wasm/ # WebAssembly bindings
├── examples/ # Example implementations
│ └── web/ # Web example using Vite
└── docs/ # Documentation
This project uses Turborepo to manage the build pipeline and dependencies between packages. Turborepo helps us:
- Manage dependencies between Rust and JavaScript/TypeScript packages
- Cache build outputs for faster subsequent builds
- Run builds in parallel where possible
- Maintain consistent build environments
- Workspaces: The project is organized into workspaces (core, bindings, examples)
- Pipeline: Defined in
turbo.json, orchestrates the build process - Caching: Build outputs are cached to speed up development
- Dependencies: Automatic handling of workspace dependencies
- Rust (latest stable)
- Node.js (latest LTS)
- wasm-pack
- pnpm (recommended) or npm
pnpm install
pnpm buildcd examples/web
pnpm devAfter making changes to the Rust WASM code, rebuild and update the dependency:
cd bindings/wasm
wasm-pack build --target web
cd ../../examples/web
pnpm installsee WASM DEPENDENCY RESOLUTION.
For architectural decisions, workflow rationale, and advanced usage, see the ADR directory.
- Rust (latest stable)
- Node.js (latest LTS)
- wasm-pack (for WebAssembly builds)
- pnpm (recommended) or npm
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run development environment
pnpm devYou can work on specific packages using Turborepo's filtering:
# Build only the core library
pnpm build --filter=core
# Build and watch the web example
pnpm dev --filter=web-exampleThe web example runs on a development server at http://localhost:3000. To start it:
cd examples/web
pnpm devThe server features:
- Hot Module Replacement (HMR)
- Fast refresh for quick development
- TypeScript support
- Vite's optimized build process
cd core
cargo buildcd bindings/wasm
wasm-pack build --target webThis project is currently a personal learning experiment for me to explore Rust, WebAssembly, and AI-assisted development. I'm not actively seeking contributions at this time as I'm focused on the learning journey.
If you find this project interesting or have ideas for collaboration in the future, feel free to reach out! I may open it up for contributions once I've learned what I set out to learn and feel ready to collaborate with others.
For now, I'm enjoying the process of building this solo and experimenting with different approaches. Thanks for understanding!
MIT