https://github.com/acdh-oeaw/template-app-next
Template repository for Next.js apps
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.4%) to scientific vocabulary
Keywords
Repository
Template repository for Next.js apps
Basic Info
- Host: GitHub
- Owner: acdh-oeaw
- License: mit
- Language: TypeScript
- Default Branch: main
- Homepage: https://template-app-next.acdh-ch-dev.oeaw.ac.at
- Size: 27 MB
Statistics
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 7
- Releases: 0
Topics
Metadata Files
readme.md
app template
template repository for next.js apps.
how to run
prerequisites:
[!TIP]
you can use
pnpmto install the required node.js version withpnpm env use 22 --global
set required environment variables in .env.local:
bash
cp .env.local.example .env.local
also, set environment variables required by validation and
deployment github actions. use
"variables" for every
environment variable prefixed with NEXT_PUBLIC_, and
"secrets" for all others.
the default template accepts the following variables:
NEXT_PUBLIC_REDMINE_ID(required): service issue for this application in the acdh redmine issue tracker.NEXT_PUBLIC_APP_BASE_URL(required): the base url for this application. the default of "http://localhost:3000" should be fine for local development.NEXT_PUBLIC_IMPRINT_SERVICE_BASE_URL(required): the base url for the acdh imprint service, which usesNEXT_PUBLIC_REDMINE_IDto fetch the imprint text.NEXT_PUBLIC_BOTS(required): whether this website can be indexed by web crawlers like the google bot. supported values are "disabled" and "enabled", defaults to "disabled".NEXT_PUBLIC_MATOMO_BASE_URLandNEXT_PUBLIC_MATOMO_ID(optional): set these to support client-side analytics with matomo.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION(optional): set this to verify site ownership for google search console.ENV_VALIDATION(optional): whether to validate environment variables. supported values are "disabled", "enabled", and "public". defaults to "enabled". "public" only validates build-args prefixed withNEXT_PUBLIC_, which can make sense in a docker build context.
when adding new environment variables, don't forget to add them to
.env.local.example and config/env.config.ts as
well.
install dependencies:
bash
pnpm install
run a development server on http://localhost:3000:
bash
pnpm run dev
[!TIP]
this template supports developing in containers. when opening the project in your editor, you should be prompted to re-open it in a devcontainer.
how to test
generate a production build and run end-to-end tests with:
bash
pnpm run build
pnpm run test:e2e
visual snapshot tests should be run in the template's devcontainer - or a comparable debian bookworm based linux environment -, and can be updated with:
bash
pnpm run test:e2e:update-snapshots
how to deploy
- ask a sysadmin to create a new acdh kubernetes project.
- create a new namespace in that project via rancher, and set
the
KUBE_NAMESPACEgithub variable to that namespace - adjust the
app_name, which will be the name of the deployment in the above namespace. - set the
PUBLIC_URLgithub variable to the application's public url (e.g. "https://my-app.acdh-dev.oeaw.ac.at"), and set theKUBE_INGRESS_BASE_DOMAINto the public url's base domain (e.g. "acdh-dev.oeaw.ac.at").PUBLIC_URLshould matchNEXT_PUBLIC_APP_BASE_URL. - when deploying to a production domain (i.e. a domain not ending in "acdh-dev.oeaw.ac.at"), set
HELM_UPGRADE_EXTRA_ARGSto--set 'ingress.annotations.cert-manager\.io/cluster-issuer=acdh-prod'for "acdh.oeaw.ac.at" domains, or to--set 'ingress.annotations.cert-manager\.io/cluster-issuer=letsencrypt-prod'for any other non-oeaw domains, and ensureKUBE_INGRESS_BASE_DOMAINis set correctly. - if you haven't yet, create a service issue in the acdh redmine
issue tracker, and set the
SERVICE_IDgithub variable to the issue number. this should match theNEXT_PUBLIC_REDMINE_IDvariable in your.env.localfile. - ensure required build args (prefixed with
NEXT_PUBLIC_) are referenced in both theDockerfile, as well as the validation and deployment pipelines, and set as github variables. - ensure required runtime environment variables are referenced in the
validation and
deployment pipelines, and set as
github secrets. github
secrets need to be prefixed with
K8S_SECRET_to be automatically copied to the runtime environment. in case you need secrets in the docker build context, you can mount a secret in the Dockerfile. - ensure both the github repository, as well as the package registry is set to public.
- the
NEXT_PUBLIC_BOTSvariable defaults to "disabled", which signals to web crawlers that the website should not be indexed. when deploying to a production domain (i.e. a domain not ending in "acdh-dev.oeaw.ac.at") this should be set to "enabled".
if everything is set up correctly, every git push to the main branch will create a new deployment
if the validation pipeline passes.
you can reference the template repository for a working setup.
production deployment checklist
- [ ] update
PUBLIC_URL,KUBE_INGRESS_BASE_DOMAIN,HELM_UPGRADE_EXTRA_ARGSgithub variables. - [ ] get a matomo id for the app, and set both
NEXT_PUBLIC_MATOMO_BASE_URLandNEXT_PUBLIC_MATOMO_ID. - [ ] set
NEXT_PUBLIC_BOTSto "enabled". - [ ] ensure
app/sitemap.tsgenerates entries for dynamic pages. - [ ] optionally, create a google search console property, and provide the verification token as
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION. once verfied, submitsitemap.xmlin the search console settings. - [ ] when using the
variant/with-rss-feedbranch, ensureapp/[locale]/rss.xml/route.tsgenerates feed entries.
template variants
variant/with-authbranch: adds email and password authentication with database sessions, including email verification, password reset, and two-factor auth. usesdrizzleas orm.variant/with-commitlintbranch: enablescommitlintand runs it as a git hook, and as part of the validation workflow in a github action.variant/with-emailbranch: addsnodemailerfor sending emails, and an example contact form.variant/with-keystaticbranch: addskeystaticfor content management. allows editing.mdxand.jsonfiles, and pushes changes to github.variant/with-opentelemetrybranch: adds instrumentation to collect tracing information and send it to an opentelementry collector.variant/with-rss-feedbranch: adds an rss feed.variant/with-sentrybranch: enables error reporting withsentry.variant/with-single-localebranch: adjusts the template to support a single pre-configured locale only, and removes internationalised routing. ui strings are still managed in themessagesfolder to make it easy to activate full i18n support later if needed.variant/with-storybookbranch: addsstorybookfor building ui components in isolation and creating component documentation.variant/with-unit-testsbranch: adds vitest for unit testing.
Owner
- Name: Austrian Centre for Digital Humanities & Cultural Heritage
- Login: acdh-oeaw
- Kind: organization
- Email: acdh@oeaw.ac.at
- Location: Vienna, Austria
- Website: https://www.oeaw.ac.at/acdh
- Repositories: 476
- Profile: https://github.com/acdh-oeaw
GitHub Events
Total
- Issues event: 5
- Watch event: 1
- Delete event: 77
- Issue comment event: 5
- Push event: 746
- Pull request event: 148
- Fork event: 2
- Create event: 93
Last Year
- Issues event: 5
- Watch event: 1
- Delete event: 77
- Issue comment event: 5
- Push event: 746
- Pull request event: 148
- Fork event: 2
- Create event: 93
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Stefan Probst | s****t@p****e | 195 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 168
- Average time to close issues: about 6 hours
- Average time to close pull requests: 9 days
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 3.0
- Average comments per pull request: 0.03
- Merged pull requests: 103
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 168
- Average time to close issues: about 6 hours
- Average time to close pull requests: 9 days
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 3.0
- Average comments per pull request: 0.03
- Merged pull requests: 103
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- babslgam (1)
Pull Request Authors
- stefanprobst (163)
- kevinstadler (2)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v4 composite
- docker/build-push-action v5 composite
- docker/login-action v3 composite
- docker/metadata-action v5 composite
- docker/setup-buildx-action v3 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/setup-node v3 composite
- actions/upload-artifact v3 composite
- node 20-slim build
- @acdh-oeaw/commitlint-config ^1.0.0 development
- @acdh-oeaw/eslint-config ^1.0.4 development
- @acdh-oeaw/eslint-config-next ^1.0.7 development
- @acdh-oeaw/eslint-config-playwright ^1.0.4 development
- @acdh-oeaw/eslint-config-react ^1.0.5 development
- @acdh-oeaw/prettier-config ^1.0.1 development
- @acdh-oeaw/stylelint-config ^1.0.5 development
- @acdh-oeaw/tailwindcss-preset ^0.0.16 development
- @acdh-oeaw/tsconfig ^1.0.1 development
- @axe-core/playwright ^4.7.3 development
- @commitlint/cli ^17.7.2 development
- @mdx-js/loader ^2.3.0 development
- @next/eslint-plugin-next ^13.5.4 development
- @playwright/test ^1.38.1 development
- @types/mdx ^2.0.8 development
- @types/node ^20.8.2 development
- @types/react ^18.2.24 development
- @types/react-dom ^18.2.8 development
- ci-info ^3.8.0 development
- eslint ^8.50.0 development
- eslint-plugin-tailwindcss ^3.13.0 development
- is-ci ^3.0.1 development
- lint-staged ^14.0.1 development
- npm-run-all2 ^6.0.6 development
- postcss ^8.4.31 development
- prettier ^3.0.3 development
- simple-git-hooks ^2.9.0 development
- stylelint ^15.10.3 development
- tailwindcss ^3.3.3 development
- typescript ^5.2.2 development
- @acdh-oeaw/lib ^0.1.6
- @keystatic/core ^0.1.5
- @keystatic/next ^1.0.1
- @markdoc/markdoc ^0.3.2
- @markdoc/next.js ^0.3.3
- @next/bundle-analyzer ^13.5.4
- @next/mdx ^13.5.4
- @t3-oss/env-nextjs ^0.6.1
- cva ^1.0.0-beta.1
- lucide-react ^0.284.0
- next ^13.5.4
- next-intl ^3.0.0-rc.2
- next-themes ^0.2.1
- react ^18.2.0
- react-dom ^18.2.0
- react-schemaorg ^2.0.0
- remark-frontmatter ^5.0.0
- remark-gfm ^4.0.0
- remark-mdx-frontmatter ^3.0.0
- schema-dts ^1.1.2
- sharp ^0.32.6
- zod ^3.22.2
- 1112 dependencies