🎓 Program Overview
Rust is genuinely different from every other language you have used. The ownership and borrowing system is not just syntax to memorise — it is a new mental model for reasoning about memory and concurrency. What was once a systems programming language for operating systems and embedded firmware is now powering production web backends, cloud infrastructure tooling, WebAssembly modules, and AI inference engines at companies like Cloudflare, Discord, Dropbox, Mozilla, and AWS.
This course pairs Rust's high-performance backend capabilities with Next.js 15 on the frontend. You will build real APIs with Axum, real WebAssembly modules that run in the browser at near-native speed, and a real deployed application. The course does not cut corners on the hard parts — ownership, lifetimes, and async Rust are covered thoroughly, because rushing them is the single most common reason developers struggle with Rust.
💡 Why Rust + Next.js in 2026
📚 Core Program — 5 Weeks
Rust is genuinely different from every other language you have used. The ownership and borrowing system is a new mental model for reasoning about memory and concurrency — not just syntax. This phase takes the time to build that mental model correctly. Rushing it is the single most common reason developers struggle with Rust.
- Installing Rust: rustup, cargo, rustfmt, clippy, and the Rust toolchain explained
- Rust's core promise: memory safety and fearless concurrency without a garbage collector — what this actually means in practice
- Ownership: every value has one owner, ownership transfers on assignment, values are dropped when the owner goes out of scope
- Move semantics vs copy semantics: which types are moved (String, Vec, structs) and which are copied (integers, booleans, Copy types)
- Borrowing: shared references (&T) and mutable references (&mut T) — the borrow checker rules and why they exist
- Lifetimes: what they are, why the compiler needs them, and how to annotate them when required
- The stack and the heap in Rust: understanding where values live and why it matters for performance
- Structs and impl blocks: defining data and behaviour — Rust's equivalent of classes without inheritance
- Enums and pattern matching: Rust's enums are algebraic data types — the most powerful feature of the type system
- Option<T> and Result<T, E>: Rust's null-free, exception-free approach to optional values and error handling
- The ? operator: propagating errors without boilerplate
- Traits: Rust's polymorphism mechanism — defining shared behaviour across types
- Generics: writing code that works over many types without sacrificing performance
- Closures: anonymous functions that capture their environment — how they interact with ownership
- Iterators: map, filter, fold, collect, and writing custom iterators — the functional iteration model
- Modules and crates: organising Rust code, the Cargo.toml manifest, and publishing to crates.io
Before building web servers, this phase covers the Rust capabilities that make it a systems language — concurrency, async programming, and the standard library patterns that production Rust code depends on.
- Collections in depth: Vec<T>, HashMap<K,V>, HashSet<T>, BTreeMap, and when to use each
- String types: String vs &str — why Rust has two string types and how to work with both
- Error handling in depth: defining custom error types, the thiserror crate for ergonomic error definitions, and anyhow for application-level handling
- Trait objects and dynamic dispatch: Box<dyn Trait> vs generics — runtime vs compile-time polymorphism
- Smart pointers: Box<T>, Rc<T>, Arc<T>, RefCell<T>, and Mutex<T> — when and why to use each
- Fearless concurrency: threads in Rust, the Send and Sync traits, and why data races are compile-time errors
- Async Rust fundamentals: Future, async/await syntax, and how the async runtime model works
- Tokio: the dominant async runtime — tasks, channels, timers, and the multi-threaded scheduler
- Async channels: mpsc, broadcast, and watch channels for communicating between async tasks
- Testing in Rust: unit tests with #[test], integration tests, and cargo test
- Benchmarking with Criterion: measuring performance and catching regressions
- Logging and tracing: the tracing crate for structured, async-aware instrumentation
- Serialisation with Serde: JSON, TOML, YAML, MessagePack — the universal serialisation framework
- Working with environment variables and configuration: the config and dotenvy crates
- Cargo workspaces: managing multi-crate projects — monorepo structure for full-stack Rust
Axum is the leading Rust web framework, built on Tokio and the Tower middleware ecosystem — ergonomic, composable, and extremely fast. This phase builds a complete, production-quality REST API from scratch.
- Axum architecture: routers, handlers, extractors, and the Tower service model
- Routing: defining routes, nested routers, route parameters, and wildcard paths
- Handlers: async handler functions, multiple return types, and the IntoResponse trait
- Extractors: Path, Query, Json, State, Extension, Form, and writing custom extractors
- State management: sharing application state (database pools, config, caches) across handlers with Arc
- JSON request validation: using Serde and the validator crate
- Error handling in Axum: defining application error types that implement IntoResponse
- Middleware with Tower: logging, request timing, CORS, compression, and rate limiting as composable layers
- Authentication middleware: JWT validation with jsonwebtoken, extracting claims in handlers
- SQLx: async, compile-time verified SQL queries for PostgreSQL — no ORM, no magic, just safe SQL
- Connection pooling with PgPool: pool size, timeouts, and connection health checks
- Database migrations with sqlx migrate: versioned schema management from CLI and at application startup
- Query patterns: select, insert, update, delete, transactions, and bulk operations with SQLx
- Type-safe query results: mapping database rows to Rust structs with the FromRow derive macro
- Redis integration with deadpool-redis: caching, session storage, and rate limit counters
- Authentication system: registration, login, JWT issuance, refresh tokens, and token revocation
- Password hashing with Argon2: the current best-practice algorithm, implemented securely in Rust
- Role-based access control: permission guards as Axum middleware and extractors
- File uploads: multipart form handling, streaming large uploads to S3-compatible storage
- Email integration: sending transactional emails with the lettre crate and SMTP / Resend
- Background jobs: spawning Tokio tasks for persistent job queues
- Pagination, filtering, and sorting: generic query parameter patterns for list endpoints
- OpenAPI documentation: generating API docs from Axum routes with utoipa
- Integration testing: spinning up a test database, seeding fixtures, and testing the full HTTP stack with axum-test
- HTTP/2 and TLS: configuring Axum with rustls (native Rust TLS, no OpenSSL dependency)
WebAssembly lets you run Rust code in the browser at near-native speed. This opens up frontend use cases that JavaScript cannot serve well: image processing, cryptography, data compression, PDF generation, and scientific computation. This phase covers the full Rust-to-WASM workflow.
- What WebAssembly is: the binary instruction format that browsers execute alongside JavaScript
- Why Rust for WASM: minimal runtime, no GC pauses, and first-class wasm-bindgen support
- wasm-pack: the tool that compiles Rust to WASM and generates JavaScript bindings automatically
- wasm-bindgen: exposing Rust functions to JavaScript and calling JavaScript APIs from Rust
- js-sys and web-sys: Rust bindings for JavaScript builtins and Web APIs (DOM, fetch, canvas, WebGL)
- Passing complex data between Rust and JavaScript: strings, typed arrays, and structs via serde-wasm-bindgen
- Integrating a WASM module into Next.js: dynamic imports, loading strategies, and avoiding SSR issues
- Performance profiling: measuring the speedup of Rust/WASM vs pure JavaScript for compute-intensive tasks
- Real-world WASM modules built in this phase: client-side image compression, AES-256 browser encryption, and CSV parsing without blocking the main thread
- WASM threads with SharedArrayBuffer: parallel computation in the browser using Rayon compiled to WASM
- WASM size optimisation: wasm-opt, tree shaking, and keeping bundle sizes small
- Cloudflare Workers with Rust: deploying Rust WASM as edge functions at Cloudflare's global network
The frontend layer built with Next.js 15 and TypeScript — consuming the Rust API and integrating WASM modules for client-side computation. Full coverage for those new to Next.js; faster track for experienced Next.js developers.
- Next.js 15 App Router: server components, client components, layouts, and loading states
- TypeScript-first: generating typed API clients from the OpenAPI spec produced by utoipa in the Axum backend
- Data fetching: server component fetch, TanStack Query for client-side state, and optimistic updates
- Authentication on the frontend: NextAuth.js v5 with the Rust JWT backend, session management, and protected routes
- Form handling: React Hook Form with Zod validation, matching the validation rules in the Rust backend
- Integrating the Rust WASM module: dynamic import, Web Worker offloading, and progress UI for long computations
- Tailwind CSS v4: utility-first styling, component patterns, and dark mode
- Real-time features: WebSocket connections to the Axum backend using tokio-tungstenite
- File upload UI: drag-and-drop, progress tracking, and previews connected to the Axum multipart endpoint
- Error boundaries, loading skeletons, and optimistic UI patterns
- Deployment: Vercel for the Next.js frontend, Docker for the Rust backend
Rust's performance potential is real but not automatic. This phase covers the profiling, optimisation, and hardening work that makes a Rust service genuinely production-ready — from benchmarking to graceful shutdown.
- Benchmarking Axum endpoints: measuring throughput and latency with wrk, hey, and k6
- CPU profiling Rust applications: flamegraph generation with cargo-flamegraph and pprof
- Memory profiling: detecting allocations and leaks with heaptrack and valgrind
- Connection pool tuning: optimising PgPool and Redis pool settings for throughput
- Async task optimisation: avoiding blocking operations on async threads, using spawn_blocking correctly
- Rate limiting: token bucket and sliding window algorithms in Axum middleware with Redis
- Security hardening: SQL injection prevention with SQLx parameterised queries, XSS/CSRF protection, and security headers
- Dependency auditing: cargo audit for known vulnerabilities in dependencies
- Docker for Rust: multi-stage builds that produce minimal production images (under 20MB final image)
- Graceful shutdown: draining in-flight requests and closing database connections cleanly on SIGTERM
- Health checks and readiness probes: /health and /ready endpoints for container orchestration
- Structured logging in production: JSON log output with tracing-subscriber for log aggregation
- GitHub Actions CI/CD: automated Rust build, test, Docker build, and deployment pipeline
🔌 Optional Add-On Modules
Six add-on modules, 2 weeks each — additional fee per module. Take individually or combine. All require the core program as prerequisite.
Deploy your Rust backend across the AWS ecosystem — from serverless Lambda functions with lambda_runtime to containerised ECS services to the API Gateway edge.
- AWS Lambda with Rust: the lambda_runtime crate, cold start performance, and the Lambda Web Adapter for running Axum on Lambda
- AWS API Gateway: REST and HTTP API configurations, Lambda proxy integration, and custom authorisers in Rust
- Containerised deployment: pushing Rust Docker images to ECR and running on ECS Fargate with auto-scaling
- AWS RDS: managed PostgreSQL — connection pooling strategies for Lambda (RDS Proxy) vs ECS (direct pool)
- AWS S3: file storage from Rust using the aws-sdk-s3 crate — presigned URLs, multipart uploads
- AWS Secrets Manager: fetching database credentials and API keys at runtime in Rust
- AWS SQS and SNS: async messaging patterns in Rust — background job processing via SQS consumers
- Infrastructure as Code with AWS CDK (TypeScript): provisioning the entire Rust + Next.js stack
- CloudWatch: structured log ingestion from Rust services, custom metrics, and alarms
- CI/CD with GitHub Actions: automated Rust build, test, Docker push to ECR, and ECS/Lambda deployment
Cloud Run's scale-to-zero serverless container model pairs exceptionally well with Rust's fast startup times and minimal memory footprint — making it an ideal deployment target for Rust services.
- Cloud Run with Rust: why Rust's minimal runtime and fast cold starts make it ideal for Cloud Run's scale-to-zero model
- Containerising and deploying Axum to Cloud Run: Artifact Registry, Cloud Build, and automatic HTTPS
- Cloud SQL (PostgreSQL): managed database, Cloud SQL Auth Proxy for secure connections
- Google Cloud Storage: file storage from Rust using the google-cloud-storage crate
- Secret Manager: fetching credentials securely in Rust on GCP
- Cloud Tasks: async background job queuing from Rust services
- Cloud Pub/Sub: event-driven messaging between Rust services
- Infrastructure with Terraform on GCP: provisioning Cloud Run, Cloud SQL, and networking
- Cloud Build: CI/CD pipelines for building, testing, and deploying Rust containers
- Cloud Monitoring: structured log ingestion, custom dashboards, and uptime checks
Deploy Rust on Microsoft Azure — relevant for engineers working with enterprise clients or Microsoft-ecosystem organisations that have standardised on Azure infrastructure.
- Azure Container Apps: serverless container hosting for Axum — the Azure equivalent of Cloud Run
- Azure Container Registry (ACR): building and storing Rust Docker images
- Azure Database for PostgreSQL: managed PostgreSQL, connection security, and scaling options
- Azure Blob Storage: file storage from Rust using the azure_storage_blobs crate
- Azure Key Vault: secrets and certificate management for Rust services
- Azure Service Bus: message queuing and event-driven patterns in Rust
- Azure Functions with Rust: serverless Rust via custom handlers — use cases and limitations
- Infrastructure with Bicep: provisioning Container Apps, databases, and networking declaratively
- Azure DevOps Pipelines: CI/CD for Rust — build, test, push, and deploy automation
- Azure Monitor and Application Insights: log aggregation, distributed tracing for Rust services
Integrate AI capabilities directly into your Rust backend — calling LLM APIs, building RAG pipelines, and serving AI-powered features from high-performance Rust services that can run ML inference without Python.
- Calling LLM APIs from Rust: OpenAI, Anthropic Claude, and Google Gemini using async-openai and reqwest
- Streaming LLM responses from Axum to the Next.js frontend via Server-Sent Events
- Structured output from LLMs in Rust: parsing model responses into typed Rust structs with Serde
- Embeddings in Rust: generating and storing text embeddings via the OpenAI embeddings API
- pgvector from Rust: storing and querying vector embeddings in PostgreSQL using SQLx
- Building a RAG pipeline in Rust: document ingestion, chunking, embedding, storage, and retrieval — all in async Rust
- Qdrant Rust client: querying a dedicated vector database from Rust with metadata filtering
- LLM prompt management in Rust: templating, versioning, and injecting retrieved context
- Running open-source models with Candle: HuggingFace's pure-Rust ML framework for inference without Python
- ONNX Runtime in Rust: running exported ML models directly in Rust for zero-latency inference
- AI-powered WASM modules: running small ML models compiled to WASM in the browser
- Rate limiting and cost controls: tracking per-user LLM usage, enforcing budgets, caching in Redis
Rust compiles to WebAssembly, and WebAssembly is the runtime of Cloudflare Workers — making Rust the ideal language for edge computing deployed at Cloudflare's global network.
- Cloudflare Workers architecture: V8 isolates, the WASM runtime, and why Rust is ideal for this environment
- worker-rs: the official Rust SDK for Cloudflare Workers — request handling, routing, and response construction
- Cloudflare KV: key-value storage at the edge from Rust Workers
- Cloudflare D1: SQLite at the edge — querying D1 from Rust Workers
- Cloudflare R2: S3-compatible object storage from Rust Workers — zero egress fees
- Cloudflare Durable Objects: stateful edge computing — sessions, rate limiting, and real-time collaboration
- Deploying Next.js on Cloudflare Pages: pairing the Next.js frontend with Rust Workers as the backend
- Edge caching and cache API: programmatic cache control from Rust Workers
- Cloudflare AI: running AI inference at the edge — calling Cloudflare's hosted LLM and embedding models from Rust Workers
- Wrangler and CI/CD: automated Worker deployment with GitHub Actions
Rust is the dominant language in blockchain and HFT — Solana's entire runtime is written in Rust, and the most battle-tested DeFi protocols run on Rust smart contracts. This is CloudTech's own domain — MagicTradeBot is written entirely in Rust and covers many of these patterns in production.
- Blockchain fundamentals: accounts, transactions, consensus, and why Solana's architecture differs from Ethereum
- Solana's programming model: accounts as data, programs as stateless code, and the account ownership model
- Anchor framework: the standard Rust framework for Solana program development — accounts, instructions, errors, and the IDL
- SPL Token standard: minting, transferring, and burning tokens on Solana
- Program Derived Addresses (PDAs): deterministic account addresses for on-chain state
- Cross-Program Invocations (CPI): calling other programs — composability on-chain
- Security in Solana programs: common exploit patterns and prevention (account confusion, missing signer checks, integer overflow)
- Testing Solana programs: unit tests and integration tests with Anchor and solana-program-test
- Connecting the Next.js frontend to Solana: wallet adapters (Phantom, Backpack), wallet connection UI, and signing transactions
- Jupiter aggregator: interacting with Solana's leading DEX aggregator from Rust — best-price swap routing
- Raydium and Orca AMM interaction: liquidity pools, price calculation, and executing swaps programmatically
- Ethereum EVM interaction from Rust: ethers-rs / alloy for reading contracts and sending transactions
- HFT system architecture: market data feed, order book, signal engine, execution engine, risk manager, position tracker
- Low-latency Rust patterns: avoiding allocations in the hot path, stack allocation, cache-line alignment
- Lock-free data structures: crossbeam channels and dashmap for concurrent market data without mutex contention
- WebSocket market data feeds: Binance, Bybit, OKX in Rust — tokio-tungstenite for order book updates
- REST execution APIs: placing and cancelling orders on CEX from Rust — HMAC-SHA256 request signing
- Signal strategies in Rust: moving average crossover, RSI, VWAP deviation as pure Rust functions with no allocation
- Backtesting framework: replaying historical data through a strategy — PnL, Sharpe ratio, and drawdown metrics
- Monitoring a trading system: Prometheus metrics for order latency, fill rate, slippage — Grafana dashboards
📅 Schedule & Timings
Weekday Groups
Weekend Groups
📍 Location: In-house training, F-11 Markaz, Islamabad · 📱 Online option available for out-of-city participants