Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer authored May 29, 2024
0 parents commit c6237c7
Show file tree
Hide file tree
Showing 45 changed files with 12,013 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

.git
.next
.results
scripts
*Dockerfile*
.dockerignore
npm-debug.log
README.md
LICENSE.md
LICENSES
node_modules
.env
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["next/core-web-vitals", "prettier"],
"plugins": ["prettier"],
"ignorePatterns": ["**/dist/*.js", "/docs/**", "/out/**"],
"rules": {
"prettier/prettier": "error"
}
}
6 changes: 6 additions & 0 deletions .eslintrc.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project

SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)

SPDX-License-Identifier: MIT
43 changes: 43 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Build and Test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
workflow_dispatch:
workflow_call:

jobs:
reuseaction:
name: REUSE Compliance Check
uses: StanfordBDHG/.github/.github/workflows/reuse.yml@v2
markdownlinkcheck:
name: Markdown Link Check
uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2
eslint:
name: ESLint
uses: StanfordBDHG/.github/.github/workflows/eslint.yml@v2
permissions:
contents: read
checks: write
testandcoverage:
name: Test and Coverage
uses: StanfordBDHG/.github/.github/workflows/npm-test-and-coverage.yml@v2
secrets:
token: ${{ secrets.CODECOV_TOKEN }}
dockercomposetest:
name: Docker Compose & Test
uses: StanfordBDHG/.github/.github/workflows/docker-compose-test.yml@v2
with:
dockerComposeFile: docker-compose-development.yml
testscript: test.sh
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: CodeQL

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 8 * * 1'

jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
permissions:
security-events: write
packages: read
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Deployment

on:
push:
branches:
- main
workflow_dispatch:

jobs:
buildandtest:
name: Build and Test
uses: ./.github/workflows/build-and-test.yml
permissions:
contents: read
checks: write
nextjsgithubpages:
name: Deploy Next.js site to GitHub Pages
needs: buildandtest
uses: StanfordBDHG/.github/.github/workflows/nextjs-github-pages.yml@v2
permissions:
contents: read
pages: write
id-token: write
dockerimage:
name: Docker Build and Push
uses: StanfordBDHG/.github/.github/workflows/docker-build-and-push.yml@v2
with:
imageName: stanfordbdhg/nextjstemplate
environment: package
permissions:
contents: read
packages: write
18 changes: 18 additions & 0 deletions .github/workflows/monthly-markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Monthly Markdown Link Check

on:
schedule:
- cron: "0 8 1 * *"

jobs:
markdown_link_check:
name: Markdown Link Check
uses: StanfordBDHG/.github/.github/workflows/markdown-link-check.yml@v2
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# lint
eslint_report.json

# docs
docs

# editors
.idea/
16 changes: 16 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
//
// SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
//
// SPDX-License-Identifier: MIT
//

const config = {
plugins: [require.resolve('prettier-plugin-tailwindcss')],
semi: false,
singleQuote: true,
experimentalTernaries: true,
}

module.exports = config
20 changes: 20 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

cff-version: 1.2.0
message: 'If you use this software, please cite it as below.'
authors:
- family-names: 'Schmiedmayer'
given-names: 'Paul'
orcid: 'https://orcid.org/0000-0002-8607-9148'
- family-names: 'Ravi'
given-names: 'Vishnu'
orcid: 'https://orcid.org/0000-0003-0359-1275'
title: 'NextJSTemplate'
doi: '10.5281/zenodo.10052055'
url: 'https://github.com/StanfordBDHG/NextJSTemplate'
14 changes: 14 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
SPDX-License-Identifier: MIT
-->

# Stanford Biodesign Digital Health Next.js Template Contributors

- [Paul Schmiedmayer](https://github.com/PSchmiedmayer)
- [Vishnu Ravi](https://github.com/vishnuravi)
67 changes: 67 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project
# Based on the docker file found at https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile.
#
# SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#


FROM node:18-alpine AS base

# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
COPY package.json package-lock.json ./
RUN npm ci


# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1

RUN npm run build

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 80

ENV PORT 80
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

CMD ["node", "server.js"]
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2023 Stanford University and the project authors (see CONTRIBUTORS.md)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 9 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2023 Stanford University and the project authors (see CONTRIBUTORS.md)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit c6237c7

Please sign in to comment.