LabPress Documentation Overview¶
Welcome to the LabPress documentation. This guide provides a technical overview of LabPress, a lightweight academic content management system designed for research groups, university laboratories, and individual research teams. You will learn what LabPress is, the design principles behind it, the technology stack that powers it, and how the system architecture is organized to support extensibility, internationalization, and dynamic content management.
What is LabPress?¶
LabPress is an open-source Academic CMS written in pure PHP and MySQL, with no framework dependencies. It allows labs or small research teams to deploy a professional website capable of presenting research outputs, team members, publications, news, custom tools, and projects within minutes. Unlike generic CMS platforms, LabPress is natively tailored for academic use cases: it ships with built-in modules for managing publications, project portfolios with category filters, research news with Markdown editing, tool versioning, and a fully dynamic homepage that can be edited entirely from the administration panel.
LabPress is not just another website builder. Its core strength lies in a hook-driven plugin system inspired by WordPress, which allows developers to extend functionality without modifying any core files. Combined with a decoupled internationalization (i18n) layer that handles both static and database-stored dynamic content, LabPress achieves modularity and multilingual support rarely found in lightweight CMS solutions.
Design Philosophy¶
LabPress was born out of the practical needs of academic research groups that require both dynamic content management and multilingual presentation. Every architectural decision follows a few guiding principles:
- Academic First β Features such as publication listings, project categorization, research news, and tool showcases are first-class entities with dedicated admin interfaces and database tables.
- Extensible by Design β All core functionality is exposed through actions and filters via the
LabPress_Hooksclass. Plugins can intercept, modify, or augment behavior at dozens of defined hook points. - Zero Coupling β The core system has no awareness of any plugin. Even the dynamic multilingual capability is implemented entirely as a plugin, using the
translatefilter to replace strings. Removing all plugins leaves a functional site that falls back to its default language for core features. - Separation of Concerns β The frontend and backend are split at the entry-point level, with independent language contexts, asset loading, and permission checks. This ensures that public-facing performance is not impacted by administrative complexity.
- Lightweight Yet Complete β The entire application runs on commodity hosting with PHP 7.4+ and MySQL 5.7+. No Composer, no Node.js build step, and no virtual environment are required. Third-party libraries are kept to a minimum and are either bundled locally or loaded from stable public CDNs.
Technology Stack¶
| Layer | Technology | Justification |
|---|---|---|
| Language | PHP 7.4+ | Ubiquitous on shared hosting; no framework overhead; compatible with most virtual hosting environments |
| Database | MySQL 5.7+ / MariaDB 10.3+ | Reliable and widely available; structured data for academic entities |
| Frontend | HTML5, CSS3, vanilla JS | Minimal dependencies; EasyMDE and Isotope are bundled locally, while Font Awesome is loaded from a public CDN. |
| Plugin System | Custom LabPress_Hooks class | Lightweight implementation of the WordPress hook paradigm |
| i18n | Custom __() function + language files | Module-based loading, supports nested keys, integrates with the filter system |
| Markdown | Parsedown library (bundled) | Converts Markdown to HTML for news and project content |
| Security | PDO prepared statements, bcrypt hashing, session-based authentication, permission checks | Prevents SQL injection and XSS; restricts admin actions based on user roles |
LabPress does not depend on any third-party PHP frameworks, ORMs, or template engines. The codebase follows a pragmatic flat-file structure. Frontend pages are standalone PHP files at the project root, each handling its own data retrieval and rendering. Administrative interfaces are separated into /admin/views/ and loaded by the backend entry points. Shared logic resides in /includes/, with data access provided by PDO wrapper functions.
Architecture Overview¶
LabPress follows a straightforward request lifecycle:
- Bootstrapping:
index.php(or the relevant frontend page) loadsincludes/config.php, initializes the database connection, and triggers theinitaction hook after all plugins have been loaded. - Hook Initialization: Each enabled plugin registers its callbacks on
init. Plugins typically add filters for translation, menu items, or slide data, and actions for injecting scripts or registering admin pages. For detailed information, please refer to the Plugin Development section. - Content Rendering: Frontend pages query the database directly using helper functions. Key output points are wrapped in
applyFilters()or__()calls, allowing plugins to alter content without the core being aware of their existence. - Admin Panel: The
/admindirectory contains an independent entry point that enforces authentication and loads the appropriate view based on the query string. Admin views are plain PHP files that typically contain their own data retrieval and POST handling logic for simplicity, without a separate controller layer.
The plugin system is the backbone of extensibility. It provides:
- Actions (
addAction,doAction) β for executing code at specific points (e.g.,footer_scripts,admin_before_head_end). - Filters (
addFilter,applyFilters) β for modifying data (e.g.,translate,nav_menu_item,slides_data). - Plugin Lifecycle HooksΒ βΒ
plugin_activation,Βplugin_deactivation, andΒplugin_uninstalledΒ are triggered during activation, deactivation, and uninstallation respectively.
For a complete list of all available actions and filters, refer to the Hooks Reference.
A plugin is simply a folder inside /plugins/ containing a plugin.php file with a standardized header comment. The admin panel scans this directory, manages activation states, and supports ZIP upload for installation.
The internationalization system works on two levels:
- Static strings are stored in language files under
languages/{locale}/, organized by module. The__()function loads these on demand and supports dot-notation for nested arrays. - Dynamic content (e.g., homepage slogan, research direction cards, navigation menus) stored in the database is translated via the
Dynamic Multi-Languageplugin, which registers on thetranslatefilter and queries its ownml_translationstable.
The two systems operate independently but share the same translate filter mechanism. The core uses __() for all output, and the plugin transparently provides translations when available without modifying the core.
Directory Structure¶
LabPress/
βββ admin/ # Backend management panel
β βββ index.php # Admin entry point (dashboard loader)
β βββ login.php # Admin login page
β βββ logout.php # Logout handler
β βββ includes/
β β βββ admin-header.php # Admin sidebar + top bar
β β βββ admin-footer.php # Admin footer (JS includes)
β βββ views/ # Individual management views
β β βββ dashboard.php # System overview & stats
β β βββ publications.php # Publications CRUD
β β βββ slides.php # Slides management
β β βββ tool-list.php # Tool list management
β β βββ tool-detail.php # Tool detail editor
β β βββ tool-versions.php # Version history manager
β β βββ project-categories.php # Project categories CRUD
β β βββ projects.php # Projects management
β β βββ news.php # Research news management
β β βββ users.php # User management
β β βββ site-config.php # General site settings
β β βββ nav-menus.php # Navigation menu manager
β β βββ plugins.php # Installed plugins list
β β βββ plugins-install.php # Plugin installer (ZIP upload)
β β βββ plugins-market.php # Plugin marketplace (placeholder)
β βββ assets/
β βββ css/
β β βββ admin.css # Backend global styles
β β βββ easymde.min.css # EasyMDE editor styles (admin)
β βββ js/
β βββ admin.js # Sidebar & common admin scripts
β βββ easymde.min.js # EasyMDE Markdown editor (admin)
β βββ plugins-manage.js # Plugin activation/deactivation
β βββ plugins-install.js # Plugin installation logic
β βββ plugins-market.js # Plugin market interactions
β βββ publications.js # Publications CRUD logic
β βββ slides.js # Slides CRUD + image upload
β βββ tool-list.js # Tool list CRUD
β βββ tool-detail.js # Tool detail loading
β βββ tool-versions.js # Version management logic
β βββ project-categories.js # Category CRUD
β βββ project-manage.js # Projects CRUD + EasyMDE
β βββ news-manage.js # News CRUD + EasyMDE
β βββ users.js # User management logic
β βββ site-config.js # Site settings dynamic forms
β βββ nav-menus.js # Menu CRUD logic
β
βββ api/ # RESTful data endpoints
β βββ data.php # Unified data reader (type-based)
β βββ save.php # Unified data saver (type-based)
β βββ upload.php # Image upload handler
β βββ users.php # User CRUD API
β βββ auth.php # Authentication API (check/login/logout)
β βββ plugin-install.php # Plugin ZIP installation endpoint
β βββ plugin-install-from-url.php # Remote plugin installation
β βββ plugin-uninstall.php # Plugin removal endpoint
β
βββ assets/ # Frontend global static resources
β βββ css/
β β βββ index.css # Homepage styles
β β βββ header.css # Navigation bar styles
β β βββ tools.css # Tools list page styles
β β βββ tool_detail.css # Tool detail page styles
β β βββ news.css # News list & detail styles
β β βββ news-detail.css # News detail specific styles
β β βββ projects.css # Project list page styles
β β βββ project-detail.css # Project detail page styles
β βββ js/
β βββ index.js # Homepage carousel & publications loader
β βββ project.js # Project list interactions (Isotope)
β βββ isotope.pkgd.min.js # Isotope filtering library
β
βββ includes/ # Core library & configuration
β βββ config.php # Database connection & site constants (user-created, not in repository)
β βββ config-sample.php # Configuration template (copy to config.php)
β βββ functions.php # Core functions (data access, helpers, i18n)
β βββ hooks.php # Plugin hook system (LabPress_Hooks)
β βββ header.php # Frontend header + navigation
β βββ footer.php # Frontend footer
β βββ labpress.php # LabPress core utility class (config, pages, etc.)
β
βββ languages/ # Core language packs
β βββ zh_CN/
β β βββ lang.config # Language metadata (flag, name)
β β βββ common.php # Shared UI strings (nav, footer, buttons)
β β βββ index.php # Homepage strings
β β βββ news.php # News module strings
β β βββ projects.php # Projects module strings
β β βββ tools.php # Tools module strings
β β βββ publications.php # Publications module strings
β βββ en_US/
β βββ lang.config
β βββ common.php
β βββ index.php
β βββ news.php
β βββ projects.php
β βββ tools.php
β βββ publications.php
β
βββ plugins/ # Plugin directory
β βββ FooterInfo/ # Footer customization plugin
β β βββ plugin.php
β βββ dynamic-multilang/ # Dynamic multi-language translation plugin
β β βββ plugin.php # Plugin main file (hooks & filters)
β β βββ admin-page.php # Admin management page
β β βββ languages/
β β β βββ zh_CN.php # Plugin UI language pack
β β βββ assets/
β β βββ dm-admin.css # Admin panel styles
β β βββ dm-admin.js # Admin panel interactions
β βββ hello-word/ # Hello World example plugin
β βββ plugin.php
β
βββ images/ # Repository images used by demo content and slides
β βββ slide-1771610110.png
β βββ slide-1771663308.png
β βββ slide3.jpg
β βββ proteintrim-logo.png
β βββ proteintrim-screenshot.jpg
β
βββ uploads/ # User uploaded files
β βββ news/ # News images
β βββ projects/ # Project images
β βββ general/ # General purpose uploads
β βββ gallery/ # Gallery images (e.g., Gromacs, ComputBio, ComputChem)
β
βββ ReadImg/ # Repository images (logo, screenshots for README)
β βββ labpress-logo.png
β βββ screenshot-home.png
β
βββ index.php # Frontend homepage (dynamic content)
βββ tools.php # Tools list page
βββ tool-detail.php # Tool detail page
βββ projects.php # Projects list page (with category filter)
βββ project-detail.php # Project detail page
βββ news.php # News list page
βββ news-detail.php # News detail page
βββ publications.php # Publications list page
βββ category.php # Category filtered project list
β
βββ labpressexample.sql # Example database dump
β
βββ .gitignore # Git ignore rules
βββ LICENSE # Open-source license (GPL-3.0)
βββ README.md # Project overview & setup guide
Documentation Structure¶
This documentation is organized into several major sections, each targeting a specific aspect of LabPress usage and development:
- Home: index.md
- Getting Started:
- Guide Overview: getting-started/guide-overview.md
- Installation Guide: getting-started/installation.md
- Quick Start: getting-started/quick-start.md
- Basic Configuration: getting-started/configuration.md
- Setup:
- Site Settings: setup/site-settings.md
- Navigation Menus: setup/navigation.md
- Plugin Management: setup/plugins.md
- Content Management:
- Publications: content/publications.md
- Slides: content/slides.md
- Tools: content/tools.md
- Projects: content/projects.md
- News: content/news.md
- Users: content/users.md
- Internationalization:
- Overview: i18n/overview.md
- Core Language Packs: i18n/core-lang.md
- Dynamic Multi-Language Plugin: i18n/dynamic-multilang.md
- Plugin Development:
- Plugin System Introduction: plugins/intro.md
- Developing Your First Plugin: plugins/develop.md
- Hooks Reference: plugins/hooks-reference.md
- Plugin Examples: plugins/examples.md
- Reference:
- API Endpoints: reference/api.md
- Database Schema: reference/database.md
- Developer Resources: reference/developer-resources.md
- Contributing: contributing.md
- Security: security.md
- Changelog: changelog.md
The documentation is structured to guide you from initial installation through advanced plugin development. Each section is self-contained and can be read independently based on your needs.
How to Use This Documentation¶
This documentation is organized to support different personas:
- New Users should start with the Getting Started section, which walks through installation, initial configuration, and basic content creation.
- Site Administrators will find detailed guides in the Setup and Content Management chapters, covering every configurable aspect of the system.
- Developers interested in extending LabPress should head directly to the Plugin Development section, which explains the hook system, plugin anatomy, and includes a full hooks reference.
- Translators and those managing multilingual sites can explore the Internationalization chapter to understand how both static and dynamic translations work.
- Contributors should read the Contribution Guidelines and the Security Policy before submitting patches.
Every page aims to be technically precise, providing code examples, database schema snippets, and configuration samples where appropriate. If you encounter any inconsistencies, please open an issue on the GitHub repository.
Next Steps¶
Begin your journey with the Installation Guide to get LabPress running on your server, or jump directly to the Plugin Development Introduction if you are eager to write your first extension.