Noureddine RAMDI / rachoon: a modular document processing service with PDF conversion and PostgreSQL

Created Mon, 04 May 2026 10:23:02 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

ad-on-is/rachoon

rachoon offers a practical approach to document processing by combining a TypeScript backend service with PostgreSQL database management and Gotenberg for PDF generation. If you’ve ever had to assemble a document processing pipeline that includes data storage and PDF conversion, rachoon provides a modular, containerized solution that’s worth understanding.

what rachoon does and how it’s architected

At its core, rachoon is a web service written in TypeScript designed to handle document generation and management. It does not try to do everything internally but integrates with specialized tools to deliver its functionality.

The architecture is composed of three main components running as containers:

  • rachoon service: The main application responsible for orchestrating document workflows, handling data, and providing an API.
  • PostgreSQL database: Serves as the persistent store for application data. The choice of PostgreSQL is typical for TypeScript backend apps requiring relational data modeling.
  • Gotenberg: A dedicated PDF rendering service that accepts HTML or other document formats and converts them into PDFs. Using Gotenberg offloads the complexity of PDF generation from rachoon.

This separation of concerns keeps the codebase maintainable and leverages existing open-source projects for specialized tasks.

Configuration is done via environment variables passed into the containers, including database credentials, app keys, and service URLs. This fits well with Twelve-Factor App principles.

technical strengths and tradeoffs

The modularity of rachoon’s architecture is a clear strength. By delegating PDF creation to Gotenberg, it avoids reinventing PDF rendering logic, which can be complex and error-prone.

Using PostgreSQL provides a robust, battle-tested relational store that supports complex queries and data integrity. This makes rachoon suitable for production use cases where data consistency matters.

The tradeoff is the complexity introduced by orchestrating multiple containers and ensuring they communicate correctly. Deployment requires managing the lifecycle of all services, which might be overkill for simple use cases.

The code quality, while not fully observable from the README alone, benefits from TypeScript’s static typing, which helps catch issues early and improves DX. The Docker Compose configuration is clear and straightforward, easing deployment.

The use of environment variables for sensitive data like encryption keys and database passwords is standard practice but requires careful secrets management in production.

quick start

The project provides a Docker Compose snippet for easy deployment. Here’s the exact configuration to get started:

services:
  rachoon:
    image: ghcr.io/ad-on-is/rachoon
    container_name: rachoon
    environment:
      - APP_KEY=<some-app-key> # min 32 characters - used to encrypt and sign sensitive data
      - DB_CONNECTION=pg
      - GOTENBERG_URL=http://gotenberg:3000
      - PG_HOST=postgres16
      - PG_PORT=5432
      - PG_USER=<root-user>
      - PG_PASSWORD=<root-password>
      - PG_DB_NAME=rachoon
    ports:
      - 8080:8080

  gotenberg:
    image: gotenberg/gotenberg:8

  postgres16:
    container_name: postgres16
    image: postgres:16
    environment:
      - POSTGRES_USER=<root-user>
      - POSTGRES_PASSWORD=<root-password>
      - POSTGRES_DB=postgres
    volumes:
      - ./rachoon-data:/var/lib/postgresql/data
      - ./docker/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh

Also, dependencies are installed via pnpm:

pnpm install

This setup clearly expects you to provide your own secure values for keys and passwords, aligning with good security hygiene.

verdict

rachoon is a solid example of a modular document processing service that balances leveraging existing tools with custom orchestration. It’s relevant for developers building backend services that need dependable PDF generation combined with relational data management.

The tradeoff is the overhead of managing multiple containers and ensuring their configurations are secure and consistent, so it fits best in environments where container orchestration is already part of the infrastructure.

If your use case involves complex document workflows with PostgreSQL as a backend and you want to avoid building PDF generation yourself, rachoon is worth exploring. The codebase and deployment model are straightforward enough for teams comfortable with Docker Compose and TypeScript services.

Limitations include the dependency on Gotenberg’s container and PostgreSQL setup, which might complicate deployment in more constrained or simpler environments. But if you’re already running containerized services, this design offers flexibility and maintainability without unnecessary bloat.


→ GitHub Repo: ad-on-is/rachoon ⭐ 941 · TypeScript