Modules encapsulate functionality, packaging resources together for simple deployment within LabKey Server. Modules are developed by incrementally adding resources as files within a standardized directory structure. For deployment, the structure is archived as a .module file (a standard .zip file renamed with a custom file extension). A wide variety of resources can be used, including but not limited to: R reports, SQL queries and scripts, API-driven HTML pages, CSS, JavaScript, images, custom web parts, XML assay definitions, and compiled Java code. A module that doesn't contain any Java code is called a file-based module and enables custom development without compiling, letting you directly deploy and test module resources, oftentimes without restarting the server.

This topic helps module developers extend LabKey Server. To learn about pre-existing modules built into LabKey Server, see Modules in LabKey Server Editions.

Module Functionality

Hello WorldA simple "Hello World" module.Tutorial: Hello World Module
Queries, Views, and ReportsA module that includes queries, reports, and/or views directories. Create file-based SQL queries, reports, views, web parts, and HTML/JavaScript client-side applications. No Java code required, though you can easily evolve your work into a Java module if needed.Tutorial: File Based Module Resources
AssayA module with an assay directory included, for defining a new assay type.Modules: Assay Types
Extract-Transform-LoadA module with an ETLs directory included, for configuring data transfer and synchronization between databases.ETL: Extract Transform Load
Script PipelineA module with a pipeline directory included, for running scripts in sequence, including R scripts, JavaScript, Perl, Python, etc.Script Pipeline: Running Scripts in Sequence
JavaA module with a Java src directory included. Develop Java-based applications to create server-side code.Java Modules
Tutorial: Hello World Java Module

Developer Resource

Do I Need to Compile Modules?

Modules containing Java code require a build/compile step before deployment. File-based modules (that do not contain Java) do not need compilation. Most module functionality can be accomplished without the need for Java code, including "CRUD" applications (Create-Retrieve-Update-Delete applications) that provide views and reports on data on the server, and provide some way for users to interact with the data. These applications will typically use some combination of client APIs like: selectRows, insertRows, updateRows, etc. Learn more about the APIs available here: LabKey Client APIs.

Other advanced custom functionality, including defining new assay types, working with the security API, and manipulating studies, can also generally be accomplished with a file-based module.

To create your own server actions (i.e., code that runs on the server, not in the client), Java is generally required. Trigger scripts, which run on the server, are an exception: trigger scripts are a powerful feature, sufficient in many cases to avoid the need for Java code.

As you develop, keep in mind that both client- and server-side APIs may change over time as the LabKey Server code base evolves; custom modules may require changes to keep them up to date.

Set Up for Module Development

Use the following topic to set up a development machine for building and compiling (when necessary) LabKey modules: Set Up a Development Machine

Premium Features Available

Subscribers to the Professional or Enterprise Edition of LabKey Server can load modules on production servers without starting and stopping them, and on development machines, can edit module resources from within the user interface. Learn more in these topics:

Learn more about premium editions

Module Topics

The topics below show you how to create a module, how to develop the various resources within the module, and how to package and deploy it to LabKey Server.

Was this content helpful?

Log in or register an account to provide feedback

expand allcollapse all