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).
and enables custom development without compiling, letting you directly deploy and test module resources, oftentimes without restarting the server.
|Hello World||A simple "Hello World" module.||Tutorial: Hello World Module|
|Assay||A module with an assay directory included, for defining a new assay type.||Modules: Assay Types|
|Extract-Transform-Load||A module with an etl directory included, for configuring data transfer and synchronization between databases.||ETL: Extract Transform Load|
|Java||A module with a Java src directory included. Develop Java-based applications to create server-side code.||Modules: Java |
Tutorial: Hello World Java Module
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: viewAPIs
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
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.