Docs/Getting Started

Veap and Next.js: responsibilities

Veap and Next.js solve different layers of an application.

3 min read

Veap and Next.js solve different layers of an application.

  • Next.js owns the web application shell: App Router files, React rendering, route handlers, Server Components, client boundaries, deployment integration and the HTTP server.
  • @veap/kernel owns a reusable application lifecycle, dependency-injection container, service-provider registration, configuration, events, cache contracts, logging, and standardized error/result utilities.
  • Optional Veap packages provide database access, authentication, plugins, localization, mail, settings and storage.

What Veap does not automatically do#

The eight repositories documented here do not establish a replacement for next dev, next build, or next start. They do not define the standard Next.js app/ directory for you, nor do they imply that every package works in every runtime. Continue using the supported Next.js toolchain.

When to add a package#

RequirementPackage
Shared service container and boot lifecycle@veap/kernel
ORM and migrations@veap/database
Users, sessions and permissions@veap/auth
Pluggable admin/UI and plugin route tree@veap/plugins
ICU translations and locale negotiation@veap/intl
Email delivery@veap/mail
Runtime-editable key/value settings@veap/settings
Local or custom file provider@veap/storage

Add a package only when you need its capabilities. Read the package-specific runtime and peer-dependency notes before importing its entry points.

Behaviour delta#

Next.js owns the renderer, the file routing and the build. Veap packages add the application layer around requests - not instead of them.

ConcernNative Next.jsNext.js with Veap
LifecycleNo shared container or boot step@veap/kernel: providers registered once, resolved from IoC
Routingapp/ files only@veap/plugins: plugin route trees mounted through a catch-all
LayoutsPhysical layout.tsx per segmentOne site layout handed to the plugin provider for panel routes
Middlewareproxy.ts, no container accessPer-route middlewares (EnsuredUser) run in the request pipeline
Request stateDirect cookies() / headers() callsCOOKIE_STORE and REQUEST_CONTEXT bound by a transport provider
ConfigurationRaw process.env readsValidated config service that fails fast at boot
ErrorsAd-hoc throws per codebaseAppError and Result helpers with HTTP status mapping

Inherited unchanged#

No transpiler, no runtime shim, no custom build command:

  • React Server Components and Suspense streaming.
  • Server Actions and the "use client" / "use server" directives.
  • Route Handlers under app/api/*.
  • next.config.ts, next dev, next build, next start.
  • public/ assets and globals.css.

Production remains next build followed by next start.

What behaves differently, by design#

  1. bootstrap() is guarded per process and returns early during phase-production-build, so builds never need a database; plugin-backed pages opt into force-dynamic.
  2. The catch-all route is load-bearing: a physical page at the same URL shadows the plugin route.
  3. Enabling or disabling a plugin is a runtime operation persisted by the plugin registry, with migrations applied on boot.
  4. Route access is declared per page (auth, roles, permissions) and always re-checked on the server.
  5. Writes go through transaction(); raw inserts from a connection handle are not the supported pattern.

For the request view of the same layering, see Inside a request.

veap
Preparing0%