Skip to content

Commit

Permalink
readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Jan 27, 2024
1 parent 4f75338 commit 4001c1e
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# schema.databio.org

Welcome to lab schema repository. The schemas are hosted on github pages.

## Accessing a schema

You can access schemas at the URLS: https://schema.databio.org/File.yaml. For example: https://schema.databio.org/pep/2.0.0.yaml

This corresponds to the indicated folder in this repo.
Welcome to the databio schema registry. This repository holds schemas that are then hosted using simple static API on GitHub pages. You can browse the API
at https://schema.databio.org/. To get a specific schema, construct a URL like: `https://schema.databio.org/{namspace}/{schema}.yaml` -- for example, https://schema.databio.org/pep/2.0.0.yaml would give you the file found in this repository under `schemas/pep/2.0.0.yaml`.

## Contributing a schema

Expand All @@ -18,23 +13,16 @@ First, you have to write a schema yaml file. It should follow json-schema format

After creating your schema file, you can contribute it to this repository so that you and others can more easily load it. Name your schema yaml file with the name of the schema. Schemas in the registry are divided into namespaces, which are represented as subfolders in this repository. So, place your schema into an appropriate subfolder, and then open a pull request.

## Dev for react v2
## Devopment guide

This will change in the future, but for now:
The front-end is built in React, using `vite`. Clone the repository and then start a development server with:

- source schemas are found in the `/schemas` subfolder. Edit there.
- `index_contents.py` will create all the API endpoints and copy the schemas themselves into `/public`, so they will be served by react
- run `npm run build` to create the `/dist` folder from the source in `/src` (and `/public`).
- run `mv dist docs` since github pages wants to host from `/docs` only. (hack!)
- Host the site on github pages from the `docs` folder
```
npm run dev
```

TODO:
- [ ] re-automate the index_contents.py action (it's broken)
- [ ] automate the above build steps
- [ ] fix the breadcrumbs so they just update search params instead of triggering page refresh
### Preparing the inputs

You need to run `index_contents.py` will create all the API endpoints and copy the schemas themselves into `/public`, so they will be served by React. This will be done by the github action for the deployed verison. For testing locally, you'll need to run it yourself. These resulting files are not checked into git since they are generated from the source schemas found in the `/schemas` subfolder.

This is a `vite` site. Clone the repository and then start a development server with:

```
npm run dev
```

0 comments on commit 4001c1e

Please sign in to comment.