# Navios Framework > Type-safe, decorator-based framework for building modern APIs ## Builder - [Introduction](https://navios.tech/docs/builder/index.md): @navios/builder turns a description of an HTTP endpoint — method, URL, schemas — into a typed function that validates what it sends and what it receives. You write the description once and use it from the browser, from a Navios server controller and from React Query hooks. - [Quick start](https://navios.tech/docs/builder/quick-start.md): This page takes you from an empty project to a typed endpoint call with a handled failure. The small users API declared here is the example the rest of the Builder docs build on. - [How it works](https://navios.tech/docs/builder/how-it-works.md): Builder has a small model: a declaration is plain data, and declareEndpoint wraps it in a function. This page describes what that function does on every call, so the rest of the docs can refer to it instead of repeating it. - [Declaring endpoints](https://navios.tech/docs/builder/essentials/endpoints.md): API.declareEndpoint(options) is the only way to declare an HTTP endpoint. This page is the map of what options can contain. The larger topics have their own pages; the smaller ones are covered here. - [URL params, query and body](https://navios.tech/docs/builder/essentials/inputs.md): An endpoint call takes one object with up to three inputs: urlParams, params and data. This page covers how each is declared, typed and validated, and which request options a call accepts beside them. All three are validated before anything is sent. If any of them fails, the call ends with an EndpointError of kind request-validation that lists the problems of all three, and no request is made. What is sent is the value you passed, not what the schema made of it. See What is sent. - [Responses](https://navios.tech/docs/builder/essentials/responses.md): A declaration says what a successful call resolves to. Usually that is one JSON schema, but it can also depend on the status, or not be JSON at all. This page covers each form, plus how to read the status and headers of a reply. Failures are a separate topic: see Errors. - [Errors](https://navios.tech/docs/builder/essentials/errors.md): Every failed call produces one type, EndpointError. The throwing form throws it, .safe() returns it as result.error, and the builder's onError hook receives the same instance. This page lists what can go wrong and shows how to give error bodies a type. - [Schemas](https://navios.tech/docs/builder/essentials/schemas.md): Schemas are how a declaration describes data. This page explains what Builder expects from a schema and what it does with one. It is not a guide to writing schemas; for that, use the documentation of your schema library. - [HTTP client](https://navios.tech/docs/builder/essentials/http-client.md): Builder does not make requests itself. It prepares a request, hands it to an HTTP client you provide, and interprets what comes back. This page covers what counts as a client, how to give one to a builder, and where cross-cutting concerns such as authentication belong. - [File uploads](https://navios.tech/docs/builder/guides/file-uploads.md): To send files, declare the endpoint with body: 'multipart'. You still pass a plain object as data; Builder validates it and converts it to FormData. - [Downloads and streams](https://navios.tech/docs/builder/guides/downloads-and-streams.md): When an endpoint returns something other than JSON, set its response kind. The call then resolves to a Blob, a string or a ReadableStream instead of schema output. The kinds are listed in Responses; this page shows them in use. Inputs and errors work exactly as for JSON endpoints. Only the success value changes, and no responseSchema is involved. - [Sharing with Navios Server](https://navios.tech/docs/builder/guides/navios-server.md): A declaration describes an endpoint without saying which side of the wire you are on. The client calls it; a Navios server implements it. When both import the same declaration, a change to the contract is a compile error on whichever side has not caught up. This page shows how to arrange that. The server's own behavior is documented in Controllers and handlers. - [Organizing an API](https://navios.tech/docs/builder/guides/organizing.md): Declarations are ordinary exported values, so structuring them is mostly ordinary module design. This page collects the conventions that hold up as an API grows from five endpoints to a few hundred. - [Testing](https://navios.tech/docs/builder/guides/testing.md): Because a builder talks to the network only through its HTTP client, tests replace the client. No request interception or global mocking is needed, and the full pipeline — input validation, response validation, error classification — still runs. - [WebSocket](https://navios.tech/docs/builder/realtime/websocket.md): @navios/builder/socket gives messages the same treatment declareEndpoint gives HTTP calls: you declare a topic and its schemas once, and get a typed function that validates what it sends and what it receives. It works over the standard WebSocket, and over any object with the same few methods. - [Server-Sent Events](https://navios.tech/docs/builder/realtime/server-sent-events.md): @navios/builder/eventsource types a one-way stream from the server: you declare the connection and each event once, and your listeners receive validated payloads. Use it when the client only listens. If it also sends, see the comparison on the WebSocket page. - [Quick start](https://navios.tech/docs/builder/react-query/index.md): @navios/react-query turns an endpoint declaration into TanStack Query hooks. Arguments, data and errors keep the types the declaration gives them, and cache keys are built for you. This page continues from the Builder quick start and uses the API, getUser and createUser declared there. - [Queries](https://navios.tech/docs/builder/react-query/queries.md): client.query binds an endpoint to the cache. The result is one object you use three ways: as a hook, as a source of TanStack query options, and as a typed handle on the cached data. This page covers all three. The examples use userQuery from the quick start and one more query: - [Infinite queries](https://navios.tech/docs/builder/react-query/infinite-queries.md): client.infiniteQuery is for lists that load page by page: "load more" buttons, endless scroll, cursors. It wraps TanStack's useInfiniteQuery and takes care of the one thing that is specific to an endpoint: turning a page param into a request. - [Mutations](https://navios.tech/docs/builder/react-query/mutations.md): client.mutation turns an endpoint into a useMutation hook. On top of TanStack's options it adds three settings of its own: invalidates, optimistic and useContext. This page covers the hook, its callbacks and how to tell which mutations are running. - [Optimistic updates](https://navios.tech/docs/builder/react-query/optimistic-updates.md): An optimistic update writes the expected result to the cache before the request is sent, so the UI changes at once. The optimistic setting of a mutation describes the change; cancelling fetches, rolling back on failure and refetching afterwards are done for you. - [Keys and invalidation](https://navios.tech/docs/builder/react-query/keys-and-invalidation.md): You never write a cache key by hand. Every query builds its keys from the endpoint and the arguments, in one fixed shape, and that shape is what makes invalidation precise. Read this page when you need to refresh, remove or address cache entries. - [Errors](https://navios.tech/docs/builder/react-query/errors.md): Hooks call the throwing form of an endpoint, so every failure reaches TanStack Query's error channel as the endpoint's EndpointError. This page shows the places that error turns up in React and how to branch on it there. What the kinds mean, and how errorSchema gives error bodies a type, is on Builder's Errors page. - [Uploads and downloads](https://navios.tech/docs/builder/react-query/uploads-and-downloads.md): An upload is a mutation on a body: 'multipart' endpoint, and a download is a mutation or a query on a response: 'blob' endpoint. There is no separate API for either. This page shows the React side: wiring a file input, starting a download from a click, and showing a cached file. How the endpoints themselves work is covered in File uploads and Downloads and streams. - [SSR and prefetching](https://navios.tech/docs/builder/react-query/ssr.md): Prefetching fills the cache before a component asks for the data, so the first render already has it. This page covers doing that on a server: which helper to call, how the data reaches the browser, and how to make server-side requests carry the current user's credentials. The hydration mechanics are TanStack's and are not repeated here; see its SSR guide for the framework setup. - [Forms](https://navios.tech/docs/builder/react-query/recipes/forms.md): A form is a mutation plus a way to show what went wrong. This recipe covers the parts that are specific to these packages: mapping an EndpointError to field messages, deciding where success handling goes, and prefilling an edit form from the cache. It works with plain form elements and with any form library. The examples use createUser as declared on Builder's Errors page, where its errorSchema describes a 409 and a 422 reply: - [Realtime updates](https://navios.tech/docs/builder/react-query/recipes/realtime-updates.md): When the server pushes events over a WebSocket or Server-Sent Events, the cache is where they should land: every component reading the affected query re-renders, and nothing else needs to know a socket exists. This recipe connects Builder's typed WebSocket and SSE subscriptions to a query's setData and invalidate. - [@navios/builder API](https://navios.tech/docs/builder/reference/builder.md): Every public export of @navios/builder and its two realtime entry points, with signatures. This page is for looking things up; the guides explain when to use each piece. - [@navios/react-query API](https://navios.tech/docs/builder/reference/react-query.md): Every public export of @navios/react-query, with signatures. This page is for looking things up; the React Query guides explain how the pieces are used. Requires @tanstack/react-query ^5.102.0. - [Migrating to 2.0](https://navios.tech/docs/builder/reference/migrating-to-2.md): This page lists what changed between 1.x and 2.0 of @navios/builder and @navios/react-query, as before and after, and what changed in @navios/http. Upgrade the packages together: @navios/react-query 2.0 is built on @navios/builder 2.0 and requires @tanstack/react-query ^5.102.0. The short version: there is one way to declare an endpoint, two ways to call it, and one error type. Most of the work is deleting code. ## Server - [Introduction](https://navios.tech/docs/server/index.md): Navios Server is an HTTP framework for TypeScript built on one idea: an endpoint is declared once, with @navios/builder, and the server implements that declaration. The route, the request validation, the response validation and the handler's types all come from it, and a client can call the same declaration with the same types. Return a user without email, or answer with a status the declaration does not list, and the controller stops compiling. - [Quick start](https://navios.tech/docs/server/quick-start.md): This page builds a small users API and runs it on Fastify. The declarations, the service, the controller and the module written here are the example the rest of the Server docs build on. - [How a request is handled](https://navios.tech/docs/server/request-lifecycle.md): Every request to a Navios server goes through the same stages in the same order. This page is the one place that order is written down; the pages for guards and interceptors, controllers and errors describe each stage and refer back here. - [Controllers and handlers](https://navios.tech/docs/server/essentials/controllers.md): A controller is a class decorated with @Controller(). Each handler in it implements one endpoint declared with @navios/builder; how to write the declarations is covered in Declaring endpoints. Controllers are singletons. Navios creates each one once at start-up, so nothing is constructed per request, and per-request data comes from the request context passed to every handler. - [Request context](https://navios.tech/docs/server/essentials/request-context.md): RequestContext is one object per request. Handlers receive it as their second argument, guards and interceptors as their first. Everything on it is the same on every adapter except raw. Most members are created on first access, so a request that never reads cookies or the query string pays nothing for them. - [Services and injection](https://navios.tech/docs/server/essentials/services.md): A service is a class that holds logic controllers should not: data access, calls to other systems, business rules. Navios wires services with @navios/di, and @navios/server re-exports all of it, so server code imports Injectable, inject and provide from @navios/server. This page covers what a server developer uses every day. The DI section covers the rest: tokens, providers, scopes, lifecycle and factories. - [Modules](https://navios.tech/docs/server/essentials/modules.md): A module is a group of routes with a shared path prefix, shared guards and shared interceptors. An application is created from one root module, and every module reachable from it through imports is part of the application. A module is not a dependency-injection boundary. Services are visible application-wide, and a module never has to list or export them. - [Guards and interceptors](https://navios.tech/docs/server/essentials/guards-and-interceptors.md): A guard decides whether a request may continue. An interceptor wraps the handling of a request and can act before it, after it, or instead of it. Both are @Injectable() singletons created once at start-up, so neither may keep per-request data in a field. Where the two sit among the other stages of a request is shown in How a request is handled. In short: interceptors of the application enter first, then the guards run, then the interceptors of the module, the controller and the handler, and all of them before the body is read. - [Errors](https://navios.tech/docs/server/essentials/errors.md): Every error response Navios produces is application/problem+json (RFC 9457), unless the endpoint declares its own body for that status in errorSchema. This page describes how an error becomes that response and how to change the outcome. - [Application setup](https://navios.tech/docs/server/essentials/application.md): An application is created from a root module and an adapter, then initialised and started. NaviosFactory.create(rootModule, options) only constructs the application. Nothing is resolved and no server exists until init() or listen(). - [Configuration and logging](https://navios.tech/docs/server/essentials/config-and-logging.md): @navios/server ships two small services most applications need from the first day: a typed configuration service and a logger. - [Testing](https://navios.tech/docs/server/essentials/testing.md): A Navios application can be tested at three levels, from fastest to most realistic: The whole application on the in-memory adapter, with no server and no socket.The whole application on a real adapter, through app.inject().The application listening on an ephemeral port, called with fetch. Start with the first. It runs the same compiled routes as a real adapter, so guards, validation, error mapping and request state behave the same. A service that does not involve HTTP is tested with a DI container alone; see Testing in the DI docs. The examples use Vitest. Nothing here depends on it. Vitest does not compile standard decorators by itself. Add a transform that does, for example unplugin-swc, which needs @swc/core; bun test needs none: - [Authentication with JWT](https://navios.tech/docs/server/guides/authentication.md): @navios/jwt signs and verifies JSON Web Tokens in an injectable service. This page builds bearer-token authentication with it from start to finish: a login endpoint signs a token, a guard verifies it and stores the user for the request, and an attribute marks the routes that need no token. - [Per-request state](https://navios.tech/docs/server/guides/request-state.md): Controllers, guards, interceptors and services are singletons, so nothing that belongs to one request may live in their fields. Per-request data lives on the request context instead. There are three tools for it: Use the first that fits. - [File uploads](https://navios.tech/docs/server/guides/file-uploads.md): An endpoint declared with body: 'multipart' receives multipart/form-data, and answers any other body with 415. The handler is an ordinary @Endpoint handler: text fields arrive as strings and files as File objects in data, already validated by the declaration's requestSchema. The declaration, and how a client fills it, belong to the Builder guide File uploads. This page covers the server side. - [Streams and server-sent events](https://navios.tech/docs/server/guides/streams-and-sse.md): A declaration's response kind tells the server what a handler may return instead of a JSON body. The handler is still an @Endpoint method, the code is the same on every adapter, and it never touches the native reply object. An async iterable yields strings or Uint8Arrays. A Node Readable is one. These responses are not validated at run time; there is no schema to validate against. Set another content type, and any other header, with ctx.reply.header(). A Blob that has a type uses it as the content type. Anything else, such as a web Response, is answered as a 500. How these endpoints are declared, and how a client consumes them, is covered by the Builder guide Downloads and streams. The examples below implement three such declarations: - [Scheduled jobs](https://navios.tech/docs/server/guides/scheduled-jobs.md): @navios/schedule runs methods of a service on a cron schedule. It is built on the cron package and uses the application's DI container, so a job injects the same services your handlers do. The package depends on @navios/core only. In an HTTP application the jobs run next to the server; a worker that does nothing but run jobs needs no adapter at all; see Other transports. - [OpenAPI](https://navios.tech/docs/server/guides/openapi.md): @navios/openapi is a plugin that builds an OpenAPI 3.1 document from the application's routes and serves it as JSON, optionally as YAML, together with a Scalar API reference page. The endpoint declarations already say what each route accepts and returns, so most of the document needs no extra code. The plugin's routes are ordinary Navios routes, so it works the same on every adapter. - [Attributes](https://navios.tech/docs/server/guides/attributes.md): An attribute is typed metadata attached to a module, a controller or a handler. It does nothing by itself: a guard or an interceptor reads it from ctx.route to decide what to do, and tools such as the OpenAPI plugin read it from app.routes(). - [Plugins](https://navios.tech/docs/server/guides/plugins.md): A plugin packages setup that an application would otherwise do by hand: providers, interceptors, error mappers, extra routes and shutdown work. @navios/openapi, @navios/otel and @navios/adapter-xml are plugins. There is one plugin shape. - [Other transports](https://navios.tech/docs/server/guides/other-transports.md): An application is a module tree, one DI container and the transports through which work reaches it. HTTP is one transport. A queue consumer is another, and an application can have several, or none. NaviosFactory.create builds an application whose transport is HTTP. Underneath it is createApplication from @navios/core, which takes any list of transports: Every transport shares the application's modules, providers, plugins and lifecycle hooks. app.start() initialises the application and starts each transport; app.close() stops them all, waits for work in flight, runs the shutdown hooks and disposes the container. - [Prisma](https://navios.tech/docs/server/guides/prisma.md): Navios has no Prisma package and needs none. A PrismaClient is one long-lived object with a connect step and a disconnect step, which is exactly what a singleton service with lifecycle hooks is. This page assumes a working Prisma setup with a User model that has id, name and a unique email. - [Fastify](https://navios.tech/docs/server/adapters/fastify.md): @navios/adapter-fastify runs a Navios application on Fastify 5, on Node.js. The adapter registers the application's routes with Fastify, turns each Fastify request into the input of a compiled route and writes the result. Guards, validation and error mapping happen in @navios/server and behave the same as on every other adapter; Fastify's own schema validation and serialisation are not used. - [Bun](https://navios.tech/docs/server/adapters/bun.md): @navios/adapter-bun runs a Navios application on Bun.serve. The adapter registers the application's routes with Bun's router, turns each Request into the input of a compiled route and builds a Response from the result. Guards, validation and error mapping happen in @navios/server and behave the same as on every other adapter. Bun runs the standard decorators Navios uses as they are, so an application needs no extra build step or compiler option. - [XML responses](https://navios.tech/docs/server/adapters/xml.md): @navios/adapter-xml builds XML responses, such as RSS and Atom feeds or sitemaps, with JSX. Despite its name it is not an HTTP adapter: it is a JSX runtime, a renderer and a plugin, and it works with the same code on Fastify and on Bun. - [Writing an adapter](https://navios.tech/docs/server/adapters/writing-an-adapter.md): An adapter binds Navios to an HTTP server. It registers routes with the server, turns each native request into a RouteInput, calls the route's executor and writes the RouteResponse it gets back. It contains no guard, decoding, validation or error-mapping logic: all of that is inside the executor and is the same on every adapter. The contract is in @navios/server/adapter. Only what applications use as well, such as HttpException and problem(), comes from @navios/server. The shipped adapters are the working references. @navios/adapter-fastify and @navios/adapter-bun are each a handful of source files, and the in-memory adapter in @navios/server/testing is the smallest implementation. - [Setup](https://navios.tech/docs/server/opentelemetry/index.md): @navios/otel adds OpenTelemetry tracing to a Navios application with one plugin, which is the same on every adapter. The plugin: starts the OpenTelemetry SDK and shuts it down with the application;creates a server span for every HTTP request that matches a route;creates child spans for the methods of services marked with @Traced;provides the tracer and the meter through dependency injection. This page covers the plugin, its configuration and the request spans. Tracing services and custom spans covers the rest. - [Tracing services and custom spans](https://navios.tech/docs/server/opentelemetry/tracing.md): The request span created by the plugin covers a whole request. This page shows how to get finer spans: one per service method with @Traced, or spans you start yourself with the injected tracer. - [Legacy decorators](https://navios.tech/docs/server/reference/legacy-decorators.md): Navios is written for standard (TC39) decorators, and the rest of these docs assume them. A project that keeps TypeScript's experimentalDecorators option on, for example because another library in the same code base needs it, imports its decorators from the legacy-compat entry points instead. Each legacy decorator adapts the legacy call signature and then calls the same implementation as the standard decorator of the same name. Behaviour and metadata are identical, so everything else on this site applies unchanged, and both kinds can be used in one application. - [Migrating to 2.0](https://navios.tech/docs/server/reference/migrating-to-2.md): This page lists what changed between @navios/core 1.x and @navios/server 2.0, the Fastify and Bun adapters, @navios/jwt, @navios/schedule, @navios/openapi, @navios/otel and @navios/adapter-xml. Upgrade them together. The packages that take part in HTTP require @navios/server 2.0; @navios/jwt, @navios/schedule and the main entry of @navios/otel require only @navios/core 2.0. 2.0 rewrites the request pipeline. Endpoint declarations made with @navios/builder stay as they are apart from the changes in Builder's migration page. Controllers, guards, bootstrap code and tests change. The main ideas: Controllers, guards and interceptors are singletons. Per-request data lives in a RequestContext that is passed to them.One @Endpoint decorator serves every kind of endpoint. Body kind, response kind and status codes come from the declaration.Every error response is application/problem+json unless the endpoint declares a body for that status.Guards run before the request body is read.Any Standard Schema library works on the server. Zod keeps working unchanged.CORS, multipart, OpenAPI, OpenTelemetry and XML are configured the same way on every adapter.The HTTP framework is now @navios/server. @navios/core is the part that does not depend on HTTP. - [Migrating from NestJS](https://navios.tech/docs/server/reference/migrating-from-nestjs.md): Navios will look familiar to a NestJS developer: modules, controllers, injectable services, guards, interceptors and the same exception class names. The differences are in where the description of an endpoint lives and in how per-request data is reached. This page maps the concepts and then covers the differences that need more than a rename. Navios uses standard decorators. A NestJS project compiles with experimentalDecorators; either turn the option off for the code you move over, or keep it and import decorators from the legacy entry points. ## DI - [Introduction](https://navios.tech/docs/di/index.md): @navios/di is a dependency injection container for TypeScript. A class marked @Injectable() declares what it needs with inject(), and a container builds it together with everything it depends on. There is no module file to maintain and no list of providers to keep in sync. A class registers itself when it is decorated, and a container finds it through the class. - [Quick start](https://navios.tech/docs/di/quick-start.md): This page takes you from an empty project to two services resolved from a container. DatabaseService and UserService, declared here, are the pair the rest of the DI docs build on. - [How resolution works](https://navios.tech/docs/di/how-it-works.md): The container has a small model: a token names a dependency, a provider says how to build it, and a container stores the instance. This page follows one get() call through that model, so the rest of the docs can refer to it instead of repeating it. - [Services and injection](https://navios.tech/docs/di/essentials/services.md): A service is a class marked @Injectable(). This page covers the decorator's options and the three functions a service uses to reach its dependencies. - [Tokens](https://navios.tech/docs/di/essentials/tokens.md): A token is the identity of a dependency. Every @Injectable() class has one automatically. You create one yourself when the dependency is not a class you can name: an interface with several implementations, a configuration object, a value supplied at runtime. - [Providers](https://navios.tech/docs/di/essentials/providers.md): A provider tells a container how to produce the value for a token. @Injectable() and @Factory() attach a default provider to their token. This page covers the other half: what a container can be told on top of the defaults. - [Scopes](https://navios.tech/docs/di/essentials/scopes.md): A scope says how long an instance lives and who shares it. Every provider has one; the default is singleton. - [Lifecycle](https://navios.tech/docs/di/essentials/lifecycle.md): An instance is constructed, initialised, used and eventually destroyed. Two optional methods let a service take part in the second and last step. The OnServiceInit and OnServiceDestroy interfaces are optional type checks. The container looks for the methods, not the interfaces. - [Factories](https://navios.tech/docs/di/essentials/factories.md): A factory produces a value that is not an instance of your own injectable class: a client from a third-party library, a plain object, a function. The container treats the result like any other instance: it is stored by scope, injected, and destroyed. - [Testing](https://navios.tech/docs/di/guides/testing.md): Nothing in a service refers to a container, so a test decides what the service is wired to. This page goes from the plain approach, which covers most tests, to the two helper containers in @navios/di/testing. The examples use Vitest, which does not compile standard decorators by itself. Testing in the Server docs has the configuration; bun test needs none. - [Circular dependencies](https://navios.tech/docs/di/guides/circular-dependencies.md): Two services that inject each other cannot both be constructed first. The container detects this and fails with a clear error instead of hanging or handing out a half-built object. This page shows the error and the ways to resolve it. - [Invalidation](https://navios.tech/docs/di/guides/invalidation.md): Invalidating an instance destroys it, and everything built on top of it, while the container keeps running. The next resolution builds a fresh one. Use it when something a long-lived service captured at creation is no longer valid: rotated credentials, reloaded configuration, a logged-out user. - [Quick start](https://navios.tech/docs/di/react/index.md): @navios/di-react connects a @navios/di container to a React tree. A provider puts the container in context, and hooks resolve services from it, re-render when a service is invalidated, and create scopes that live as long as a component. This page continues from the DI quick start and uses the DatabaseService and UserService declared there. - [Using services in components](https://navios.tech/docs/di/react/using-services.md): Three hooks resolve a service from the container in context. They accept the same things container.get() accepts (a class, a token, a bound token or a factory token) and differ in how they report loading and failure: useService returns the state as an object.useSuspenseService returns the instance and suspends while it loads.useOptionalService is useService for a token that may have no provider. All three subscribe to the instance and resolve a new one when it is invalidated; see Scopes and invalidation. The examples use UserService from the DI quick start. - [Scopes and invalidation](https://navios.tech/docs/di/react/scopes-and-invalidation.md): A singleton lives as long as the container. Two tools give a service a shorter life in React: ScopeProvider ties request-scoped services to a part of the component tree, and invalidation replaces one instance on demand. What a scope is and what invalidation destroys are DI concepts, explained in Scopes and Invalidation; this page covers their React side. - [API](https://navios.tech/docs/di/reference/api.md): Everything exported by @navios/di and @navios/di/testing. Each entry links to the page that explains it; this page only lists signatures. - [React API](https://navios.tech/docs/di/reference/react-api.md): Every public export of @navios/di-react, with signatures. This page is for looking things up; the React guides explain how the pieces are used. Peer dependencies: @navios/di and react ^18.0.0 || ^19.0.0. - [Migrating to 2.0](https://navios.tech/docs/di/reference/migrating-to-2.md): Version 2.0 replaces the resolution engine of @navios/di. Resolution is synchronous first, a token is identified by the object, the global registry and priorities give way to explicit providers, and a service is always built in the scope it declares. This page lists every public change from 1.x and shows the ones most applications meet. Server applications should read Migrating to 2.0 for the framework changes; this page covers only the container. ## Commander - [Getting Started](https://navios.tech/docs/commander/getting-started.md): Get up and running with Navios Commander in minutes. This guide will walk you through installation, basic setup, and your first CLI command. - [Overview](https://navios.tech/docs/commander/overview.md): Navios Commander is a CLI command framework built on @navios/di that provides a decorator-based approach to building command-line applications, similar to how @navios/core works for HTTP applications. Package: @navios/commanderLicense: MITPeer Dependencies: @navios/di, zod (^4.0.0) - [Commands](https://navios.tech/docs/commander/guides/commands.md): Commands are the core building blocks of Navios Commander. This guide covers everything you need to know about creating and structuring commands. - [Modules](https://navios.tech/docs/commander/guides/modules.md): Modules organize commands and provide a way to structure your CLI application. This guide covers how to create and use modules effectively. - [Dependency Injection](https://navios.tech/docs/commander/guides/dependency-injection.md): Navios Commander has full integration with @navios/di, allowing you to inject services into commands and use all DI features. This guide covers how to use dependency injection in your CLI commands. - [Execution Context](https://navios.tech/docs/commander/guides/execution-context.md): The CommandExecutionContext provides access to information about the current command execution, including the command metadata, path, and validated options. This is useful for middleware, guards, or any service that needs context about the current command execution. - [Validation](https://navios.tech/docs/commander/guides/validation.md): Navios Commander uses Zod schemas to validate command options. This ensures type safety and provides helpful error messages when options are invalid. - [Testing](https://navios.tech/docs/commander/guides/testing.md): Testing CLI commands is essential for ensuring your commands work correctly. Navios Commander provides programmatic command execution, making it easy to test commands in isolation. - [API Reference](https://navios.tech/docs/commander/api-reference.md): Complete API reference for Navios Commander. - [Database Commands](https://navios.tech/docs/commander/recipes/database-commands.md): This recipe shows how to create CLI commands for database operations like migrations, seeding, and queries. - [File Operations](https://navios.tech/docs/commander/recipes/file-operations.md): This recipe shows how to create CLI commands for file operations like reading, writing, processing, and managing files. - [API Clients](https://navios.tech/docs/commander/recipes/api-clients.md): This recipe shows how to create CLI commands that interact with REST APIs, including authentication, request handling, and response formatting. - [Multi-Command Workflows](https://navios.tech/docs/commander/recipes/multi-command-workflows.md): This recipe shows how to create workflows that execute multiple commands in sequence, handle dependencies, and manage complex operations. - [Best Practices](https://navios.tech/docs/commander/best-practices.md): This guide covers best practices for building CLI applications with Navios Commander.