For feature requests, please raise a GitHub issue. To propose a change:
- Feature branches must be made from dev branch ↓ See Development Process
Install the version of node.js specified in the engines.node field of the package.json. This should automatically install npm, but you can check if it's installed:
node --version && npm --versionThis will only show you the site with no data. You need to setup a local PostgreSQL Database, OR visit the main website to see the website's full functionality.
After cloning the repository locally:
npm install --ignore-scripts
npm run dev-
Install PostgreSQL
- Follow instructions per your system, use default parameters (NOTE: Do not change the default port of 5432)
- Note your postgres username and password. We recommend username: postgres, password: admin.
-
Create your database using either:
# In terminal: createdb <dbname> # Or in psql: CREATE DATABASE <dbname>;
-
To view all local databases in psql:
\l
- You need to create an environment file named .env.
- This file is required to configure environment variables for the application.
- See .env.template to see the required variables and their format.
- In the POSTGRES_PRISMA_URL variables, replace
<username>,<password>,<server>, and<dbname>with your own.
- First Time Setup (Fresh Install):
npx prisma generate # Creates Prisma Client based on your schema
npx prisma db push # Creates database tables based on schema- Schema Changes (Keep Data):
npx prisma db push # Updates database schema while preserving existing data
# Will fail if changes would cause data loss- Schema Changes (Can't Keep Data):
npx prisma db push --force-reset # Completely resets database, deleting all data
# Must reseed database from admin panel. If you need to be added as an admin, contact a maintainer
Important: To populate the local database, you must upload the files from ODE_testdata by navigating to the Submit tab on the website. Then, click Submit a Project.
Feature branches must be made from dev branch. Get latest from dev:
# If you don't have a dev branch yet locally:
git checkout -b dev origin/dev
# If you intend to make a change:
git checkout -b <featureBranchName>
git merge devInstall all node dependencies from package.json:
npm install --ignore-scriptsRun the local test server:
npm run devOpen the Prisma database view:
npx prisma studioPush schema changes to database:
npx prisma migrate dev --name "<insert migration name>" --create-onlyClear the database of all entries:
npx prisma db push --force-resetGenerate Prisma Client:
npm run generateOcean DNA Explorer is released under the Apache License, Version 2.0. See the LICENSE file for details.
