{"id":21762738,"url":"https://github.com/nulib/dc-nextjs","last_synced_at":"2025-06-14T14:37:01.528Z","repository":{"id":37962457,"uuid":"423614338","full_name":"nulib/dc-nextjs","owner":"nulib","description":"Northwestern University Libraries Digital Collections built in Next.js","archived":false,"fork":false,"pushed_at":"2025-04-11T17:40:34.000Z","size":5350,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":11,"default_branch":"deploy/staging","last_synced_at":"2025-04-11T17:46:41.037Z","etag":null,"topics":["iiif","nextjs","radix-ui","react","stitches","typescript"],"latest_commit_sha":null,"homepage":"https://dc.library.northwestern.edu","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nulib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-01T20:58:29.000Z","updated_at":"2025-04-11T17:40:27.000Z","dependencies_parsed_at":"2023-12-13T18:26:52.904Z","dependency_job_id":"0c24df66-5720-4549-8e3a-00630cb25ffe","html_url":"https://github.com/nulib/dc-nextjs","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nulib%2Fdc-nextjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nulib%2Fdc-nextjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nulib%2Fdc-nextjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nulib%2Fdc-nextjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nulib","download_url":"https://codeload.github.com/nulib/dc-nextjs/tar.gz/refs/heads/deploy/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724450,"owners_count":21151557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iiif","nextjs","radix-ui","react","stitches","typescript"],"created_at":"2024-11-26T12:13:01.383Z","updated_at":"2025-06-14T14:37:01.504Z","avatar_url":"https://github.com/nulib.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digital Collections\n\nDigital Collections is a UI application for discovering and interacting with Collections and Works in NUL's repository.\n\n## Tech Stack\n\n- [NextJS](https://nextjs.org/) React JS fullstack framework\n- [TypeScript](https://www.typescriptlang.org/) for type safety\n- [Radix UI](https://www.radix-ui.com/) A library of React primitives for accessibility and modular development\n- [Stitches.dev](https://stitches.dev/) CSS in JS\n- [IIIF](https://iiif.io/) Research APIs and Specs our data conforms to for open access.\n- [AWS Amplify](https://aws.amazon.com/amplify/) Hosting environment\n- [OpenSearch](https://opensearch.org/) Search index\n\n### Dependency Notes\n\nThe following dependencies should be \"pinned\" or held behind `@latest` versions\n\n- `@elastic/elasticsearch`: To match the version of `OpenSearch` our app uses.\n- `swiper`\n- `@honeybadger-io/js`\n- `@iiif/presentation-3`\n\n## Development Environments\n\n### Local\n\nInstall dependencies and run a NextJS development server:\n\n```bash\nnpm install\nnpm run dev\n```\n\nOpen [http://local.dev.rdc.library.northwestern.edu:3000](http://local.dev.rdc.library.northwestern.edu:3000) in your browser.\n\n### AWS Developer Environment (Northwestern dev team only)\n\nOpen a remote SSH dev environment connection in VSCode.\n\n`cd` into the `dc-nextjs` repository\n\n1. Open a new terminal.\n\n2. Make sure port 3000 is open by running `sg show`. If you don't see port 3000, run `sg open all 3000`. View more in [AWS convenience scripts](https://github.com/nulib/aws-developer-environment#convenience-scripts).\n\n3. Temporarily change the following line in (`dc-nextjs/server.js`):\n\n```js\n// Change\nconst hostname = \"local.dev.rdc.library.northwestern.edu\";\n// ...to\nconst hostname = \"localhost\";\n```\n\nInstall dependencies\n\n```bash\nnpm install\nnpm run dev\n```\n\nAnd now open your AWS dev environment URL (Northwestern developers only).\n\n## Deploy Environments\n\n### Staging\n\nCommits (via merges) into the `deploy/staging` branch will trigger a build in AWS Amplify to the **staging** environment.\n\nhttps://dc.rdc-staging.library.northwestern.edu/\n\nCommits prefaced with `preview/branch-name-here` will deploy to a preview branch. The URL will be available within AWS Amplify. This is useful for sharing the feature with staff/users as a preview before committing to staging.\n\n### Production\n\nCommits (via merges) into the `main` branch will trigger a build in AWS Amplify to the **production** environment.\n\nhttps://dc.library.northwestern.edu/\n\n## Data fetching / APIs\n\nThe application makes network requests against the [DC API v2](https://github.com/nulib/dc-api-v2) to access repository data. By default, all metadata is returned in the application. Authenticated content's media (image/audio/video) will be protected and obscured from public access.\n\nBehind the scenes, DC API v2 is using OpenSearch `v 1.2` or Elasticsearch `v 7.17`. (For documentation references). Network request urls with `?as=iiif` will return data in the shape of a [IIIF](https://iiif.io/) manifest.\n\n### Viewing the Index (OpenSearch) directly\n\nOpenSearch's data can be accessed directly via [Kibana](https://www.elastic.co/kibana/) by executing the following commands:\n\n```bash\nexport AWS_PROFILE=staging\naws-adfs login --profile $AWS_PROFILE\nes-proxy\n```\n\nThe API supports both POST for searching and GET for Work and Collection items.\n\n### Environment variables\n\nThe API endpoint is an environment variable which is accessed in a local dev environment via the `miscellany` Git repo.\n\n## Code Quality\n\n### Prettier\n\nThere are no pre-commit hooks, however deploy CI will run a Prettier check on all files to ensure code quality. It's recommended to:\n\n- Install the [Prettier VSCode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)\n- Enable the \"Format on Save\" setting in VSCode\n- Manually validate and/or fix, by running Prettier locally using the following commands:\n\n```bash\nnpm run prettier:check # Check for formatting issues\nnpm run prettier:fix # Fix formatting issues\n```\n\n### ESLint\n\nThe app uses ESLint with a plugin for TypeScript support. Note currently with NextJS `v14`, this command won't run due to a dependency issue with ESLint `v9` support. Hopefully resolved by NextJS soon.\n\n```bash\nnpm run lint\n```\n\n### Typechecking\n\nRun Typescript's `tsc` compiler for type-checking directly.\n\n```bash\nnpm run ts-lint\n```\n\n## Testing\n\n### End to end tests\n\nTest fixtures can be accessed by pointing the app to a [Test Environment API](https://github.com/nulib/dc-test-environment).\n\n_Note: Only currently supported in local dev environments. Tests are flaky due to network requests in Github Actions CI env._\n\n```bash\nNEXT_PUBLIC_DCAPI_ENDPOINT=\"https://dc-test-api.rdc-staging.library.northwestern.edu/api/v2\"\n```\n\n```bash\n# Start local server (automatically points NEXT_PUBLIC_DCAPI_ENDPOINT to the test data API)\nnpm run dev:playwright\n\n# If in AWS Dev Environment, set a BASE_URL environment variable in a .env.local file\nBASE_URL=\"[YOUR_DEV_ID].dev.rdc.library.northwestern.edu\"\n\n# Start Playwright tests in headless mode\nnpm run test:playwright\n```\n\nTo run visual tests or debug errors, try experimenting with:\n\n```bash\n# Run in an interactive test browser to visually see tests run\nnpx playwright test --ui\n\n# Run all tests in headed mode\nnpx playwright test --headed\n```\n\nFor more info, view the docs: [Playwright](https://playwright.dev/).\n\n### Unit tests\n\nUnit tests use Jest and Testing Library React. Convention is to write tests alongside their respective components:\n\n```\n# Sample directory\n/components/search/Search.tsx\n/components/search/Search.test.tsx\n...\n```\n\nTo run [Jest](https://jestjs.io/) w/ [React Testing-Library](https://testing-library.com/docs/react-testing-library/intro/) support, run:\n\n```bash\nnpm run test\n```\n\n## Optimizations\n\n`npm run analyze` will run the [Next Bundle Analyzer](https://github.com/vercel/next.js/tree/canary/packages/next-bundle-analyzer) to show snapshots of the app's bundled JS.\n\n## Design\n\n### Icons\n\nManually sourced from [Iconicons](https://ionic.io/ionicons) and locally created in `components/Shared/SVG/Icons.tsx`, as opposed to including the entire NPM package direct.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnulib%2Fdc-nextjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnulib%2Fdc-nextjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnulib%2Fdc-nextjs/lists"}