Actix Web is a fast, pragmatic Rust web framework with its own HTTP/1 and HTTP/2 implementation, extractors, middleware, optional routing macros, WebSockets, static files, multipart and the awc HTTP client.
- Language
- Rust
- License
- Apache-2.0
- Running for
- 9 years
- Team
- 1M+ MAU
Why this architecture
Actix Web owns its HTTP stack in actix-http and keeps router, codegen, files, multipart, test utilities and the awc client in one workspace, so the whole request path, TLS options and public API are versioned and semver-checked together.
Tech stack by layer
6 technologies · audited Oct 2, 2026- RustImplementation language for every crate; the workspace sets edition 2021 and a minimum Rust version of 1.88.
- Actix-webThe actix-web crate (version 4 in its manifest): App, HttpServer, extractors, middleware and routing macros.
- actix-httpOwn HTTP/1.x and HTTP/2 implementation (h2 behind the http2 feature) with compression and WebSocket protocol support.
- TokioUnderlying async runtime; the README lists full Tokio compatibility and #[actix_web::main] or #[tokio::main] entry points.
- WebSocketsws feature in actix-http plus client WebSockets in awc; actix-web-actors is kept only as a deprecated crate.
- OpenSSLOptional TLS backend next to several Rustls versions (0.20 to 0.23), each behind its own feature flag.
- GitHub ActionsWorkflows for CI, lint, coverage, benchmarks, post-merge checks and semver checks on public APIs.
- justjustfile collects local development and release recipes; scripts/ holds bump and publish helpers.
Key architectural decisions
5 decisions- 01
Own HTTP stack in actix-http instead of building on Hyper
actix-http/Cargo.toml describes the crate as "HTTP types and services for the Actix ecosystem" and implements HTTP/1.x itself, with HTTP/2 through the h2 crate behind the http2 feature, WebSocket framing behind ws, and brotli, gzip and zstd compression as features. The framework controls its whole request path rather than delegating to Hyper.
- 02
One workspace for server, router, client, files, multipart and test crates
The root Cargo.toml lists actix-web, actix-http, actix-router, actix-web-codegen, actix-files, actix-multipart, actix-multipart-derive, actix-test, actix-http-test and the awc HTTP client as members, and [patch.crates-io] points every one of them at its local path so cross-crate changes are tested together.
- 03
Routing macros are optional sugar over a standalone router
actix-router is a separate crate for resource path matching, with regex-based matching behind a unicode feature and regex-lite otherwise. actix-web-codegen supplies the #[get("/path")] style attribute macros, enabled by the default macros feature, so routes can be registered with or without macros.
- 04
TLS backends selected per version through feature flags
actix-http and awc expose openssl plus separate rustls-0_20, rustls-0_21, rustls-0_22 and rustls-0_23 features, so applications can match the Rustls version used elsewhere in their dependency tree instead of being forced onto one.
- 05
API stability checked in CI
semver-checks.yml runs alongside ci.yml and lint.yml, each crate lists allowed external types under package.metadata.cargo_check_external_types, and actix-web keeps MIGRATION-1.0 through MIGRATION-4.0 guides, which shows how much weight the project puts on not breaking the public API within a major version.
How Actix Web is built
How Actix Web is structured
Actix Web is a Cargo workspace of ten crates declared in the root Cargo.toml:
| Crate | Role |
|---|---|
actix-web/ |
The framework: App, HttpServer, extractors, responders, middleware (Logger, CORS and sessions are documented in the README) |
actix-http/ |
HTTP/1.x implementation, HTTP/2 via h2, WebSocket protocol, content compression |
actix-router/ |
Resource path matching, regex-based with a unicode feature or regex-lite without it |
actix-web-codegen/ |
Attribute macros such as #[get("/hello/{name}")] and runtime macros |
actix-files/ |
Static file serving with range requests (http-range) and MIME guessing |
actix-multipart/, actix-multipart-derive/ |
Streaming multipart forms and a derive macro for typed forms |
actix-test/, actix-http-test/ |
Test servers for integration tests |
awc/ |
Async HTTP and WebSocket client that shares actix-http types |
[patch.crates-io] redirects every member to its local path, so a change in actix-http is compiled against the in-repo actix-web rather than a published version. A deprecated actix-web-actors crate (4.3.1+deprecated) remains in the tree but is not a workspace member.
Backend & APIs
The public API in the README is attribute-routed handlers plus an HttpServer that builds an App per worker:
#[get("/hello/{name}")]
async fn greet(name: web::Path<String>) -> impl Responder { … }
The macros default feature brings in actix-web-codegen. Without it, routes can be registered with web::resource and route calls on the standalone router. Default features also enable brotli, gzip and zstd compression, cookies, HTTP/2, Unicode routing and WebSockets (actix-web/Cargo.toml). The README marks some features with an experimental prefix (currently experimental-introspection for route reporting) and allows breaking changes in them at any release.
TLS is a deliberate choice per application. actix-http and awc expose openssl and separate rustls-0_20 … rustls-0_23 features, so the server can match the Rustls version used by the rest of the dependency tree.
Realtime / collaboration
WebSocket framing lives in actix-http behind the ws feature (base64, sha1, rand and local-channel are its optional dependencies), and the awc client supports WebSocket connections too. The older actor-based integration (actix-web-actors, built on the actix actor crate) is marked deprecated in its version string.
Build, test & deploy
- Workflows in
.github/workflows/:ci.yml,ci-post-merge.yml,lint.yml,coverage.yml(with.codecov.yml),bench.ymlandsemver-checks.yml.labeler.ymltriages pull requests, andzizmor.ymlconfigures a workflow security linter. - The workspace denies
rust_2018_idioms,future_incompatibleandnonstandard_stylelints..clippy.toml,.rustfmt.toml,.taplo.toml(TOML formatting) and.cspell.ymlcover style. - Release profile:
lto = true,opt-level = 3,codegen-units = 1. The dev profile disables debug info to speed up builds. deny.tomlconfigures dependency policy, andjustfileplusscripts/bump,scripts/publishandscripts/unreleaseddrive releases.- Benchmarks live in
actix-http/benches,actix-router/benchesandactix-web/benches.
What to copy (and what not to)
Copy:
- Patch the workspace onto itself (
[patch.crates-io]with local paths) so multi-crate changes are always tested together. - Semver checks in CI plus an explicit allow-list of external types per crate. Together they stop a dependency's types from leaking into your public API by accident.
- Optional macros over a plain API, so users who dislike macros, or need dynamic routing, are not locked out.
- Migration guides per major version next to the crate (
MIGRATION-4.0.md).
Don't copy blindly:
- Owning an HTTP implementation is a large maintenance commitment that makes sense for a framework, not for an application.
- Supporting four Rustls versions in parallel adds a lot of feature-flag combinations to test. Most libraries should pick one.
Actix Web powers Meilisearch and Qdrant in the directory. For a comparison with the Hyper-and-Tower approach, see Axum.
Sources & repo audit
- Audited
- Oct 2, 2026
- Commit
- 30c831f
- License
- Apache-2.0
- Workspace Cargo.toml (members, profiles, lints)
- actix-web/Cargo.toml (features)
- actix-http/Cargo.toml (HTTP/2, WebSockets, TLS features)
- actix-router/Cargo.toml
- README (features, example)
Independent analysis of repository at github.com/actix/actix-web. Spotted an inaccuracy? Use the claim form to request a correction.
Maintainer? Add the architecture badge to your README
[](https://stackitfast.com/project/actix-web) Scaffold it with your agent
Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Actix Web's architecture.
- 1Copy the promptThe full markdown spec, with every layer and decision.
- 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
- 3Paste and scaffoldUse it as the first instruction; review before you ship.
# MISSION: Scaffold "Actix Web" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Actix Web**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Actix Web
- **What It Does**: Actix Web is a fast, pragmatic Rust web framework with its own HTTP/1 and HTTP/2 implementation, extractors, middleware, optional routing macros, WebSockets, static files, multipart and the awc HTTP client.
- **Domain & Category**: Rust Web Framework
- **Production Scale**: 1M+ MAU
- **Development Mode**: CLASSIC
- **Architectural Rationale**: Actix Web owns its HTTP stack in actix-http and keeps router, codegen, files, multipart, test utilities and the awc client in one workspace, so the whole request path, TLS options and public API are versioned and semver-checked together.
- **Live Website Reference**: https://actix.rs
- **Source Repository**: https://github.com/actix/actix-web
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Rust, Actix-web, Tokio, WebSockets, OpenSSL, GitHub Actions
- **Primary Language(s)**: Rust, Shell, Just
- **License of the reference repo**: Apache-2.0
- **Backend & APIs**: Rust — Implementation language for every crate; the workspace sets edition 2021 and a minimum Rust version of 1.88.; Actix-web — The actix-web crate (version 4 in its manifest): App, HttpServer, extractors, middleware and routing macros.; actix-http — Own HTTP/1.x and HTTP/2 implementation (h2 behind the http2 feature) with compression and WebSocket protocol support.; Tokio — Underlying async runtime; the README lists full Tokio compatibility and #[actix_web::main] or #[tokio::main] entry points.; WebSockets — ws feature in actix-http plus client WebSockets in awc; actix-web-actors is kept only as a deprecated crate.; OpenSSL — Optional TLS backend next to several Rustls versions (0.20 to 0.23), each behind its own feature flag.
- **Infrastructure & deploy**: GitHub Actions — Workflows for CI, lint, coverage, benchmarks, post-merge checks and semver checks on public APIs.; just — justfile collects local development and release recipes; scripts/ holds bump and publish helpers.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/actix/actix-web @ 30c831f)
1. **Own HTTP stack in actix-http instead of building on Hyper**: actix-http/Cargo.toml describes the crate as "HTTP types and services for the Actix ecosystem" and implements HTTP/1.x itself, with HTTP/2 through the h2 crate behind the http2 feature, WebSocket framing behind ws, and brotli, gzip and zstd compression as features. The framework controls its whole request path rather than delegating to Hyper.
2. **One workspace for server, router, client, files, multipart and test crates**: The root Cargo.toml lists actix-web, actix-http, actix-router, actix-web-codegen, actix-files, actix-multipart, actix-multipart-derive, actix-test, actix-http-test and the awc HTTP client as members, and [patch.crates-io] points every one of them at its local path so cross-crate changes are tested together.
3. **Routing macros are optional sugar over a standalone router**: actix-router is a separate crate for resource path matching, with regex-based matching behind a unicode feature and regex-lite otherwise. actix-web-codegen supplies the #[get("/path")] style attribute macros, enabled by the default macros feature, so routes can be registered with or without macros.
4. **TLS backends selected per version through feature flags**: actix-http and awc expose openssl plus separate rustls-0_20, rustls-0_21, rustls-0_22 and rustls-0_23 features, so applications can match the Rustls version used elsewhere in their dependency tree instead of being forced onto one.
5. **API stability checked in CI**: semver-checks.yml runs alongside ci.yml and lint.yml, each crate lists allowed external types under package.metadata.cargo_check_external_types, and actix-web keeps MIGRATION-1.0 through MIGRATION-4.0 guides, which shows how much weight the project puts on not breaking the public API within a major version.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
- Structure as a Turborepo monorepo with strict package boundaries:
- `apps/web`: Application UI, routing, layouts, and server endpoints.
- `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
- `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
- `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
- Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
- Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
- Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
- Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
- Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
- Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
- Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer: client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.Frequently asked about Actix Web
Is Actix Web built on Hyper?
No. Actix Web ships its own HTTP implementation in the actix-http crate, covering HTTP/1.x natively and HTTP/2 through the h2 crate, plus WebSockets and compression. Axum, by contrast, serves requests through Hyper.
Does Actix Web use Tokio?
Yes. The README lists full Tokio compatibility, and applications can start the server with either #[actix_web::main] or #[tokio::main].
Does Actix Web support HTTP/2 and TLS?
Yes. HTTP/2 is part of the default feature set through the h2 crate, and TLS can use OpenSSL or Rustls versions 0.20 to 0.23, each selected with its own feature flag.
Axum or Actix Web?
Both are production-grade Rust web frameworks. Actix Web owns its full HTTP stack and ships routing macros, static files, multipart and an HTTP client (awc) in one workspace; Axum is a thinner layer on Hyper and Tower that reuses the Tower middleware ecosystem.
Are Actix actors still needed for WebSockets?
No. actix-web-actors is versioned 4.3.1+deprecated in the repository; WebSocket support lives in actix-http behind the ws feature and in the awc client.
One email a month: new deep dives and stack trends
New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.
Similar architectures
- AxumClassicRust Web Framework · 1M+ MAUShares Rust · Tokio · WebSockets
- LeptosClassicFull-Stack Rust Web Framework · 6-20 peopleShares Rust · Actix-web · Tokio
- MeilisearchClassicSearch Engine · 20+ peopleShares Rust · Actix-web · Tokio
- DioxusClassicCross-Platform Rust App Framework · 6-20 peopleShares Rust · Tokio · GitHub Actions
- DenoClassicSecure JavaScript & TypeScript Runtime · 20+ peopleShares Rust · Tokio
- LemmyClassicFederated Link Aggregator & Forum · 20+ peopleShares Rust · Actix-web · Tokio