### Setup Arches Database and Run Server Source: https://github.com/archesproject/arches/blob/dev/8.2.x/README.md Sets up the database for your Arches project and starts the development server. Ensure your virtual environment is activated. ```bash python manage.py setup_db python manage.py runserver ``` -------------------------------- ### Setup Fresh Arches Database Shorthand Source: https://github.com/archesproject/arches/blob/dev/8.2.x/docker/Readme.md Delete any existing Arches database and set up a fresh one using the 'setup_arches' shorthand command. This is useful for development or starting from scratch. ```bash docker-compose run arches setup_arches ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.13.md Run this command to start a development server that automatically rebuilds frontend changes. ```bash npm start ``` -------------------------------- ### Install Dependencies and Build Frontend Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.1.0.md Commands to remove yarn.lock, install dependencies, and build frontend assets. ```bash rm yarn.lock ``` ```bash yarn ``` ```bash yarn build_production ``` ```bash yarn build_development ``` ```bash yarn_start ``` -------------------------------- ### Install frontend dependencies and build assets Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.1.0.md Navigate to the project root and run these yarn commands to install updated frontend dependencies and rebuild the media directory. ```bash yarn yarn build_production yarn build_development yarn_start ``` -------------------------------- ### Start Development Server Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/8.0.0.md Run `npm start` to build the frontend and launch a webpack development server. This enables live rebuilding of static assets upon detecting changes. ```bash npm start ``` -------------------------------- ### Install frontend dependencies and build assets Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.2.0.md Navigate to your project's root directory and run these yarn commands to install frontend dependencies and build development or production assets. ```bash yarn yarn build_development ``` ```bash yarn start ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md Install frontend dependencies using npm. This command should be run in the project root directory where `package.json` is located. ```bash npm install ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.3.0.md After updating `package.json`, remove `yarn.lock`, delete the `media/node_modules` folder if it exists, and run `yarn` to install the updated frontend dependencies. ```bash yarn ``` -------------------------------- ### Start development server or build frontend assets Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.4.1.md These commands are used to build and serve frontend assets. 'yarn start' runs a development server, while 'yarn build_development' creates a development bundle. ```bash yarn start ``` ```bash yarn build_development ``` -------------------------------- ### Arches Project Setup and Frontend Build Source: https://context7.com/archesproject/arches/llms.txt Provides npm scripts for installing dependencies, building the Vue 3 + TypeScript frontend asset bundle for development or production, and running the development server. ```bash # One-time install pip install arches arches-admin startproject myproject cd myproject # Set up the database and Elasticsearch indexes python manage.py setup_db python manage.py es setup_indexes # Install JS dependencies (from myproject/myproject/ where package.json lives) cd myproject npm install # Build for development (fast, unminified, includes source maps) npm run build_development # Build for production (minified, optimised) npm run build_production # Start the Webpack dev server (auto-rebuilds on file changes) npm run start # In a separate terminal: python manage.py runserver # Type-check TypeScript sources npm run ts:check # Lint JavaScript/TypeScript npm run eslint:check # Run frontend unit tests (Vitest) npm run test ``` -------------------------------- ### Install gettext on Ubuntu/Linux Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md Installs the GNU gettext utility on Ubuntu or other Debian-based Linux distributions. This is a prerequisite for certain build processes. ```bash sudo apt-get update sudo apt-get install gettext ``` -------------------------------- ### Install gettext on macOS Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md Installs and links the GNU gettext utility on macOS using Homebrew. Ensure Homebrew is installed before running these commands. ```bash brew install gettext brew link --force gettext ``` -------------------------------- ### Run Docker Containers with Docker Compose Source: https://github.com/archesproject/arches/blob/dev/8.2.x/docker/Readme.md Start your Arches project, PostgreSQL, and other services using `docker-compose up`. This command initializes the project on the first run and starts the Django server. ```bash docker-compose -f .\docker-compose-local.yml up ``` -------------------------------- ### Install Development Dependencies and Hooks Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md Install development dependencies and pre-commit hooks. This ensures your development environment is set up correctly for custom development and code quality checks. ```bash pip install -e '.[dev]' pre-commit install ``` -------------------------------- ### Install JavaScript Dependencies Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/6.0.0.md Run this command in your project's package.json directory to install updated JavaScript dependencies after modifying package.json. ```bash yarn install ``` -------------------------------- ### Update package.json start script Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.2.0.md Update the start script in your package.json to include NODE_PATH and NODE_OPTIONS for the webpack development server. ```json "start": "NODE_PATH=./media/node_modules NODE_OPTIONS=--max_old_space_size=8192 ./media/node_modules/.bin/webpack serve --config webpack/webpack.config.dev.js" ``` -------------------------------- ### Create Python Virtual Environment and Install Arches Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/5.0.0.md Steps to create a Python 3 virtual environment, activate it, and install Arches using pip. This is a prerequisite for upgrading or setting up a new Arches project. ```bash python -m venv env source env/bin/activate (env) pip install arches ``` -------------------------------- ### Start New Arches Project Source: https://github.com/archesproject/arches/blob/dev/8.2.x/README.md Creates a new Arches project named 'myproject'. Navigate into the created directory afterwards. ```bash arches-admin startproject myproject cd myproject ``` -------------------------------- ### Get Workflow History Source: https://context7.com/archesproject/arches/llms.txt Retrieve the history of a specific multi-step guided workflow using its ID. Requires an authorization token. ```bash curl -H "Authorization: Bearer " \ "http://localhost:8000/workflow_history/44444444-0000-0000-0000-000000000001" ``` -------------------------------- ### Configure Arches Server Command in docker-compose.yml Source: https://github.com/archesproject/arches/blob/dev/8.2.x/docker/Readme.md Specify commands to run when the Arches service starts directly within the docker-compose.yml file. This example shows running tests and then the server. ```yaml command: run_tests run_server ``` -------------------------------- ### Install CouchDB for Arches Collector Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/4.4.1.md Commands to install CouchDB on Ubuntu for use with the Arches Collector App. Ensure you add the repository, import the key, and then install the package. ```bash sudo add-apt-repository "deb https://apache.bintray.com/couchdb-deb $(lsb_release -sc) main" wget --quiet -O - https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add - sudo apt-get update sudo apt-get install couchdb ``` -------------------------------- ### Remove Yarn (Tarball) Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md If Yarn was installed from a tarball, manually remove the installation directory. ```bash rm -rf "$HOME/.yarn" ``` -------------------------------- ### Build Frontend Asset Bundle (Development) Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md Build the frontend static asset bundle for development. Use `npm start` for active development with automatic updates, or `npm run build_development` for a static build. ```bash npm start ``` ```bash npm run build_development ``` -------------------------------- ### Install Arches Package Source: https://github.com/archesproject/arches/blob/dev/8.2.x/README.md Installs the Arches Python package using pip. Ensure you have a virtual environment activated. ```bash pip install arches ``` -------------------------------- ### Build Production Frontend Bundle Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.4.2.md Creates a production-ready bundle for frontend assets. This process can take a significant amount of time. ```bash yarn build_production ``` -------------------------------- ### Initialize Cube Portfolio Plugin Source: https://github.com/archesproject/arches/blob/dev/8.2.x/arches/app/media/plugins/cube-portfolio/documentation/index.html Initialize the plugin with default options or with a callback function. Use the 'init' method for explicit initialization. ```javascript jQuery("#grid-container").cubeportfolio(options); ``` ```javascript jQuery("#grid-container").cubeportfolio('init', options); ``` ```javascript jQuery("#grid-container").cubeportfolio(options, callbackFunction); ``` ```javascript jQuery("#grid-container").cubeportfolio('init', options, callbackFunction); ``` -------------------------------- ### Build Development Bundle for Frontend Assets Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.2.1.md Use this command to create a development bundle of your application's frontend assets. This process should be relatively quick. ```bash yarn build_development ``` -------------------------------- ### Build Development Frontend Assets Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.2.1.md Run this command in your project's root directory to build the frontend assets for development. This will start a webpack development server. ```bash yarn start ``` -------------------------------- ### Enable User Signup Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/6.1.0.md Set ENABLE_USER_SIGNUP to True to allow users to create their own accounts via the signup view. Defaults to False. ```python ENABLE_USER_SIGNUP = True ``` -------------------------------- ### Resource Model Operations in Python Source: https://context7.com/archesproject/arches/llms.txt Demonstrates creating, loading, and deleting resources using the `Resource` model. It also shows how to serialize a resource to JSON with specific display options. ```python from arches.app.models.resource import Resource # Create and save a new resource resource = Resource() resource.graph_id = "aaaaaaaa-0000-0000-0000-000000000001" resource.legacyid = "SITE-0099" resource.save(index=True) # Load an existing resource with tiles filtered by read permission resource = Resource.objects.get( pk="3b5c1e7a-0001-0001-0001-000000000001" ) resource.load_tiles() print(resource.displayname()) # e.g. "Hadrian's Wall" print(resource.displaydescription()) print(resource.get_root_ontology()) # CIDOC-CRM class URI # Serialize to the "beta" JSON representation (nodes resolved to display values) from django.contrib.auth.models import User user = User.objects.get(username="admin") json_repr = resource.to_json( compact=True, hide_empty_nodes=True, user=user, perm="read_nodegroup", version="beta", ) # json_repr["tiles"] contains display-value-annotated tile data # Delete resource and remove from Elasticsearch index resource.delete() ``` -------------------------------- ### Initialize Knockout ViewModel and Bindings Source: https://github.com/archesproject/arches/blob/dev/8.2.x/tests/fixtures/viewer.html Sets up the Knockout ViewModel, computes a full JSON representation of resources, and applies bindings to the DOM. This is typically done once when the page loads. ```javascript viewModel.full_json = ko.computed(function() { return ko.toJSON({ resources: viewModel.resources }); }); ko.applyBindings(viewModel); ``` -------------------------------- ### Cube Portfolio Initialization with Options Source: https://github.com/archesproject/arches/blob/dev/8.2.x/arches/app/media/plugins/cube-portfolio/documentation/index.html This snippet shows where to place Cube Portfolio options within the initialization block. Ensure options are comma-separated. Consult the 'Full list of options' for available settings. ```javascript jQuery('#grid-container').cubeportfolio({ // place here the options. Don't forget to separate them by comma }); ``` -------------------------------- ### Install Latest Elasticsearch for Arches Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/4.5.0.md This command installs the latest version of Elasticsearch into your project directory. It's a prerequisite for upgrading Arches to use the new Elasticsearch version. ```bash python manage.py es install ``` -------------------------------- ### Initialize Cube Portfolio with Search Source: https://github.com/archesproject/arches/blob/dev/8.2.x/arches/app/media/plugins/cube-portfolio/documentation/index.html Enable search functionality by setting the 'search' option to the selector of your search input element when initializing the plugin. ```javascript To connect the plugin with the HTML snippet you must set the option search: '#js-search-blog-posts' when initialize the plugin. ``` -------------------------------- ### Apply Patch to Running Arches System Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/3.0.4.md Apply a patch to an existing Arches installation to upgrade to version 3.0.4. Remember to replace '{path to arches v3}' with the actual path to your Arches installation. ```bash sudo python manage.py install_patch -s {path to arches v3}/arches/management/patches/20150717_upgrade_to_v3_0_4 ``` ```bash python manage.py install_patch -s {path to arches v3}/arches/management/patches/20150717_upgrade_to_v3_0_4 ``` -------------------------------- ### List IIIF Manifests Source: https://context7.com/archesproject/arches/llms.txt Use this endpoint to list IIIF manifests with support for search queries and pagination. Requires an authorization token. ```bash curl -H "Authorization: Bearer " \ "http://localhost:8000/iiifmanifest?query=mosaic&start=0&limit=10" ``` -------------------------------- ### Create Resource Instance (Arches-JSON) Source: https://context7.com/archesproject/arches/llms.txt Create a new resource instance by sending a POST request with the resource details and associated tiles in Arches-JSON format. The resource instance ID can be left empty for auto-generation. ```bash # Create a resource (arches-json POST) curl -X POST \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "resourceinstance": { "graph_id": "aaaaaaaa-0000-0000-0000-000000000001", "resourceinstanceid": "", "legacyid": "SITE-0043" }, "tiles": [ { "nodegroup_id": "bbbbbbbb-0000-0000-0000-000000000001", "data": { "dddddddd-0000-0000-0000-000000000001": "Vindolanda Fort" } } ] }' \ "http://localhost:8000/resources/aaaaaaaa-0000-0000-0000-000000000001?format=arches-json" ``` -------------------------------- ### Run System Checks and Generate Frontend Configuration Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md Perform system checks with production settings and generate the frontend configuration file. This is a critical step for deployment and ensuring the application is correctly configured. ```bash python manage.py check --deploy --settings=path.to.production.settings ``` -------------------------------- ### Install npm Components in Arches Container Source: https://github.com/archesproject/arches/blob/dev/8.2.x/docker/Readme.md Run this command within your Arches container to install newly added static file packages. This is necessary because the volume mount can hide files generated during the image build process. ```bash docker-compose -f .\docker-compose-local.yml run arches install_npm_components ``` -------------------------------- ### Tile Model Operations in Python Source: https://context7.com/archesproject/arches/llms.txt Shows how to fetch, update, create, and delete individual data tiles using the `Tile` model. Includes applying provisional edits for review workflows. ```python from arches.app.models.tile import Tile from arches.app.models.resource import Resource # Fetch and update an existing tile tile = Tile.objects.get(pk="cccccccc-0000-0000-0000-000000000001") tile.data["dddddddd-0000-0000-0000-000000000001"] = "Updated Site Name" tile.save(index=True) # Create a new tile programmatically resource = Resource.objects.get(pk="3b5c1e7a-0001-0001-0001-000000000001") new_tile = Tile({ "resourceinstance_id": str(resource.resourceinstanceid), "nodegroup_id": "bbbbbbbb-0000-0000-0000-000000000001", "data": { "dddddddd-0000-0000-0000-000000000001": "New Site Name" } }) new_tile.save(index=True) # Apply a provisional edit (for reviewer-gated workflows) from django.contrib.auth.models import User user = User.objects.get(username="editor1") tile.apply_provisional_edit( user=user, data={"dddddddd-0000-0000-0000-000000000001": "Provisional Value"}, action="create", status="review" ) # Delete a tile tile.delete() ``` -------------------------------- ### Upgrade Arches package Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/8.1.0.md Install Arches version 8.1.0 using pip. ```bash pip install --upgrade arches==8.1.0 ``` -------------------------------- ### Uninstall Yarn (Windows) Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md If Yarn was installed via Chocolatey, use this command to uninstall it. ```powershell choco uninstall yarn ``` -------------------------------- ### Initialize Cube Portfolio with Filters Source: https://github.com/archesproject/arches/blob/dev/8.2.x/arches/app/media/plugins/cube-portfolio/documentation/index.html Initialize the Cube Portfolio plugin by specifying the selector for the filters container. Multiple filters can be specified. ```javascript jQuery('#grid-container').cubeportfolio({ filters: '#filters-container', // you can even add multiple filters here (e.g. }); ``` -------------------------------- ### Build Frontend Assets for Development Source: https://github.com/archesproject/arches/blob/dev/8.2.x/README.md Builds the frontend asset bundle for development. This command should be run from the 'myproject/myproject' directory within your project. ```bash npm run build_development ``` -------------------------------- ### Uninstall Yarn (macOS) Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md If Yarn was installed via Homebrew, use this command to uninstall it. ```bash brew uninstall yarn ``` -------------------------------- ### Upgrade Arches to 8.2.0 Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/8.2.0.md Use this command to upgrade your Arches installation to version 8.2.0. ```bash pip install --upgrade arches==8.2.0 ``` -------------------------------- ### Define STATIC_ROOT and STATIC_URL in settings.py Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.1.0.md Ensure `STATIC_ROOT` and `STATIC_URL` are defined in your `settings.py` file with appropriate values for static file handling. ```python STATIC_ROOT = os.path.join(ROOT_DIR, "staticfiles") ``` ```python STATIC_URL = "/static/" ``` -------------------------------- ### Upgrade Arches to 7.6.20 Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.20.md Use this command to upgrade your Arches installation to version 7.6.20. ```bash pip install --upgrade arches==7.6.20 ``` -------------------------------- ### Cube Portfolio External Initialization Source: https://github.com/archesproject/arches/blob/dev/8.2.x/arches/app/media/plugins/cube-portfolio/documentation/index.html Example of how to set the height for Cube Portfolio when used outside the plugin. Ensure this CSS is applied correctly to your element. ```css height: 300px; /* your desire value */ ``` -------------------------------- ### Upgrade Arches to 7.6.18 Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.18.md Use this command to upgrade your Arches installation to version 7.6.18. ```bash pip install --upgrade arches==7.6.18 ``` -------------------------------- ### Upgrade Arches to 7.6.21 Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.21.md Use this command to upgrade your Arches installation to version 7.6.21. ```bash pip install --upgrade arches==7.6.21 ``` -------------------------------- ### Ensure Web Server Write Access Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.0.md Verify that your web server has write permissions for these configuration files before upgrading. ```bash ${project_name}/.frontend-configuration-settings.json ${project_name}/.tsconfig-paths.json ``` -------------------------------- ### Upgrade Arches to 7.6.14 Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.14.md Use this command to upgrade your Arches installation to version 7.6.14. ```bash pip install --upgrade arches==7.6.14 ``` -------------------------------- ### Create User Preference Source: https://context7.com/archesproject/arches/llms.txt Create a new user preference, specifying the preference name, application name, username, and configuration details. Requires an authorization token and Content-Type header. Application Administrator privileges are needed. ```bash curl -X POST \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "preferencename": "map_default_zoom", "appname": "arches", "username": "editor1", "config": { "zoom": 10, "center": [-2.37, 54.99] } }' \ "http://localhost:8000/api/user_preference/" ``` -------------------------------- ### Upgrade Arches to 7.6.10 Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.10.md Use this command to upgrade your Arches installation to version 7.6.10. ```bash pip install --upgrade arches==7.6.10 ``` -------------------------------- ### Create Cache Table Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/6.1.0.md If using Django's DatabaseCache for 'user_permission', run this command to create the necessary database table. ```bash python manage.py createcachetable ``` -------------------------------- ### Upgrade Arches to 7.6.16 Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.6.16.md Use this command to upgrade your Arches installation to version 7.6.16. ```bash pip install --upgrade arches==7.6.16 ``` -------------------------------- ### Configure Static Files in settings.py Source: https://github.com/archesproject/arches/blob/dev/8.2.x/releases/7.0.0.md Ensure these static file configurations are present in your project's `settings.py` file. `STATIC_ROOT` defines the directory for collected static files, `STATIC_URL` sets the URL prefix for static files, and `STATICFILES_DIRS` specifies additional directories to search for static files. ```python STATIC_ROOT = os.path.join(ROOT_DIR, "staticfiles") ``` ```python STATIC_URL = "/static/" ``` ```python STATICFILES_DIRS = ( os.path.join(APP_ROOT, 'media', 'build'), os.path.join(APP_ROOT, 'media'), ) + STATICFILES_DIRS ```