{"id":13741049,"url":"https://github.com/pierrz/brif","last_synced_at":"2025-05-08T21:32:07.901Z","repository":{"id":79435600,"uuid":"455209787","full_name":"pierrz/brif","owner":"pierrz","description":"Brif is a boilerplate tool based on Docker and FastAPI, designed to streamline the development and deployment of IIIF compliant platforms.","archived":false,"fork":false,"pushed_at":"2024-11-14T08:28:13.000Z","size":4371,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-14T09:24:16.888Z","etag":null,"topics":["celery","docker-compose","fastapi","iiif","python3"],"latest_commit_sha":null,"homepage":"https://brif.muzai.io/demo","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pierrz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-03T15:03:50.000Z","updated_at":"2024-11-14T08:17:45.000Z","dependencies_parsed_at":"2024-10-16T19:28:12.247Z","dependency_job_id":"8f739879-ac5c-4932-8c7c-d8291bac38ee","html_url":"https://github.com/pierrz/brif","commit_stats":null,"previous_names":[],"tags_count":6,"template":true,"template_full_name":"pierrz/papel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierrz%2Fbrif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierrz%2Fbrif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierrz%2Fbrif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierrz%2Fbrif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pierrz","download_url":"https://codeload.github.com/pierrz/brif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253153163,"owners_count":21862318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","docker-compose","fastapi","iiif","python3"],"created_at":"2024-08-03T04:00:54.922Z","updated_at":"2025-05-08T21:32:07.017Z","avatar_url":"https://github.com/pierrz.png","language":"Python","funding_links":[],"categories":["Presentation Manifest Tools"],"sub_categories":["Image viewers (Image API only)"],"readme":"# brif\n\nA boilerplate tool based on Docker, designed to streamline the development and deployment of IIIF compliant platforms.\n\nEmbedded with `FastAPI, Celery + Rabbit-MQ + Flower, Postgres + PGAdmin, Cantaloupe, Bulma`\nand provided with an example configuration for `Nginx`.\n\n**NB:** _This tool is not actively maintained annd you might encounter some issues during the `docker compose build` phase. \nOverall, it's mostly a matter of dependencies to update and some `Dockerfiles` to refine._\n\n### IIIF features:\n- Cantaloupe image server \u003c=\u003e Image API 2.1\n- FastAPI implementation \u003c=\u003e Presentation API 2.1\n- Automated manifest creation from CSV files\n- IIIF manifests creation based on [Prezi](https://github.com/iiif-prezi/iiif-prezi)\n- [Tify viewer](https://github.com/tify-iiif-viewer/tify) directly embedded with each manifest\n\n\u003cbr\u003e\n\n---\n\n### Table of Contents\n- [Creative material](#creative-material)\n- [Installation](#installation)\n    - [Backend](#backend)\n    - [Cantaloupe](#cantaloupe)\n    - [Frontend](#frontend)\n    - [Data](#data)\n- [Test](#test)\n- [Run](#run)\n- [Manual](#manual)\n  - [Notes](#notes)\n  - [Data and images sample](#data-and-images-sample)\n  - [Docs \u0026 Monitoring](#docs--monitoring)\n  - [Dashboard UI](#dashboard-ui)\n- [Development](#development)\n\n\u003cbr\u003e\n\n---\n\n\n### Creative material\nThe tiny dataset and 6 related images used in the demo are released as copyright-free materials, and come from the Finnish National Gallery [Open Data platform](https://www.kansallisgalleria.fi/en/api-sovelluskehittajille).\n\n\u003cbr\u003e\n\n### Installation\n#### Backend\nYou should use the `main` branch, other branches being used for development purpose.\n\nFetch all the Git LFS resources: `git lfs install \u0026\u0026 git lfs fetch --all \u0026\u0026 git lfs pull`\n\nIf you want to use Nginx, you can just create a symbolic link\nfrom `setup/all_containers.conf` to the Nginx websites directories in `/etc/nginx/sites-*` in your machine, and tweak the the provided example configuration with the correct Docker containers IPs\nand relevant references to your certificates.\nFrom the repository root, use this command to retrieve these IPs:\n```\ndocker compose ps -q | xargs docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'\n```\n\n\nSame goes with [servers.json](setup/pgadmin/servers.json.example) if you use the `pgadmin` container.\n\nThen you're left with creating the `.env` environment file.\n\n*NB: For all these required files, you'll find `xxxxxx.example` sample files ready to adapt.*\n\n\u003cbr\u003e\n\n#### Cantaloupe\nMount your images as volumes in the `cantaloupe` service and set `FilesystemSource.BasicLookupStrategy.path_prefix` in [cantaloupe.properties](setup/cantaloupe/cantaloupe.properties.example) accordingly to get things going.\nFrom there, you can easily set your logs, enable/disable different API version number (i.e. from to 3) as it follows the very [official documentation](https://cantaloupe-project.github.io/).\n\n\u003cbr\u003e\n\n#### Frontend\nYou can add your own [head_meta.html](app/templates/html/head_meta.html.example), or discard it from `base.html` while implementing up the `{title}` tag again.\n\n\u003c!-- There is a template to use along your chosen analytics provider. \nIn our case it is [head_meta.html](app/templates/html/head_meta.html.example) --\u003e\n\n\u003cbr\u003e\n\n#### Data\nYou just need to copy your datasets in `data/input`, and the dashboard should automatically pick them up. \n\nOr change accordingly in docker's [x-brif-common](docker-compose.brif.yml) \n\nEach directory can contain multiple datasets, and they will be treated separately. Each directory can have only 1 specific mapping.\n\nEach directory can contain one [mapping.json](app/src/mappings/default_mapping_csv.json) file to implement a specific mapping for the data pipeline. If not present, a default mapping will be applied.\n\n\u003cbr\u003e\n\n### Test\nTo check your installation, run the following command.\n```\ndocker-compose docker-compose.yml api_test up\n```\n\n**NB:** You will need to import the provided data and image samples for all the tests to pass. \nSee in [Section](#data-and-images-sample) for further details.\n\n### Run\nOnly the main containers\n```\ndocker-compose up\n```\n\n\\+ monitoring containers\n```\ndocker-compose -f docker-compose.yml -f docker-compose.monitoring.yml up\n```\n\n\\+ with Brif app (including test container)\n```\ndocker-compose -f docker-compose.yml -f docker-compose.monitoring.yml up\n```\n\n\u003cbr\u003e\n\nDocker is great but sometimes tricky ... when changes are made, don't forget to:\n- Use the `--build` flag.\n- Cleanse the database properly by using the `prune` and `rm` tools to purge volumes and containers.\n\n\u003cbr\u003e\n\n### Manual\n\n##### Notes\n\nThis tool is not meant to search within the collection, only to transform the raw data into valid IIIF manifests.\n\nTo browse further the collection you will probably need to import the transformed data into a search engine such as Elasticsearch or Solr.\n\nEach transformed dataset comes with a new `collection` dataset which gathers all the transformed IIIF manifests URLs, thus making it easy to import the related data within your system.\n\n\u003cbr\u003e\n\n##### Data and images sample\nTo make it easier to test this tool in action, we included both data and image samples.\n\nYou should import them in the locations you for chose these elements, \nwhich can be set up via the paramenters `DATA_DIR` and `CONTENT_DIR` in the `.env` file.\n\nFind the files in the `setup` directory:\n- `setup/app/input_sample/test_dataset/test_records.csv`\n- `setup/cantaloupe/test_images.zip`\n\n\n##### Docs \u0026 Monitoring\nYou can find the Swagger UI for the whole tool at the `/docs` url. Some endpoints are voluntarily not presented there, look for `include_in_schema=False` for the exclusions if necessary.\n\nThe tool comes with optional monitoring services (Flower and PGAdmin) to monitor further your Postgres database and the tasks going through the pipeline.\n\n\u003cbr\u003e\n\n##### Dashboard UI\n\nAt startup, a dashboard is directly accessible at the url `/dashboard`\n- The dashboards is a basic UI to manage your datasets and check the transformed collections. \n- It shows some stats, along with sample links.\n\nThe workflow is relatively simple:\n- The whole dataset is itemised.\n- A dedicated IIIF Image API is spinned up based on the provided images.\n- Each new item/record is transformed into a IIIF manifest.\n- A new collection dataset is created which gathers all the IIIF manifests urls.\n\nOnce processed, all manifests can be accessed with their base URI followed by `/manifest.json` to access the data or either `/view` for the Tify viewer.\n\n\u003cbr\u003e\n\n### Development\nIf you want to make some changes in this repo while following the same environment tooling.\n```\npoetry config virtualenvs.in-project true\npoetry install \u0026\u0026 poetry shell\npre-commit install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierrz%2Fbrif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierrz%2Fbrif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierrz%2Fbrif/lists"}