# Add interaction between Materials Cloud Archive and AiiDAlab

**URL:** <https://aiida.discourse.group/t/add-interaction-between-materials-cloud-archive-and-aiidalab/65>\
**Category:** Ideas\
**Created:** [August 17, 2023, 7:13am UTC](https://aiida.discourse.group/t/add-interaction-between-materials-cloud-archive-and-aiidalab/65 "2023-08-17T07:13:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xing](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/xing/32/10_2.png) [@Xing](https://aiida.discourse.group/u/Xing)\
**Post date:** [August 17, 2023, 7:13am UTC](https://aiida.discourse.group/t/add-interaction-between-materials-cloud-archive-and-aiidalab/65/1 "2023-08-17T07:13:37Z")

</div>

The idea is to reproduce the current integration between MC Archive and SDSC’s RenkuLab, but with AiIDAlab.

The idea is: if a .aiida file is present, MC Archive generates an additional icon with a custom link, pointing to a RenkuLab instance. When opened, a custom template will download, import the archive and show a jupiter terminal to start using AiiDA.

We can do the same, using the new [`open_app`](https://github.com/aiidalab/aiidalab-home/blob/master/open_app.ipynb), for AiiDAlab.

Things to do:

- create an app to be opened, that just gets the link, downloads the file, imports it, and then shows some basic info/actions (e.g. statistics of what was imported + button to open a jupyter notebook)
- Implement the generation of the link on the MC Archive side
- Decide if we want to point to a specific AiiDAlab deployment, or we provide a multiple choice, or let the user decide.

# on MC archive:

- add new icon next to .aiida files, similar to the renkulab icon e.g. here: [Two-dimensional materials from high-throughput computational exfoliation of experimentally known compounds](https://archive.materialscloud.org/record/2017.0008/v3) that links to a aiidalab specific page to load the .aiida archive

# on the AiiDAlab side:

- have a way to get these links, parse the URL to get back e.g. the archive URL and the filename inside that entry, and then (e.g.) create a new profile with a unique name, import the .aiida file in that profile, and then show some message to the user (e.g. some statistics + info on how to continue inspecting the DB)

# interface

- decide the format of the URL, inspired by existing examples. One example:  
[https://aiidalab.materialscloud.org/load-aiida/mcarchive?doi=10.xxxx-materialscloud:ab-cd&filename=filename.aiida](https://aiidalab.materialscloud.org/load-aiida/mcarchive?doi=10.xxxx-materialscloud:ab-cd&filename=filename.aiida)

- decide what to show (check what is currently done with Renkulab)

- understand how to get a unique link on the AiiDAlab side, but redirect to a user-specific notebook (to be developed)

- how to allow to point to multiple possible deployments of AiiDAlab?

I may start work on this in October.
