(osbv2:repositories)=
# Repositories

Repositories are views of files and data in public resources like {ref}`GitHub <osbv2:github>` and {ref}`DANDI Archive <osbv2:dandi>`.
They show the **current contents** of the source.
Currently, {ref}`GitHub <osbv2:github>`, {ref}`Figshare <osbv2:figshare>` and {ref}`DANDI <osbv2:dandi>` are supported, with support for more sources also planned.

Repositories are currently public, so all users can browse repositories that have been added to OSBv2.

(osbv2:repositories:viewing)=
## Viewing available repositories

Users can view all the currently created repositories on OSBv2 in the [repository list](https://v2.opensourcebrain.org/repositories) page.
Click on the "View repositories" button, or the "Repositories" drop down in the top right hand corner to view the repository list page:

```{figure} ../images/osbv2-main-page-repositories-link-with-text.png
:alt: Figure showing how to access the repositories list
:align: center
:width: 600px

Click on the "Repositories" button in the dashboard to view all repositories, or use the "Create" drop down button to create a new one.

```

Users do not need to be signed to view repositories.
However, you will need to {ref}`sign in <osbv2:useraccounts:signin>` to use them, e.g. for populating {ref}`workspaces <osbv2:workspaces>` with data from them.

Once on the repository list page, you can search/filter for and view information on repositories of interest, view your own repositories, and also add new or edit your repositories.

```{figure} ../images/osbv2-repositories-page-with-text.png
:alt: Figure showing the repository list page
:align: center
:width: 800px

You can view, edit, and add new repositories using the repository list page.
```

Clicking on an entry in the repository list page opens the repository's detail page.
Here, you can see a preview of the repository as it is at that time.

```{figure} ../images/osbv2-repository-detail-page-with-text.png
:alt: Figure showing the repository details page
:align: center
:width: 600px

You can view information on repositories here, and select files to add to your workspaces.
```

You can also use the file selector on the right to select files to add to your existing {ref}`workspaces <osbv2:workspaces>`, or use them to create a completely new workspace.

(osbv2:repositories:adding)=
## Adding new and editing repositories

Any user can add a repository to OSBv2 following these steps:

- {ref}`Log in to OSBv2 <osbv2:useraccounts:signin>`
- Go to the repository list page, as shown above
- Click the "Add new repository" button

This brings up the "Add new repository" dialogue box.
Here, you can fill in the necessary information to add your repository to OSBv2.

```{figure} ../images/osbv2-add-repository-with-text.png
:alt: The "Add new repository" dialogue box
:align: center
:width: 700px

Fill in the "Add new repository" dialogue box.
```

The metadata of the repository can also be modified after it has been created.
Clicking the "Edit" option in the pop up as shown above will re-open the "Add new repository" dialogue.
