Repository navigation
Architecture Overview
liseli edited this page Feb 19, 2026
·
4 revisions
- Architecture Overview
- Technology Stack
- [Configuration Files] (#configuration-files)
- [Key Business Logic Summary] (#key-business-logic-summary)
- Error Handling
- Development Notes
- Security Considerations
- Performance Considerations
- Bottlenecks
- Deployment Architecture
- Glossary
- Framework: VuFind- (Villanova University Find) - PHP search framework
- Pattern: Front Controller + Module/Action MVC
- Primary Purpose: Digital library catalog search interface for HathiTrust
- Search Engine: Apache Solr
- Template Engine: Smarty 4
- Session Management: Custom database-backed sessions (DSession)
┌─────────────────────────────────────────┐
│ User Browser (HTTP/HTTPS) │
└────────────────┬────────────────────────┘
│
┌────────────────▼───────────────────────────────────────┐
│ Web servers |
│ Development - Nginx (Reverse Proxy) + PHP-FPM |
│ Production - Apache + mod_php |
└────────────────┬───────────────────────────────────────│
│
┌────────────────▼────────────────────────┐
│ PHP 8.4 │
│ ┌──────────────────────────────┐ │
│ │ index.php (Entry Point) │ │
│ │ ├─ Module/Action Router │ │
│ │ ├─ Services Layer │ │
│ │ └─ System Classes (sys/) │ │
│ └──────────────────────────────┘ │
└────────────────┬────────────────────────┘
│
┌────────────┼────────────┐
│ │ │
┌───▼──────┐ ┌──▼──────┐ ┌──▼────────┐
│ Solr │ │ MySQL │ │ GeoIP │
│ (Search) │ │(Session)│ │(Location) │
└──────────┘ └─────────┘ └───────────┘
[System]
available = true
debug = false
[Site]
url = https://catalog.hathitrust.org
theme = default
language = en
locale = en_US
facetDir = /app/catalog_facet_info
[Index]
engine = Solr
url = http://solr:8983/solr/catalog
urlFile = solr_url.ini
[GeoIP]
path = /usr/share/GeoIP/GeoIP2-Country.mmdb
[OpenURL]
url = https://...- conf/authspecs.yaml - Session and authentication config
- conf/solr_url.ini - Solr URL override
- conf/config.local.ini - Local overrides (not in git)
| User Type | Location | Institution | Full-Text Access | Viewable Items |
|---|---|---|---|---|
| Guest | International | None | ✗ | Public domain only |
| Guest | USA | None | ✓ (limited) | Public domain + Section 108 |
| Authenticated | International | Member | ✗ | PD + Institution holdings |
| Authenticated | USA | Member | ✓ | PD + Section 108 + Institution |
| Emergency Access | Any | Member | ✓ | PD + Section 108 + Institution + Expanded |
- Parse user query (SearchStructure)
-
Apply filters:
- Geographic (if international: only PD)
- Institution (if authenticated: add institution filter)
- Full-text (if enabled: rights filter)
- Collection (HathiTrust collections)
- Execute Solr query
-
Process results:
- Pagination
- Facets
- Highlighting
- Access determination per item
- Render template
// index.php line 327
function handlePEARError($error, $method = null) {
$interface = new UInterface();
$interface->assign('error', $error);
header('HTTP/1.1 404 Not Found');
$interface->display('error.tpl');
exit();
}Triggered By:
- Missing controller file
- Invalid module/action
- PEAR library errors
- Create file:
services/{Module}/{Action}.php - Define class:
class {Action} extends Action - Implement methods:
function setup() { /* initialize */ } function launch() { /* entry point */ }
- Access via:
/{Module}/{Action}
$session = VFSession::instance();
$session->set('my_variable', $value);
$value = $session->get('my_variable');global $interface;
$interface->assign('my_var', $value);
// Available in template as: {$my_var}-
XSS Prevention: Strip
>from all inputs - Session Security: HttpOnly cookies
- CSRF: ❌ Not implemented
- SQL Injection: ✅ PDO prepared statements in DSession
-
Input Validation:
⚠️ Minimal (only>removal)
-
Smarty Templates: Compiled templates cached in
interface/compile/ - Session Data: Database-backed (not file-based)
- Solr: No application-level caching (relies on Solr caching)
- Database sessions: Every request reads/writes MySQL
- GeoIP lookup: Maxmind database read on first request
- Solr queries: Network latency to Solr server
Internet
│
▼
┌────────────────┐
│ Load Balancer │
└────────┬───────┘
│
┌──────────────┼──────────────┐
│ │ │
┌────▼───┐ ┌───▼────┐ ┌───▼────┐
│ Nginx │ │ Nginx │ │ Nginx │
│ + │ │ + │ │ + │
│PHP-FPM │ │PHP-FPM │ │PHP-FPM │
└────┬───┘ └───┬────┘ └───┬────┘
│ │ │
└─────────────┼──────────────┘
│
┌─────────────┼─────────────┐
│ │ │
┌────▼────┐ ┌───▼────┐ ┌───▼────┐
│ Solr │ │ MySQL │ │ Shibbo-│
│ Cluster │ │Sessions│ │ leth │
└─────────┘ └────────┘ │ SSO │
└────────┘
- HathiTrust: Digital library preserving millions of digitized books
- ETAS: Emergency Temporary Access Service (expanded access during COVID-19)
- VuFind: Open-source library discovery interface - VuFind-
- Solr: Apache Solr search platform
- Shibboleth: SAML-based SSO authentication system
- MARC: Machine-Readable Cataloging (bibliographic record format)