initial documentation for create and edit entries via user interface
Nowdatabase
NOW - New and Old Worlds - Database of fossil mammals
Rebuild of a fossil database application, old version at https://nowdatabase.luomus.fi/
The new version is not deployed yet.
Developer documentation
Basic commands 💻
npm run setup- Installs all node modules, and generates prisma client
npm run dev- Uses
docker-compose.dev.yml - Run in development mode: with hot reload
- Uses
Testing:
npm run check- Runs
tscandeslintfor frontend and backend: Use this to check for errors before committing.
- Runs
npm run test:api- Runs all required containers and api-tests with one command inside Docker.
- Uses
docker-compose.test.yml - Uses
test_data
npm run test:e2e- Runs all required containers and e2e-tests with one command inside Docker.
- Uses
docker-compose.test.yml - Uses
test_data
npm run test:up- Runs the test version of the project with anonymized test-database without tests.
- Uses
docker-compose.test.yml - Uses
test_data
npm run test:local:e2e- Runs cypress-tests locally in headless mode. Requires
npm run test:upto be running first.
- Runs cypress-tests locally in headless mode. Requires
npm run test:local:api- Runs backend api tests. Requires
db-anonto be running first. (Note: backend doesn't need to be running.) - All environment variables need to be set.
- Runs backend api tests. Requires
npm run cypress- Opens cypress. You can run tests and see what they do.
Coverage:
- Coverage opening
- Coverage can be opened by opening the
coverage/lcov-report/index.htmlwith your browser of choice.
- Coverage can be opened by opening the
coverage:sed- Fixes issues with
.nyc_outputpaths. Replaces the paths inside Docker to$PWD(current directory).
- Fixes issues with
coverage- First fixes paths with
coverage:sedand then recreatescoverage/lcov-reportto match the new path.
- First fixes paths with
coverage:report- Alias to
npm run coverage. Used by cypress e2e tests so thatcoverage:sedgets executed automatically.
- Alias to
Run with the same image that is used in production:
npm start- Uses
docker-compose.yml - This builds the code and runs it. Mostly you'll want to use this after major technical changes to check the code works also in production mode, before deploying. And then you'll likely want to do:
npm start -- --buildto force rebuild of containers.
- Uses
Further documentation
🚀 Initialize app & restore db How to get the app up & running, and initialize database from sql-dumps
🔧 Technical explanations Explanations of how things work, and guides for some more rare tasks like updating database-schema
🙌 Contributing & integration flow Where to commit? Where are tests run? How is the code deployed?
📝 Frontend Explanation of the frontend logic and how to add views
🔎 Validators The readme explains how validators are written
🔎 Class diagram See the relations of relevant tables. Notice that it omits some unimportant tables and does not show most columns.