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.
Yarn (v1.22 or higher) is required for this monorepo project. Node.js (v20 or higher) is also required for most apps.
Run yarn from the project root to install dependencies.
Running the scripts in the publish project requires additional prerequisites. See the documentation for details.
To clean up formatting for all source files in all projects, run:
yarn formatTo lint all source files and automatically fix certain issues:
yarn lintTo run unit tests in all projects that have them:
yarn testIf you are running against your own databases, you will need to set those up. PhyloPic uses Postgres databases. Scripts for creating them are listed in the sql documentation.
Certain apps require environment variables to be set before they can be run locally. See each app's documentation for details:
It may be easiest to focus on setting up a particular app and running it on its own. But, if you have them all set up, you can run them all locally at the same time with this command:
yarn devApps 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
versioninpackage.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
versionin 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
apiorapi-docs, runyarn deploy. - For
contribute, reset the@phylopic/contribute/prodbranch to the release's commit and push toorigin. Deployment can be monitored in Vercel. - For
www, reset the@phylopic/www/prodbranch to the release's commit and push toorigin. Deployment can be monitored in Vercel. - No action is necessary for
editorpublish, which are only run locally.
- For
To contribute to the development of PhyloPic, please read the guidelines in CONTRIBUTING.md and contact Mike Keesey ([email protected]). The repository is open and may be forked, with pull requests made back into the original repository.