{ "name": "nowdatabase", "version": "1.0.0", "description": "NOW - New and Old Worlds - Database of fossil mammals", "main": "index.js", "scripts": { "setup": "npm run install:all && npm run prisma && npm run config", "install:all": "npm i && cd backend && npm i && cd ../frontend && npm i && cd ..", "start": "docker compose -f docker-compose.yml up", "start:anon": "docker compose -f docker-compose.anon.yml up", "start:anon:api": "docker compose -f docker-compose.anon.yml up db-anon", "dev": "docker compose -f docker-compose.dev.yml up", "dev:down": "docker compose -f docker-compose.dev.yml down -v", "anon:down": "docker compose -f docker-compose.anon.yml down -v", "check": "echo \"Running checks for both services and cypress tests...\" && npm run check:frontend && npm run check:backend && npm run check:cypress && echo \"All good! :)\"", "check:backend": "echo \"Running backend tsc ...\" && cd backend && npx tsc --noEmit && echo \"Running backend eslint ...\"&& npm run lint", "check:frontend": "echo \"Running frontend tsc ...\" && cd frontend && npx tsc --noEmit && echo \"Running frontend eslint ...\" && npm run lint", "check:cypress": "echo \"Running cypress eslint ...\" && npm run lint:cypress", "lint:cypress": "eslint --report-unused-disable-directives --max-warnings 0 cypress/e2e/**.cy.js", "test:backend": "npm run test:unit:backend && npm run test:api", "test:api": "npm run test:api:build && npm run test:api:run", "test:api:build": "docker build -t nowdb-api-tests . -f backend/dev.Dockerfile --target api-tests", "test:api:run": "npm run test:api:run:base -- -it nowdb-api-tests", "test:api:run:base": "docker run --rm --network=host --user node --env-file .test.env --volume ./test_data:/usr/src/app/test_data", "test:api:windows": "npm run test:api:build && npm run test:api:run:windows", "test:api:run:windows": "docker run -it --rm --user node --env-file .test.env --volume ./test_data:/usr/src/app/test_data nowdb-api-tests", "test:api:local": "cd backend && npm run test:api:local", "test:e2e": "npm run test:e2e:base -- -it --entrypoint cypress cypress/included:13.15.0 run --browser chrome", "test:e2e:base": "docker run --network=host --user node -v $PWD:/e2e -w /e2e", "test:e2e:windows": "npm run test:e2e:base:windows -- -it --entrypoint cypress cypress/included:13.15.0 run --browser chrome", "test:e2e:base:windows": "docker run --user node -v $PWD:/e2e -w /e2e --env CYPRESS_baseUrl=http://host.docker.internal:5173 --env CYPRESS_databaseResetUrl=http://host.docker.internal:4000/test/reset-test-database", "test:e2e:local": "cypress run --browser chrome", "test:unit": "npm run test:unit:backend && npm run test:unit:frontend", "test:unit:backend": "cd backend && npm run test:unit", "test:unit:frontend": "cd frontend && npm run test", "test:ci:api": "npm run test:api:build && npm run test:api:run:base -- nowdb-api-tests", "test:ci:e2e": "npm run test:e2e:base -- --user 1001:1001 --entrypoint cypress cypress/included:13.15.0 run --browser chrome", "coverage": "npm run coverage:sed && npx nyc report --reporter=lcov", "coverage:sed": "sed -i -e \"s|/usr/src/app|$PWD/frontend|g\" .nyc_output/out.json", "coverage:report": "npm run coverage", "cypress": "cypress open", "prisma": "cd backend && npx prisma generate --schema prisma/schema.prisma && npx prisma generate --schema prisma/schema_log.prisma", "reset-anon-db": "docker exec -it nowdb-db-anon sh -c \"mariadb --user root -padmin now_test < /docker-entrypoint-initdb.d/sqlfiles/now_test.sql\" && docker exec -it nowdb-db-anon sh -c \"mariadb --user root -padmin now_log_test < /docker-entrypoint-initdb.d/sqlfiles/now_log_test.sql\"", "clean": "rm -rf node_modules && rm -rf coverage & rm -rf .nyc_output && rm -rf cypress/screenshots && rm -rf cypress/downloads && cd backend && npm run clean && cd ../frontend && npm run clean", "config": "npm run config:dev && npm run config:anon && npm run config:test", "config:test": "npm run config:test:base && npm run config:test:host && npm run config:test:coordinator && npm run config:geonames -- .test.env && npm run config:test:yaml && npm run config:test:quotes", "config:test:base": "cp -n .template.env .test.env", "config:test:host": "sed -i -e \"s|nowdb-db-dev|localhost|g\" .test.env", "config:test:yaml": "sed -i -e \"s|: |=|g\" .test.env", "config:test:coordinator": "sed -i -e \"s|IZ|TEST-SU|g\" .test.env", "config:test:quotes": "sed -i -e \"s|\\\"||g\" .test.env", "config:anon": "npm run config:anon:base && npm run config:anon:host && npm run config:anon:coordinator && npm run config:geonames -- .anon.env", "config:anon:base": "cp -n .template.env .anon.env", "config:anon:host": "sed -i -e \"s|nowdb-db-dev|nowdb-db-anon|g\" .anon.env", "config:anon:coordinator": "sed -i -e \"s|IZ|TEST-SU|g\" .anon.env", "config:dev": "cp -n .template.env .dev.env && npm run config:geonames -- .dev.env", "config:geonames": "sed -i -e \"s|GEONAMES_USERNAME: \\\"\\\"|GEONAMES_USERNAME: $GEONAMES_USERNAME|g\"" }, "author": "", "devDependencies": { "@cypress/code-coverage": "^3.13.2", "@eslint/js": "^9.14.0", "@types/leaflet": "^1.9.12", "cypress": "^13.11.0", "eslint": "^9.14.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-cypress": "^4.1.0", "eslint-plugin-mocha": "^10.5.0", "eslint-plugin-prettier": "^5.2.1", "globals": "^15.12.0", "prettier": "^3.3.3", "supertest": "^7.0.0" } }