This repository contains the CKAN-based implementation for the Zambia National Research Repository (ZNRR). CKAN is an open-source data management system for powering data hubs and portals. For more information, see the official CKAN documentation.
The main components of this repository are:
ckanext-zarr/— Custom CKAN extension for ZNRR functionality.plugin.py— CKAN plugin implementationactions.py— Modified CKAN actionshelpers.py— Template helper functionspresets.json— ckanext-scheming extension presetsprofiles.py— RDS-compatabile DCAT profile logic for Dublin Core Schemaupload.py— Giftless upload logicvalidators.py— Custom validatorsassets/— Static CSS and JS assetspublic/— Public static imagesreact/— React frontend components: file uploader onlyschemas/— DCAT-compatible Dublin Core Metadata Schema definitionstemplates/— Jinja2 templatestests/— Unit and integration tests
Dockerfile— Containerization for reproducible deployments.bootstrap.sh,ckan-entrypoint.sh— Shell scripts for environment setup and container entrypoint.Pipfile,Pipfile.lock— Python dependency management using Pipenv..env— Environment variable configuration (not committed; see below)..github/— CI/CD and development environment configuration.- Submodules (3rd party):
ckan/— Core CKAN source code and configuration files.
- Python dependencies are managed with Pipenv (
Pipfile,Pipfile.lock). This ensures reproducible environments and easy dependency updates using Pipenv. - Node.js dependencies (for frontend assets in
ckanext-zarr/ckanext/zarr/react) are managed viapackage.jsonin relevant directories. - Docker is used for containerized deployments, ensuring consistency across environments.
It is unlikely you will need to use these (as they are largely requried for automatic tests) but environment variables are loaded from the .env file (not committed to version control). Key variables typically include:
CKAN_SITE_URL— The base URL for the CKAN instance.CKAN_SQLALCHEMY_URL— Database connection string.CKAN_SOLR_URL— Solr search engine URL.CKAN_REDIS_URL— Redis cache URL.CKAN_DATASTORE_WRITE_URL— Datastore write connection string.CKAN_DATASTORE_READ_URL— Datastore read connection string.- Other extension-specific variables as required.
Refer to the CKAN configuration documentation for a full list of supported environment variables.
- Follow CKAN extension development guidelines: See CKAN Extension Development.
- Use Pipenv for Python dependency management: Run
pipenv installto set up the environment. - Linting and formatting: Use
.flake8for code style enforcement. - Testing: Use
pytestand CKAN's built-in test framework. Configuration files liketest-core.iniare provided. - Documentation: Update
README.mdand extension-specificREADME.mdfiles regularly.
For questions or contributions, please refer to the individual extension README.md files or open an issue in this repository.