Components

The server code is the package gws in app/gws. Each package links to its API documentation, built with make.sh doc-api.

Framework

PackageContents
gwsBasic types and the interfaces of all components, generated from the .pyinc files of the packages. Every module imports it with import gws.
configReads configuration files in all supported formats, validates them against the specs, builds the object tree, stores it and loads it in the worker processes. gws.config.util has helpers that configure common children, like templates, models and finders.
coreThe object tree implementation behind gws.Node and gws.Root. Also general utilities (gws.u), logging (gws.log), debugging helpers (gws.debug), constants such as system paths and role names (gws.c), and environment variables (gws.env).
extThe decorators that register extension types and commands. They do nothing at runtime, the spec generator reads them from the source.
serverConfiguration and control of the embedded servers (nginx, uWSGI, rsyslog), the gws server commands, the monitor that reloads the server on configuration changes, and the spooler for background jobs.
specThe spec generator, which parses the source code, and the spec runtime, which validates configurations and requests, converts special types and imports extension classes on demand.
testThe test runner behind make.sh test, the in-container runner, the mock HTTP server and the utilities used in tests.

Base

gws.base contains the core components. They are always loaded, and most of them define a base class that plugins extend.

PackageContents
actionThe base action class and the action manager, which finds the action for a command, validates the request and checks permissions. Also the gws action CLI commands.
applicationThe application object, the first node of the tree. It configures all global components in a fixed order and holds the managers, like actionMgr, authMgr or databaseMgr.
authUsers and roles, the authorization manager, base classes for authentication methods (how credentials arrive), providers (where users come from), multi-factor adapters and sessions.
clientThe configuration of the client UI: which elements (toolbar buttons, sidebar tabs, and so on) a project shows, and their options.
databaseDatabase providers and connections (SQLAlchemy), and base classes for database-backed layers, models and user sources.
editThe edit action, which lets the client list, create, update and delete features of editable models.
exporterExporters that write features to files, the export worker and the exporter action.
featureThe feature object: attributes, geometry, the raw source record and the views rendered by templates.
grabberRaster images for layers: fetches them from sources, aligns them to tile grids, reprojects them and caches tiles.
jobThe job manager: creates jobs, stores their state in sqlite, runs them in the spooler and reports their status and results.
layerThe base layer class, layer groups, base classes for raster and vector layers, and the configuration of layer trees from source layers.
legendThe base legend class, which renders a legend for a layer, and functions to combine several legends into one image.
mapThe map object, which defines the coordinate system, extent and resolutions of a project, and the map action, which renders images, tiles, legends and features of layers.
metadataMetadata of projects, layers and services, based on ISO 19115 and the OGC service standards, with INSPIRE support.
modelData models and fields: reading features from a source, converting them for the client, and validating and writing them back. The module docstring describes the data flow.
owsOGC web services. ows.client parses capabilities and queries WMS, WFS and WMTS sources. ows.server implements WMS, WMTS, WFS and CSW services for configured projects.
printerPrinters and the print worker, which renders a map and a template into a PDF or image in a background job.
projectProjects: a map, a client configuration and project-specific actions, finders, models, templates and printers. Also the projectInfo command, which sends a project to the client.
searchThe search manager, which runs a search query over all finders a user can access, and the base finder class. Finders search layers, models or external services.
shapeGeometries in a coordinate system, based on Shapely, with conversions from and to WKT, WKB, GeoJSON and extents.
storageA key-value store where the client saves user data, like selections or annotations, by category. Storage providers implement the backend.
templateThe base template class and the template manager, which finds a template by subject (for example feature.label) along the tree.
webWeb sites with their rewrite rules, CORS and SSL settings, request parsing (gws.WebRequester), the WSGI application and the web action for assets, pages and downloads.

GIS

PackageContents
cacheTile cache management: status, seeding, cleanup, and the gws cache commands.
renderRenders a map view from layers into raster and SVG planes, and combines them into an image or HTML. Used by map and print templates and by OWS services.
sourceUtilities for source layers, the layers of an external source like a WMS service or a QGIS project: filtering and combining their extents and coordinate systems.
zoomComputes resolutions and scales for maps and layers from the zoom configuration.

Libraries

gws.lib contains libraries that do not depend on the object tree.

PackageContents
boundsExtents with a coordinate system: transforming, combining, buffering.
cliHelpers for command line scripts.
cqlCQL2 filter expressions.
crsCoordinate systems: lookup by code or name, axis order, transformations.
datetimexDates, times, time zones and durations.
dynimportImporting modules from file paths, used for extension classes and plugins.
extentPlain extents: parsing, intersecting, computing centers and sizes.
fontFont installation for rendering.
gdalxA wrapper around GDAL and OGR for raster and vector files.
gmlGML parsing and writing.
gridTile grids: resolutions per level, tile ranges for an extent.
htmlxHTML rendering to PDF or PNG with wkhtmltopdf.
imageImages, a wrapper around Pillow.
inifileReading and writing ini files.
intlLocales and formatting of dates, times and numbers.
jsonxReading and writing JSON.
mapserverRaster rendering with MapServer.
mimeMIME types.
netHTTP requests and URL handling.
osxRunning commands and working with files and processes.
otpOne-time passwords (HOTP, TOTP) for multi-factor authentication.
passwordPassword hashing, checking and generation.
pdfPDF utilities: merging, overlaying, converting pages to images.
saSQLAlchemy imports in one place.
sqlitexA wrapper around the SQLite driver.
styleFeature styles: parsing CSS-like style values and icons.
svgBuilding SVG fragments from shapes and styles.
uomUnits of measure: pixels, millimeters, scales and resolutions.
watcherFile system watcher used by the monitor.
xmlxXML parsing, building and serialization, with namespace handling.
zipxCreating and extracting zip archives.

gws.lib.vendor contains third-party code that is not installed with pip, for example jump (templates), slon (the configuration notation), dog (documentation) and umsgpack (msgpack).

Plugins

gws.plugin contains the optional components. Each plugin package implements one or more extension types, for example layer types, database and OWS providers, authentication methods, model fields, templates or client tools. A plugin is loaded only if the configuration uses one of its types. External plugins, listed in the manifest, work the same way, see Plugins and extension types.