Packages Overview

Read time 3 minutes
On this page

Nalix is organized into a strict 5-level architecture (Level 0 through Level 4) with zero circular dependencies, complemented by compile-time Roslyn analyzers and source generators. You can install the high-level meta-packages for rapid application development or reference lower-level packages independently.

5-Level Dependency Architecture

Architecture Diagram
flowchart TD
    subgraph L4 ["Level 4 — Application Host"]
        Hosting["Nalix.Hosting"]
    end

    subgraph L3 ["Level 3 — Transport, Dispatch & Client SDK"]
        Network["Nalix.Network"]
        Runtime["Nalix.Runtime"]
        SDK["Nalix.SDK"]
    end

    subgraph L2 ["Level 2 — Wire Codec & Core Services"]
        Codec["Nalix.Codec"]
        Framework["Nalix.Framework"]
    end

    subgraph L1 ["Level 1 — Memory, IO & Configuration"]
        Env["Nalix.Environment"]
    end

    subgraph L0 ["Level 0 — Pure Contracts"]
        Abs["Nalix.Abstractions"]
    end

    Hosting --> Network
    Hosting --> Runtime
    Network --> Framework
    Runtime --> Codec
    Runtime --> Framework
    SDK --> Codec
    Codec --> Env
    Framework --> Env
    Env --> Abs

Runtime Package Map

LevelPackagePurposeKey Public Types
0Nalix.AbstractionsZero-dependency interfaces, packet/handler attributes, and validation metadataIPacket, IConnection, IBufferLease, IPacketContext<T>, PacketOpcodeAttribute, PacketHandlerAttribute
1Nalix.EnvironmentPooled memory primitives, binary reader/writer, INI configuration, monotonic clock, and OS CSPRNGBufferLease, DataReader, DataWriter, ConfigurationManager, Directories, Clock, TimingScope, Csprng
2Nalix.CodecCompile-time binary serialization, LZ4 compression, AEAD encryption, and packet catalogLiteSerializer, PacketRegistry, LZ4Codec, EnvelopeCipher, FramePipeline, PacketBase<TSelf>, PacketFactory<T>
2Nalix.FrameworkSingleton/service registry, background worker scheduling, Snowflake IDs, and resource poolsInstanceManager, TaskManager, Snowflake, BufferPoolManager, ObjectPoolManager, ObjectMap<TKey, TValue>
3Nalix.RuntimeServer-side sharded packet dispatch, middleware pipeline, rate limiting, and session resumePacketDispatchChannel, PermissionMiddleware, RateLimitMiddleware, TimeoutMiddleware, SessionService
3Nalix.NetworkTCP, UDP, and WebSocket listeners, socket connections, admission guard, and connection hubTcpListenerBase, UdpListenerBase, WebSocketListenerBase, Protocol, ConnectionHub, ConnectionGuard, SocketConnection
3Nalix.SDKClient-side TCP/UDP sessions, X25519 handshakes, auto-reconnect, and correlated requestsTransportSession, TcpSession, UdpSession, SessionState, TransportOptions, RequestOptions
4Nalix.HostingFluent server builder, protocol mapping (MapTcp/MapUdp/MapWebSocket), and host lifecycleNetworkApplication, INetworkApplicationBuilder, DefaultProtocol, Bootstrap

Compile-Time Tooling (Roslyn Analyzers & Generators)

Nalix ships three compile-time Roslyn packages bundled directly inside the Nalix.Abstractions NuGet package under analyzers/dotnet/cs (so every project that references any Nalix package gets compile-time analysis and code generation automatically):

PackageRoleKey Components
Nalix.AnalyzersEnforces 67 compile-time analyzer rules (NALIX001–NALIX078, NALIX100–NALIX107) across packets, handlers, serialization, RPC contracts, security, and buffer ownershipNalixUsageAnalyzer, DiagnosticDescriptors
Nalix.Analyzers.CodeFixesProvides 16 IDE quick-fix providers for 20 active analyzer diagnosticsPacketOpcodeCodeFixProvider, SerializeOrderMissingCodeFixProvider, ResetForPoolCodeFixProvider, etc.
Nalix.Analyzers.GeneratorsEmits zero-reflection C# source at compile time via 7 source generators (plus 8 generator diagnostics NALIX059–NALIX068)PacketHandlerGenerator, InstanceGenerator, SerializeFormatterGenerator, PacketRegistryGenerator, PacketSchemaGenerator, ConfigurationGenerator, RpcClientGenerator

Minimum Package Sets by Project Type

Project RoleRecommended NuGet Packages
Hosted Server (recommended)Nalix.Hosting
Manual Server (custom bootstrap)Nalix.Network, Nalix.Runtime, Nalix.Framework, Nalix.Codec, Nalix.Environment, Nalix.Abstractions
Client ApplicationNalix.SDK
Shared Contracts LibraryNalix.Abstractions, Nalix.Codec

Package Reference Pages