Example Projects

PSPDFKit Server comes with two example projects — one written in Ruby on Rails, and another one in Node.js — to demonstrate how to integrate PSPDFKit Server with your own backend.

If you’re looking into PSPDFKit for Web, we recommend you follow the Getting Started guide for Server-backed deployment instead.

Once you are ready to integrate with your own backend, you can set up an instance of PSPDFKit Server using our Deployment guide, which shows you the necessary docker-compose.yml file in detail.

  1. Make sure you have Docker installed and running.

    On macOS, we recommend the most recent version of Docker for Mac.

    On Windows, we recommend the most recent version of Docker for Windows.

    You can use any OS supported by Docker, including popular Linux distributions like Ubuntu, Debian, Fedora, Red Hat, or CentOS.

  2. Log in to the private PSPDFKit Docker registry:

    Copy
    1
    2
    
    docker login -u YOUR_DOCKER_USERNAME_GOES_HERE -p YOUR_DOCKER_PASSWORD_GOES_HERE docker.pspdfkit.com
    docker pull docker.pspdfkit.com/pspdfkit:latest
    
  3. Get one of our example apps.

    The examples provide docker-compose.yml and Dockerfile files that will work without additional configuration:

    To clone the example to your machine and switch to its directory, run the following commands:

    1
    2
    
    git clone [email protected]:PSPDFKit/pspdfkit-server-example-nodejs.git
    cd pspdfkit-server-example-nodejs
    
    1
    2
    
    git clone [email protected]:PSPDFKit/pspdfkit-server-example-rails.git
    cd pspdfkit-server-example-rails
    
  4. Run the example:

    1
    
    ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker-compose up
    

    You only have to provide the activation key once. After doing so, the server will remain activated until you reset it.

    The example app is now running on http://localhost:3000.

    You can access PSPDFKit Server’s dashboard at http://localhost:5000/dashboard with the username dashboard and the password secret.

    You can quit the running containers with Ctrl-C.

    If you want to test PSPDFKit for Web on different devices in your local network, you need to edit the PSPDFKIT_SERVER_EXTERNAL_URL environment variable in the docker-compose.yml file and set it to an address that’s reachable from your device.

  5. Follow the Getting Started guides for PSPDFKit Instant for Android, iOS, or web.