Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/api/dandi-client.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# DANDI Client
# {{ instance.name }} Client

The DANDI Client is a Python library and command-line tool for interacting with the DANDI Archive. It provides functionality for downloading, validating, organizing, and uploading data to and from the DANDI Archive.
The {{ instance.name }} Client is a Python library and command-line tool for interacting with the {{ instance.name }} Archive. It provides functionality for downloading, validating, organizing, and uploading data to and from the {{ instance.name }} Archive.

## Installation

You can install the DANDI Client using pip:
You can install the {{ instance.name }} Client using pip:

```bash
pip install dandi
```

## Documentation

The full documentation for the DANDI Client is available at [https://dandi.readthedocs.io/](https://dandi.readthedocs.io/).
The full documentation for the {{ instance.name }} Client is available at [https://dandi.readthedocs.io/](https://dandi.readthedocs.io/).

## Key Features

- Download data from the DANDI Archive
- Download data from the {{ instance.name }} Archive
- Validate NWB files
- Organize data for upload to the DANDI Archive
- Upload data to the DANDI Archive
- Organize data for upload to the {{ instance.name }} Archive
- Upload data to the {{ instance.name }} Archive
- Search for Dandisets
- Manage Dandisets and their metadata

## Python API

The DANDI Client provides a Python API for programmatic interaction with the DANDI Archive. Here's a simple example of using the API to download a Dandiset:
The {{ instance.name }} Client provides a Python API for programmatic interaction with the {{ instance.name }} Archive. Here's a simple example of using the API to download a Dandiset:

```python
from dandi.dandiapi import DandiAPIClient
Expand All @@ -44,7 +44,7 @@ For more information on the Python API, see the [API documentation](https://dand

## Command-Line Interface

The DANDI Client also provides a command-line interface for interacting with the DANDI Archive. Here are some common commands:
The {{ instance.name }} Client also provides a command-line interface for interacting with the {{ instance.name }} Archive. Here are some common commands:

```bash
# Download a Dandiset
Expand All @@ -56,7 +56,7 @@ dandi validate path/to/files
# Organize data for upload
dandi organize path/to/files

# Upload data to DANDI
# Upload data to {{ instance.name }}
dandi upload
```

Expand Down
20 changes: 10 additions & 10 deletions docs/api/rest-api.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# REST API

The DANDI Archive provides a RESTful API that allows programmatic access to the archive. The API is documented using both Swagger and ReDoc, which provide interactive interfaces for exploring and testing the API.
The {{ instance.name }} Archive provides a RESTful API that allows programmatic access to the archive. The API is documented using both Swagger and ReDoc, which provide interactive interfaces for exploring and testing the API.

## Accessing the API

The DANDI API is available at:
The {{ instance.name }} API is available at:

- Production: [https://api.dandiarchive.org/](https://api.dandiarchive.org/)
- Sandbox: [https://api.sandbox.dandiarchive.org/](https://api.sandbox.dandiarchive.org/)
- Production: [{{ instance.api }}/]({{ instance.api }}/)
- Sandbox: [{{ instance.sandbox_api }}/]({{ instance.sandbox_api }}/)

## API Documentation

The API documentation is available in three formats:

### Swagger UI

- Production: [https://api.dandiarchive.org/swagger/](https://api.dandiarchive.org/swagger/)
- Sandbox: [https://api.sandbox.dandiarchive.org/swagger/](https://api.sandbox.dandiarchive.org/swagger/)
- Production: [{{ instance.api }}/swagger/]({{ instance.api }}/swagger/)
- Sandbox: [{{ instance.sandbox_api }}/swagger/]({{ instance.sandbox_api }}/swagger/)

The Swagger UI allows you to:

Expand All @@ -27,8 +27,8 @@ The Swagger UI allows you to:

### ReDoc

- Production: [https://api.dandiarchive.org/redoc/](https://api.dandiarchive.org/redoc/)
- Sandbox: [https://api.sandbox.dandiarchive.org/redoc/](https://api.sandbox.dandiarchive.org/redoc/)
- Production: [{{ instance.api }}/redoc/]({{ instance.api }}/redoc/)
- Sandbox: [{{ instance.sandbox_api }}/redoc/]({{ instance.sandbox_api }}/redoc/)

The ReDoc interface provides:

Expand All @@ -43,9 +43,9 @@ The ReDoc interface provides:

## Authentication

Some API endpoints require authentication. You can authenticate using an API key, which you can obtain from your DANDI account. To use the API key:
Some API endpoints require authentication. You can authenticate using an API key, which you can obtain from your {{ instance.name }} account. To use the API key:

1. Log in to the DANDI Archive
1. Log in to the {{ instance.name }} Archive
2. Click on your user initials in the top-right corner
3. Copy your API key
4. Use the API key in the `Authorization` header of your requests:
Expand Down
36 changes: 18 additions & 18 deletions docs/developer-guide/creating-dandi-instance/dandi-archive.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
This step assumes that you have completed all steps in: [Initialize Vendors](./initialize-vendors.md) & [DANDI Infrastructure](./dandi-infrastructure.md).
This step assumes that you have completed all steps in: [Initialize Vendors](./initialize-vendors.md) & [{{ instance.name }} Infrastructure](./dandi-infrastructure.md).

## Initial Steps

### Running "terraform apply" upon dandi-infrastructure for the first time

Resources (e.g. the servers and environment ) for DANDI Archive are provisioned upon applying the Terraform definitions in
Resources (e.g. the servers and environment ) for {{ instance.name }} Archive are provisioned upon applying the Terraform definitions in
`dandi-infrastructure`, specifically in the [api.tf definition](https://github.com/dandi/dandi-infrastructure/blob/master/terraform/api.tf)
The resources won't be running anything until your first Heroku `release` upon the Heroku app.

To see how your code would translate into a new `Heroku` release, [see the GitHub actions workflow used by DANDI Archive here](https://github.com/dandi/dandi-archive/blob/master/.github/workflows/backend-production-deploy.yml).
To see how your code would translate into a new `Heroku` release, [see the GitHub actions workflow used by {{ instance.name }} Archive here](https://github.com/dandi/dandi-archive/blob/master/.github/workflows/backend-production-deploy.yml).

## Understanding the concept of the Procfile for Heroku

Heroku initializes compute on servers (known as `dynos` in Heroku land). Each `dyno` that you have runs a process.
Which process, the resources allocated to that process, and how that process is run, is defined in a `Procfile`.

DANDI Archive defines a [Procfile](https://github.com/dandi/dandi-archive/blob/master/Procfile). In this `Procfile`,
{{ instance.name }} Archive defines a [Procfile](https://github.com/dandi/dandi-archive/blob/master/Procfile). In this `Procfile`,
you'll see several entries:

- `release`: a command that is run each time a new version of DANDI API is pushed to Heroku.
- `web`: runs `gunicorn`, a persistent server that handles HTTP requests for the DANDI API.
- `release`: a command that is run each time a new version of {{ instance.name }} API is pushed to Heroku.
- `web`: runs `gunicorn`, a persistent server that handles HTTP requests for the {{ instance.name }} API.
- `worker`: a worker process that runs `celery` behind-the-scenes. `celery` handles tasks that would otherwise cause the API to timeout.
- `checksum-worker`: another worker, also using `celery`, that specifically calculates if a new file pushed to DANDI Archive is new/updated, and determines what exactly has been changed.
- `checksum-worker`: another worker, also using `celery`, that specifically calculates if a new file pushed to {{ instance.name }} Archive is new/updated, and determines what exactly has been changed.
- `analytics-worker`: another `celery` worker that handles all tasks related to processing of S3-related logs.

This `Procfile` shouldn't need to be changed or reconfigured much for a DANDI-clone; however, it is important to note so that one may understand how DANDI Archive is working.
This `Procfile` shouldn't need to be changed or reconfigured much for a {{ instance.name }}-clone; however, it is important to note so that one may understand how {{ instance.name }} Archive is working.

For information on the resource allocation of `dynos` in DANDI Archive, please reference the [DANDI Infrastructure Docs](./dandi-infrastructure.md).
For information on the resource allocation of `dynos` in {{ instance.name }} Archive, please reference the [{{ instance.name }} Infrastructure Docs](./dandi-infrastructure.md).

## Understanding metrics and logging via Heroku

Expand Down Expand Up @@ -54,7 +54,7 @@ style="width: 60%; height: auto; display: block; margin-left: auto; margin-righ

## Creating a Django "superuser" (Admin) Account

Django has the concept of a `superuser` -- essentially an `administrator` user type. For steps such as [setting up authentication for DANDI Archive](./dandi-authentication.md#creating-and-updating-objects-in-the-dandi-archive-admin-panel)
Django has the concept of a `superuser` -- essentially an `administrator` user type. For steps such as [setting up authentication for {{ instance.name }} Archive](./dandi-authentication.md#creating-and-updating-objects-in-the-dandi-archive-admin-panel)
you'll need to set up a `superuser` account.

Go into your Heroku app, and identify the `Run Console` option:
Expand Down Expand Up @@ -86,7 +86,7 @@ alt="heroku_user"
style="width: 60%; height: auto; display: block; margin-left: auto; margin-right: auto;"/>
<br/><br/>

You'll be prompted to create a user -- **Note: use an email that is not associated with your GitHub account, as GitHub is the default authentication provider for DANDI Archive**.
You'll be prompted to create a user -- **Note: use an email that is not associated with your GitHub account, as GitHub is the default authentication provider for {{ instance.name }} Archive**.

To do one final test, try using your credentials to log into the Django Admin panel -- it should be located at `/admin` for your API, such as `your-apps-domain.com/admin`.

Expand All @@ -96,11 +96,11 @@ You are all set here!

A majority of the necessary setup steps here are defined already [during the vendor account setup for Netlify](./initialize-vendors.md#netlify).

The only other major initial setup step for the DANDI Archive frontend is regarding authentication -- [see here for more details](./dandi-authentication.md#populating-appropriate-values-for-the-frontend-to-handle-authentication)
The only other major initial setup step for the {{ instance.name }} Archive frontend is regarding authentication -- [see here for more details](./dandi-authentication.md#populating-appropriate-values-for-the-frontend-to-handle-authentication)

## API Deployment with GitHub CI/CD

Within the DANDI Archive repository, GitHub actions workflows exist for deployments to [production](https://github.com/dandi/dandi-archive/blob/master/.github/workflows/backend-production-deploy.yml) and [sandbox](https://github.com/dandi/dandi-archive/blob/master/.github/workflows/backend-staging-deploy.yml) environments
Within the {{ instance.name }} Archive repository, GitHub actions workflows exist for deployments to [production](https://github.com/dandi/dandi-archive/blob/master/.github/workflows/backend-production-deploy.yml) and [sandbox](https://github.com/dandi/dandi-archive/blob/master/.github/workflows/backend-staging-deploy.yml) environments

- **Sandbox**: by default, releases are manual via the `workflow_dispatch` clause in the workflow

Expand Down Expand Up @@ -137,7 +137,7 @@ style="width: 60%; height: auto; display: block; margin-left: auto; margin-righ

## Updating Allowed Hosts

For the Django-based DANDI Archive API to receive and send HTTP requests without CORS errors, you'll need to add `ALLOWED_HOSTS` within the `dandiapi/settings.py` file.
For the Django-based {{ instance.name }} Archive API to receive and send HTTP requests without CORS errors, you'll need to add `ALLOWED_HOSTS` within the `dandiapi/settings.py` file.

The `settings.py` file, in general, can be understood as the configuration file for the Django app -- [see the Django docs for more info here](https://docs.djangoproject.com/en/5.0/topics/settings/)

Expand All @@ -157,7 +157,7 @@ class HerokuProductionConfiguration(DandiMixin, HerokuProductionBaseConfiguratio

## Approval of Users

By default in DANDI, only users whose emails end in `.edu` are automatically approved -- [for code reference, see here](https://github.com/dandi/dandi-archive/blob/6e72653688a6b45066c04b94a44f830b734887dd/dandiapi/api/views/auth.py#L127).
By default in {{ instance.name }}, only users whose emails end in `.edu` are automatically approved -- [for code reference, see here](https://github.com/dandi/dandi-archive/blob/6e72653688a6b45066c04b94a44f830b734887dd/dandiapi/api/views/auth.py#L127).

For all other users, proceed into the Django Admin panel.

Expand Down Expand Up @@ -188,7 +188,7 @@ Additionally, we are configured to take a backup image of the Postgres database

## Addition of the Cache Table for Metrics

On the DANDI homepage, metrics exist for how many users, and how much data is stored in the Archive.
On the {{ instance.name }} homepage, metrics exist for how many users, and how much data is stored in the Archive.

<br/><br/>
<img
Expand All @@ -197,7 +197,7 @@ alt="dandi_stats"
style="width: 60%; height: auto; display: block; margin-left: auto; margin-right: auto;"/>
<br/><br/>

In order to not constantly query for those values, DANDI uses a [Django cache table](https://docs.djangoproject.com/en/5.1/topics/cache/#creating-the-cache-table). This table must be separately initialized.
In order to not constantly query for those values, {{ instance.name }} uses a [Django cache table](https://docs.djangoproject.com/en/5.1/topics/cache/#creating-the-cache-table). This table must be separately initialized.

This can be done via the CLI command of:

Expand All @@ -209,7 +209,7 @@ You may not see updated stats immediately, as the stats are cached for 12 hours

## Customizing Logos on the UI

If you'd like to provide your own logo specific to your DANDI clone, you'll need to simply replace the referenced SVG logo in `web/src/assets/logo.svg`
If you'd like to provide your own logo specific to your {{ instance.name }} clone, you'll need to simply replace the referenced SVG logo in `web/src/assets/logo.svg`

For reference, [see here](https://github.com/dandi/dandi-archive/blob/master/web/src/assets/logo.svg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Please follow the steps in [Initialize Vendors - GitHub](./initialize-vendors.md
For the next steps in setting up authentication, you'll want to record the values
created during [Obtaining your Oauth App creds](./initialize-vendors.md#obtaining-your-oauth-app-credentials).

## Creating and Updating Objects in the DANDI Archive Admin Panel
## Creating and Updating Objects in the {{ instance.name }} Archive Admin Panel

### Creating "Sites" and "Social App" Objects

**In order to complete this step, you will need to have deployed an initial DANDI Archive API**. See [Creating the DANDI Archive API](./dandi-archive.md) for more details.
**In order to complete this step, you will need to have deployed an initial {{ instance.name }} Archive API**. See [Creating the {{ instance.name }} Archive API](./dandi-archive.md) for more details.

First, sign in via the Django admin panel with your credentials created via the [Creating an admin user account for the DANDI Archive API step](./dandi-archive.md#creating-a-django-superuser-admin-account)
First, sign in via the Django admin panel with your credentials created via the [Creating an admin user account for the {{ instance.name }} Archive API step](./dandi-archive.md#creating-a-django-superuser-admin-account)

The Django Admin panel should be located at: `<your_full_api_url/admin`

Expand Down Expand Up @@ -73,9 +73,9 @@ There are two places to update values relevant to the frontend.
- `netlify.toml`
- `.env.production`

For `netlify.toml`: This should be located in the `web/` sub-directory -- [see DANDI Archive web/netlify.toml](https://github.com/dandi/dandi-archive/blob/master/web/netlify.toml). This is a file in which you can configure different settings for different environments in Netlify.
For `netlify.toml`: This should be located in the `web/` sub-directory -- [see {{ instance.name }} Archive web/netlify.toml](https://github.com/dandi/dandi-archive/blob/master/web/netlify.toml). This is a file in which you can configure different settings for different environments in Netlify.

For `.env.production`: This should also be located in the `web/` sub-directory -- [see DANDI Archive web/.env.production](https://github.com/dandi/dandi-archive/blob/master/web/.env.production). This is a file that will inject environment variables into the frontend upon build (e.g. `vite build`).
For `.env.production`: This should also be located in the `web/` sub-directory -- [see {{ instance.name }} Archive web/.env.production](https://github.com/dandi/dandi-archive/blob/master/web/.env.production). This is a file that will inject environment variables into the frontend upon build (e.g. `vite build`).

Update the relevant values that reflect what was in your `Social Application` object for both files. You will also notice an environment variable related to `Sentry` -- this value can be obtained from your Sentry account.

Expand Down
Loading