PhyloPic is an open database of freely reusable silhouettes of life forms. Code for PhyloPic resides in this monorepo.
Most of the code for PhyloPic is TypeScript.
Project Path | Description |
---|---|
api | Serverless API for accessing PhyloPic data |
api-docs | Documentation for the PhyloPic API |
contribute | Public webapp for contributing silhouette images |
edit | Private webapp (run locally) for managing PhyloPic, including contribution review and data editing |
publish | Code for administrating PhyloPic, including publishing releases and managing source files |
www | Public webapp for searching for and viewing silhouette images |
Project Path | Description |
---|---|
api-models | Type declarations and utility files for data models used by the API |
eslint-config-phylopic | ESLint configurations used throughout the project |
source-client | Client object for reading and writing source models and files |
source-models | Type declarations and utility files for data models used in the source bucket |
styles | Stylesheet values and mixins |
tsconfig | Typescript configurations used throughout the project |
ui | Commonly-used React components for user interfaces |
utils | Common code |
utils-api | Common code related to using the API in a webapp |
utils-aws | Common code related to Amazon Web Services |
The scripts for creating the project's Postgres databases are in sql.
Install Yarn, and then run yarn
from the command root to install dependencies.
To clean up formatting for all source files in all projects, run:
yarn format
To lint all source files and automatically fix certain issues:
yarn lint
To run unit tests in all projects that have them:
yarn test
To run all apps locally:
yarn dev
Note that some apps require certain environment variables to be set, which are documented in that apps's README
file.
Apps will run on the following ports:
App Project | Port |
---|---|
api | 3003 |
contribute | 3002 |
edit | 3001 |
www | 3000 |
The semantic versioning of the monorepo is only updated when root dependencies are updated (for example, turborepo
), or potentially when major changes are made. To create a new version:
- Update
version
inpackage.json
. - Update
CHANGELOG.md
, moving all[Unreleased]
items into a new entry for the new version. - Commit the changes.
- Tag the commit with
@phylopic/v[M].[m].[p]
, where[M]
,[m]
, and[p]
are integers denoting the major version, minor version, and patch version, respectively. Example:@phylopic/v2.0.9
. Push the tag toorigin
.
Each subproject (app or package) has its own semantic versioning. To release a new version:
- Update
version
in the subproject'spackage.json
. - Update the subproject's
CHANGELOG.md
, moving all[Unreleased]
items into a new entry for the new version. - Commit the changes.
- Tag the commit with
@phylopic/[subproject]/v[M].[m].[p]
, where[subproject]
is the name of the project (for example,www
) and[M]
,[m]
, and[p]
are integers denoting the major version, minor version, and patch version, respectively. Example:@phylopic/www/v2.6.12
. Push the tag toorigin
. - For apps, publish the new version:
- For
api
orapi-docs
, runyarn deploy
. - For
contribute
, reset the@phylopic/contribute/prod
branch to the release's commit and push toorigin
. Deployment can be monitored in Vercel. - For
www
, reset the@phylopic/www/prod
branch to the release's commit and push toorigin
. Deployment can be monitored in Vercel. - No action is necessary for
edit
orpublish
, which are only run locally.
- For
To contribute to the development of PhyloPic, please read the guidelines in CONTRIBUTING.md
and contact Mike Keesey (keesey+phylopic@gmail.com
). The repository is open and may be forked, with pull requests made back into the original repository.