Go to file
rail 15a18e45b4 Rewrite landing page in Rust + WebAssembly
- Complete rewrite from HTML/CSS/JS to Rust + WASM
- Uses vanilla wasm-bindgen with web-sys (no framework)
- Minimal bundle size: ~19KB WASM + 9KB JS
- Modern, clean redesign with dark theme
- Local builds, dist files committed for fast CI

Technical changes:
- Added Cargo.toml with wasm-bindgen, web-sys dependencies
- Implemented landing page in src/lib.rs using web_sys DOM API
- Created minimal index.html shell for WASM loading
- Designed modern CSS with responsive layout
- Archived old HTML files to html-old/
- Updated Dockerfile to copy dist/ instead of html/
- Updated build process in README.md
- Documented migration in CHANGELOG.md

Build process:
1. cargo build --release --target wasm32-unknown-unknown
2. wasm-bindgen --out-dir dist --target web
3. Copy static assets to dist/
4. Commit dist/ to git for fast CI deployment

Benefits:
- Near-native performance
- Type safety from Rust
- Smaller bundle size
- Modern web technology stack
2025-10-25 23:14:46 +03:00
.cargo Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
dist Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
html-old Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
src Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
.gitignore Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
.woodpecker.yml Pass DCAPE_ROOT as make variable instead of environment 2025-10-25 22:13:32 +03:00
Cargo.toml Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
Dockerfile Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
Makefile Initial commit: railwayka.ru landing page as dcape app 2025-10-25 21:04:29 +03:00
README.md Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
docker-compose.yml Initial commit: railwayka.ru landing page as dcape app 2025-10-25 21:04:29 +03:00
index.html Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00
style.css Rewrite landing page in Rust + WebAssembly 2025-10-25 23:14:46 +03:00

README.md

railwayka.ru Landing Page

Modern business card website for railwayka.ru infrastructure, built with Rust + WebAssembly and deployed via dcape GitOps platform.

Features

  • 🦀 Rust + WebAssembly - High-performance, compiled to WASM
  • Modern dark theme with clean design
  • Service cards showcasing current and planned services
  • Technology stack descriptions
  • Fully responsive layout
  • Minimal bundle size (~19KB WASM)

Technology Stack

  • Rust: Core application logic
  • WebAssembly: Fast, portable binary format
  • wasm-bindgen: Rust-WASM bindings
  • web-sys: Web API bindings for Rust
  • Nginx: Alpine-based web server
  • Docker: Containerized deployment
  • Traefik: Automatic HTTPS via Let's Encrypt
  • Dcape: GitOps-based deployment

Deployment

This application uses GitOps workflow:

  1. Push code to Git repository
  2. Woodpecker CI automatically triggers
  3. Application builds and deploys
  4. Service goes live at https://railwayka.ru

Manual Deployment

# Clone repository
git clone https://git.dc.railwayka.ru/howl/railwayka-landing.git
cd railwayka-landing

# Configure environment
make config
# Edit .env.sample and rename to .env
mv .env.sample .env

# Build and deploy
make docker-build
make up

Building from Source

Prerequisites

  • Rust (latest stable) - install from rustup.rs
  • wasm-bindgen-cli - cargo install wasm-bindgen-cli
  • wasm32 target - rustup target add wasm32-unknown-unknown

Build Steps

# 1. Build Rust to WASM
cargo build --release --target wasm32-unknown-unknown

# 2. Generate JS bindings
wasm-bindgen --out-dir dist --target web \
  target/wasm32-unknown-unknown/release/railwayka_landing.wasm

# 3. Copy static assets
cp index.html style.css dist/

# 4. Serve locally
cd dist
python3 -m http.server 8000
# Visit http://localhost:8000

Quick Build Script

For convenience, you can use this one-liner:

cargo build --release --target wasm32-unknown-unknown && \
wasm-bindgen --out-dir dist --target web target/wasm32-unknown-unknown/release/railwayka_landing.wasm && \
cp index.html style.css dist/

Project Structure

.
├── Cargo.toml              # Rust project manifest
├── .cargo/
│   └── config.toml         # Rust build configuration
├── src/
│   └── lib.rs              # Main Rust/WASM code
├── index.html              # HTML shell
├── style.css               # Styling
├── dist/                   # Built artifacts (committed to git)
│   ├── index.html
│   ├── style.css
│   ├── railwayka_landing.js
│   ├── railwayka_landing_bg.wasm
│   └── *.d.ts
├── html-old/               # Archived old HTML version
├── Makefile                # Dcape app Makefile
├── docker-compose.yml      # Service definition
├── Dockerfile              # Nginx deployment
└── .woodpecker.yml         # CI/CD pipeline

Why Rust + WASM?

  • Performance: Near-native execution speed
  • Size: Optimized bundle (~19KB WASM + 9KB JS)
  • Type Safety: Rust's type system prevents common bugs
  • Modern: Cutting-edge web technology
  • Learning: Great opportunity to explore WASM ecosystem

License

MIT