https://github.com/asimihsan/copier_rust_template
Copier template for Rust, WebAssembly, and Vite TypeScript
https://github.com/asimihsan/copier_rust_template
copier-template python-template rust rust-template typescript vite vite-template wasm-template web-template webassembly
Last synced: about 2 months ago
JSON representation
Copier template for Rust, WebAssembly, and Vite TypeScript
- Host: GitHub
- URL: https://github.com/asimihsan/copier_rust_template
- Owner: asimihsan
- License: mpl-2.0
- Created: 2025-02-02T20:32:35.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-12T11:33:42.000Z (12 months ago)
- Last Synced: 2025-06-12T11:54:18.046Z (12 months ago)
- Topics: copier-template, python-template, rust, rust-template, typescript, vite, vite-template, wasm-template, web-template, webassembly
- Language: Jinja
- Homepage:
- Size: 103 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
๐ฆ Rust Multi-Platform Starter
Build Once, Run Everywhere: CLI โข WASM โข Python โข Go
A unified Rust template for building native CLIs, WebAssembly modules,
Python extensions, and Go bindings from a single codebase.
### ๐ฏ Key Features
- ๐ฆ Cross-platform Rust core
- ๐ WASM bindings with web integration _(Optional)_
- ๐ Python bindings _(Optional)_
- ๐ฆซ Go bindings _(Optional)_
- ๐ GitHub Actions CI pipeline
- ๐ ๏ธ Zero-config setup
- ๐ Comprehensive testing
## Requirements
To use this template, you need to install the following tools:
- **[Mise](https://mise.jdx.dev/):** Installs and manages Rust, Node, Python, PNPM, and every other tool used by this template.
If you don't have Mise yet, simply run `scripts/dev-setup.sh` and follow the prompts.
- **[Copier](https://copier.readthedocs.io/):** Generates a new project from
this template.
## Quickstart
Generate your project:
```bash
copier copy gh:asimihsan/copier_rust_template my-awesome-project
```
Change into your new project directory:
```bash
cd my-awesome-project
git init
jj git init --colocate
```
Install dependencies (Mise will take care of everything):
```bash
./scripts/dev-setup.sh # one-time, installs mise if missing
mise install # installs the toolchain versions specified in mise.toml
```
Set up tools:
```bash
mise run setup
```
Add copyright header:
```bash
mise run copyright
```
Build and test your project:
```bash
mise run ci
```
## Development Tools & Workflow
The template provides a comprehensive development environment powered by Mise.
No manual tool installation requiredโeverything from Rust nightly to
WebAssembly toolchains is automatically configured.
**Testing & Quality** Comprehensive test suites run across all platforms, with
coverage tracking and fuzz testing for core components. Automated CI pipelines
ensure consistent quality on every commit.
**Development Loop** Fast iteration with hot reloading for web development,
watch mode for Rust, and automated rebuilds of Python extensions. Commands are
discovered from `mise-tasks/`, so `mise tasks` shows the generated workflow
surface directly.
๐ง Cargo, bun, and uv for dependency management
๐ Clippy and ESLint for static analysis
โจ rustfmt and Prettier keep code clean
๐ Code coverage and performance profiling
## Project Configuration
Choose your project components when generating from the template:
```bash
# Full-featured project (default)
copier copy gh:asimihsan/copier_rust_template my-project
# Core + WebAssembly only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_python=false \
--data include_go=false
# Core + Python bindings only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_wasm=false \
--data include_go=false
# Core + Go bindings only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_wasm=false \
--data include_python=false
# Core functionality only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_wasm=false \
--data include_python=false \
--data include_go=false
```
## Project Structure
Your generated project will include:
**Core Components**
- `crates/core/`: Your main Rust library codebase
- `crates/cli/`: Command-line interface implementation
- `Cargo.toml` & `deny.toml`: Rust project configuration
- `.rustfmt.toml`: Code formatting rules
- `mise-tasks/`: Script-backed developer commands
**Optional Components**
- `crates/wasm/`: WebAssembly module (when `include_wasm=true`)
- `web/`: TypeScript frontend (when `include_wasm=true`)
- `crates/python/`: Rust extension crate for Python bindings (when `include_python=true`)
- `python/`: Python packaging and tests (when `include_python=true`)
- `crates/go/`: Rust crate for Go bindings (when `include_go=true`)
- `crates/go-wasm/`: Rust crate for Go/WASI bindings (when `include_go=true`)
**Development Environment**
- `mise.toml`: Toolchain configuration and common operations
- `.envrc`: Automatic environment activation
- `.watchmanconfig`: File-watcher ignore defaults carried over from `sheeptext`
## Testing
Run the full rendered-project validation locally:
```bash
mise run template:ci
```
If you want to inspect the rendered project after the run, set `OUTPUT_DIR`:
```bash
OUTPUT_DIR=/tmp/copier-rust-template-check mise run template:ci
```
## Contributing
If you find issues or have improvements to suggest, please open an issue or
submit a pull request.
## License
This project is licensed under the Mozilla Public License 2.0. See the
[LICENSE](LICENSE) file for details.