PraneoTech

Orvex: From an Internal Image Server to Multi-Tenant File Infrastructure

How a storage requirement inside Praneo Tech evolved into a shared service for file management, encryption, and storage-provider independence.

Orvex Logo

It started with a problem we kept running into

At Praneo Tech, we wanted to use different storage providers across our applications. We also needed a consistent way to protect sensitive documents with encryption.

But there was another concern: we didn't want every application's backend to carry the entire cost of file handling.

Uploading, downloading, encrypting, and decrypting files consume CPU, memory, and network resources. When these responsibilities run inside the same backend that handles business logic, file processing competes with the resources needed to serve the application.

We wanted to separate those responsibilities.

We also struggled to find a solution that combined storage flexibility, encryption, and centralized file management in the way we needed.

Our initial answer was an internal image server. It gave one application a common API for managing files while allowing us to control how and where those files were stored.

As we considered the possibility of using the same capability across other applications, the original design began to evolve. We realized that good things should be shared.

That became the starting point for Orvex.

Moving file handling out of application backends

One of the main architectural decisions behind Orvex was to separate file processing from application business logic.

Instead of having every backend independently manage file uploads, encryption, storage integrations, and retrieval, applications can delegate those operations to Orvex.

This creates a dedicated service boundary for file management.

The application remains responsible for its business operations, while Orvex handles the file-management workflow, including optional encryption and communication with the configured storage backend.

This separation avoids duplicating file-handling implementations across applications and allows file-processing resources to be managed independently.

It also provides room to scale file processing separately when workloads increase, rather than scaling an entire application backend simply because its file operations have become heavier.

The goal isn't to eliminate processing costs. File transfers and encryption still require resources. It is to put those costs in a dedicated service where they can be managed independently.

From a single application to multiple tenants

The original image server was designed for one application. Turning it into a shared service meant reconsidering how files, users, and application boundaries were represented.

Orvex evolved to use a user- and domain-based data model. A user can own multiple domains, with folders and files associated with those domains.

Here, a domain represents an application or logical scope associated with a user, rather than necessarily a public DNS domain.

Application traffic is authenticated using user API keys through the X-API-Key header. File operations are scoped to the authenticated user's domains.

A separate SuperAdmin API uses Bearer JWT authentication to provision users, attach domains, and handle key recovery. This provides a control plane for managing the service independently of the applications consuming it.

The current implementation uses logical separation within a shared PostgreSQL database, rather than a separate database for every tenant. File operations must therefore consistently verify ownership through the domain relationship.

This gives Orvex a multi-tenant design without introducing the operational complexity of maintaining separate databases for every customer.

Separating storage from applications

Orvex uses a common provider interface to keep storage-specific operations separate from its file-management logic.

The current implementation uses Cloudflare R2 as its active storage backend. R2 provides an S3-compatible API, allowing Orvex to use the familiar S3 SDK ecosystem for object storage.

Dropbox and Google Drive clients also exist behind the provider abstraction, but they are currently disabled. The architecture is designed with provider independence in mind; R2 is the active integration today.

This distinction matters. Applications interact with Orvex rather than implementing provider-specific storage integrations themselves. The underlying provider can evolve without requiring every consuming application to be rewritten.

The abstraction also leaves room for additional S3-compatible backends, although individual providers may differ in their supported operations.

Security as a shared capability

Encryption was one of the original reasons for building Orvex, so it became part of the file-management design.

Protected uploads, identified by the isProtected option, use AES-256-GCM encryption. Each protected file receives its own encryption key, which is wrapped using a master key derived from the caller's API key.

This allows applications to use protected-file operations without independently implementing their own encryption and key-wrapping workflows.

Encryption is optional rather than automatic: files are protected when the application requests it. That distinction is important because applications need to make deliberate decisions about which files require protection.

For applications handling sensitive information, encryption can support safeguards considered under frameworks such as HIPAA and GDPR. However, encryption alone does not establish compliance. Access controls, auditability, key management, backups, retention, and operational procedures remain necessary.

Orvex performs decryption on the server. Because the server receives the API key during requests, this is application-level encryption, not zero-knowledge or end-to-end encryption.

Key recovery regenerates API and recovery keys and attempts to re-wrap protected-file keys. That path still needs careful validation before we treat it as production-ready.

What the architecture looks like

Orvex brings together five main responsibilities:

  • Application API: file uploads, retrieval, listing, deletion, and folder management.

  • Tenant management: user and domain provisioning through the SuperAdmin control plane.

  • Authorization: API-key authentication and domain-scoped file ownership.

  • Metadata management: PostgreSQL records connecting users, domains, folders, files, and storage objects.

  • Storage and encryption: provider abstraction and optional protected-file operations.

The service is built with TypeScript, Express, PostgreSQL, and Prisma.

Orvex Info

For example, an application can upload a protected document through the API:

curl -X POST http://localhost:3000/api/files/upload \ -H "X-API-Key: YOUR_API_KEY" \ -F "[email protected]" \ -F "folder=documents" \ -F "isProtected=true"

The current upload limit is 10 MB. The application does not need to know the storage provider's internal object identifiers or implement the encryption workflow itself.

Unprotected files can also be accessed through temporary storage URLs. These URLs and their access characteristics need to be considered when designing an application's file-access policies.

What we've learned building it

Building a shared service introduces responsibilities that aren't always obvious in a single-application implementation.

A feature that works for one user or one domain needs to be reconsidered when multiple domains share the same service. Encryption introduces key lifecycle and recovery problems. Storage providers may also behave differently, even when they expose similar APIs.

Separating file processing introduces another operational responsibility: Orvex itself must have sufficient resources and availability to serve the applications depending on it.

We continue to develop Orvex as we discover bugs, identify limitations, and encounter new requirements. Its recovery workflow and broader security hardening still need further validation.

We don't consider the architecture finished simply because the initial requirements have been implemented. The project evolves as we learn more about how it behaves and where it needs improvement.

Where Orvex stands today

Orvex has evolved from an internal image server into a multi-tenant file-management API with domain-scoped organization, optional application-level encryption, and a storage abstraction currently backed by Cloudflare R2.

It is an open-source project released under the MIT License.

For Praneo Tech, it represents an architectural decision: file management, encryption, and storage integration do not need to be repeated inside every application backend.

The original requirement was straightforward. We wanted flexibility in storage providers without giving up encryption for sensitive files or making every application carry the cost of processing them.

Orvex is our ongoing attempt to solve that problem in a way that can serve more than one application.

Member resources

Sign in to download

Sign in to access your resource library and download .