From 59a8dd4aae923bb55bc780a25fd1db1d71e4ac7f Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sun, 29 Oct 2023 13:43:44 -0700 Subject: [PATCH 1/4] Rename Template --- .dockerignore | 2 +- .eslintrc.json.license | 2 +- .github/workflows/build-and-test.yml | 2 +- .github/workflows/main.yml | 4 ++-- .gitignore | 2 +- .prettierrc.license | 2 +- CITATION.cff | 6 +++--- CONTRIBUTORS.md | 4 ++-- Dockerfile | 2 +- README.md | 18 +++++++++--------- app/favicon.ico.license | 2 +- app/globals.css | 2 +- app/layout.tsx | 6 +++--- app/page.test.tsx | 6 +++--- app/page.tsx | 2 +- docker-compose-development.yml | 12 ++++++------ docker-compose.yml | 10 +++++----- jest.config.js | 2 +- next.config.js | 2 +- package-lock.json | 4 ++-- package-lock.json.license | 2 +- package.json | 6 +++--- package.json.license | 2 +- packages/example-package/.gitignore | 2 +- packages/example-package/README.md | 2 +- packages/example-package/package.json.license | 2 +- packages/example-package/src/index.ts | 4 ++-- packages/example-package/tsconfig.json.license | 2 +- postcss.config.js | 2 +- public/stanfordbiodesign.png.license | 2 +- test.sh | 2 +- tsconfig.jest.json.license | 2 +- tsconfig.json | 2 +- tsconfig.json.license | 2 +- 34 files changed, 63 insertions(+), 63 deletions(-) diff --git a/.dockerignore b/.dockerignore index 8688df7..6492e7b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# 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) # diff --git a/.eslintrc.json.license b/.eslintrc.json.license index 74064d4..dc192b8 100644 --- a/.eslintrc.json.license +++ b/.eslintrc.json.license @@ -1,5 +1,5 @@ -This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +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) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7456380..0db229b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# 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) # diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6932d2c..aeca39f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# 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) # @@ -26,4 +26,4 @@ jobs: name: Docker Build and Push uses: StanfordBDHG/.github/.github/workflows/docker-build-and-push.yml@v2 with: - imageName: stanfordbdhg/typescripttemplate + imageName: stanfordbdhg/nextjstemplate diff --git a/.gitignore b/.gitignore index 76fafae..a976600 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# 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) # diff --git a/.prettierrc.license b/.prettierrc.license index 74064d4..dc192b8 100644 --- a/.prettierrc.license +++ b/.prettierrc.license @@ -1,5 +1,5 @@ -This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +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) diff --git a/CITATION.cff b/CITATION.cff index 607b61d..b8fa0ca 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# 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) # @@ -12,5 +12,5 @@ authors: - family-names: 'Schmiedmayer' given-names: 'Paul' orcid: 'https://orcid.org/0000-0002-8607-9148' -title: 'TypeScriptTemplate' -url: 'https://github.com/StanfordBDHG/TypeScriptTemplate' +title: 'NextJSTemplate' +url: 'https://github.com/StanfordBDHG/NextJSTemplate' diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d39eba9..6fbee2c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,6 +1,6 @@ -# Stanford Biodesign Digital Health TypeScript Template Contributors +# Stanford Biodesign Digital Health Next.js Template Contributors - [Paul Schmiedmayer](https://github.com/PSchmiedmayer) diff --git a/Dockerfile b/Dockerfile index f3101c8..0eb4dc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# 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) diff --git a/README.md b/README.md index a65dca2..71c65fc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# TypeScript Template +# Biodesign Digital Health Next.js Template -[![Build and Test](https://github.com/StanfordBDHG/TypeScriptTemplate/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordBDHG/TypeScriptTemplate/actions/workflows/build-and-test.yml) -[![Deployment](https://github.com/StanfordBDHG/TypeScriptTemplate/actions/workflows/main.yml/badge.svg)](https://github.com/StanfordBDHG/TypeScriptTemplate/actions/workflows/main.yml) -[![codecov](https://codecov.io/gh/StanfordBDHG/TypeScriptTemplate/graph/badge.svg?token=dfQW5eZ2up)](https://codecov.io/gh/StanfordBDHG/TypeScriptTemplate) +[![Build and Test](https://github.com/StanfordBDHG/NextJSTemplate/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordBDHG/NextJSTemplate/actions/workflows/build-and-test.yml) +[![Deployment](https://github.com/StanfordBDHG/NextJSTemplate/actions/workflows/main.yml/badge.svg)](https://github.com/StanfordBDHG/NextJSTemplate/actions/workflows/main.yml) +[![codecov](https://codecov.io/gh/StanfordBDHG/NextJSTemplate/graph/badge.svg?token=dfQW5eZ2up)](https://codecov.io/gh/StanfordBDHG/NextJSTemplate) ## How To Use This Template -The template repository contains a template for a Next.js project providing automated GitHub Actions and setups for code linting, testing & test coverage reports, docker deployments, a docker compose setup, local packages for modular deployment, and documentation generation and deployment. +The template repository contains a template for a Next.js project providing automated GitHub Actions and setups for code linting, testing & test coverage reports, docker deployments, a docker compose setup, local packages for modular deployment, and documentation generation & deployment. Follow these steps to customize it to your needs: -1. Rename the NextJS project. +1. Rename the Next.js project. 2. Modify, add, or remove the local packages found at `/packages/*` to separate code into smaller modules. 3. Add dependencies and edit the project in `/app` and the local Node packages. -The main application is automatically deployed to https://stanfordbdhg.github.io/TypeScriptTemplate/. +The main application is automatically deployed to https://stanfordbdhg.github.io/NextJSTemplate/. -The documentation of the local packages is automatically deployed to https://stanfordbdhg.github.io/TypeScriptTemplate/docs. +The documentation of the local packages is automatically deployed to https://stanfordbdhg.github.io/NextJSTemplate/docs. ## Getting Started diff --git a/app/favicon.ico.license b/app/favicon.ico.license index 74064d4..dc192b8 100644 --- a/app/favicon.ico.license +++ b/app/favicon.ico.license @@ -1,5 +1,5 @@ -This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +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) diff --git a/app/globals.css b/app/globals.css index a690140..8493710 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,6 +1,6 @@ /* -This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +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) diff --git a/app/layout.tsx b/app/layout.tsx index 2e8794c..0498213 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,5 @@ // -// This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +// 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) // @@ -11,8 +11,8 @@ import type { ReactNode } from 'react' import './globals.css' export const metadata: Metadata = { - title: 'TypeScript Template', - description: 'Stanford Biodesign Digital Health TypeScript Template', + title: 'Next.js Template', + description: 'Stanford Biodesign Digital Health Next.js Template', } interface RootLayoutProps { diff --git a/app/page.test.tsx b/app/page.test.tsx index 2e21c7b..c41e1a4 100644 --- a/app/page.test.tsx +++ b/app/page.test.tsx @@ -1,5 +1,5 @@ // -// This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +// 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) // @@ -12,11 +12,11 @@ import '@testing-library/jest-dom' import Home from './page' describe('Home Component', () => { - it('renders the Stanford Biodesign Digital Health TypeScript Template heading', () => { + it('renders the Stanford Biodesign Digital Health Next.js Template heading', () => { const { getByText } = render() const headingElement = getByText( - /Welcome to the Stanford Biodesign Digital Health TypeScript Template/i, + /Welcome to the Stanford Biodesign Digital Health Next.js Template/i, ) expect(headingElement).toBeInTheDocument() diff --git a/app/page.tsx b/app/page.tsx index 087963a..953d2a3 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,5 @@ // -// This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +// 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) // diff --git a/docker-compose-development.yml b/docker-compose-development.yml index 3cc1259..2205115 100644 --- a/docker-compose-development.yml +++ b/docker-compose-development.yml @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project # Based on the Apodini workflow found at: https://github.com/Apodini/ApodiniExample/docker-compose-development.yml # # SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md) @@ -10,10 +10,10 @@ version: '3.9' services: - # An TypeScript Template - stanford-bdhg-typescript-template: - container_name: 'stanford-bdhg-typescript-template' - image: 'stanfordbdgh/typescripttemplate:dev' + # An Next.js Template + stanford-bdhg-nextjs-template: + container_name: 'stanford-bdhg-nextjs-template' + image: 'stanfordbdgh/nextjstemplate:dev' build: context: ./ dockerfile: ./Dockerfile @@ -47,7 +47,7 @@ services: # 8080 on the container is mapped to 8080 on the server/VM/your Machine. # Port 8080 is where the api traefik dashboard is located - '8080:8080' - # Port 80 is where our stanford-bdhg-typescript-template is running + # Port 80 is where our stanford-bdhg-nextjs-template is running - '80:80' # Traefik needs the docker.sock to detect new docker container volumes: diff --git a/docker-compose.yml b/docker-compose.yml index d921578..8c9f0c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# This source file is part of the Stanford Biodesign Digital Health Next.js Template open-source project # Based on the Apodini workflow found at: https://github.com/Apodini/ApodiniExample/docker-compose.yml # # SPDX-FileCopyrightText: 2023 Stanford University and the project authors (see CONTRIBUTORS.md) @@ -10,10 +10,10 @@ version: '3.9' services: - # An TypeScript Template - stanford-bdhg-typescript-template: - container_name: 'stanford-bdhg-typescript-template' - image: 'ghcr.io/stanfordbdhg/typescripttemplate:latest' + # An Next.js Template + stanford-bdhg-nextjs-template: + container_name: 'stanford-bdhg-nextjs-template' + image: 'ghcr.io/stanfordbdhg/nextjstemplate:latest' expose: - '80' command: ['node', 'server.js'] diff --git a/jest.config.js b/jest.config.js index 1481608..e828062 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ // -// This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +// 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) // diff --git a/next.config.js b/next.config.js index bd1f113..480815e 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,5 @@ // -// This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +// 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) // diff --git a/package-lock.json b/package-lock.json index 4bd2a5c..beafde7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "typescripttemplate", + "name": "nextjstemplate", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "typescripttemplate", + "name": "nextjstemplate", "version": "0.1.0", "license": "MIT", "dependencies": { diff --git a/package-lock.json.license b/package-lock.json.license index 74064d4..dc192b8 100644 --- a/package-lock.json.license +++ b/package-lock.json.license @@ -1,5 +1,5 @@ -This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +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) diff --git a/package.json b/package.json index 6e7eb39..38c6eab 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "typescripttemplate", + "name": "nextjstemplate", "version": "0.1.0", "license": "MIT", - "description": "Stanford Biodesign Digital Health TypeScript Template", + "description": "Stanford Biodesign Digital Health Next.js Template", "keywords": [ "Stanford", "Biodesign" ], "repository": { "type": "git", - "url": "https://github.com/StanfordBDHG/TypeScriptTemplate" + "url": "https://github.com/StanfordBDHG/NextJSTemplate" }, "private": true, "scripts": { diff --git a/package.json.license b/package.json.license index 74064d4..dc192b8 100644 --- a/package.json.license +++ b/package.json.license @@ -1,5 +1,5 @@ -This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +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) diff --git a/packages/example-package/.gitignore b/packages/example-package/.gitignore index 57d8537..b23dada 100644 --- a/packages/example-package/.gitignore +++ b/packages/example-package/.gitignore @@ -1,5 +1,5 @@ # -# This source file is part of the Stanford Biodesign Digital Health TypeScript Template open-source project +# 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) # diff --git a/packages/example-package/README.md b/packages/example-package/README.md index 5406fcf..bd58f61 100644 --- a/packages/example-package/README.md +++ b/packages/example-package/README.md @@ -1,6 +1,6 @@ You can edit the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. @@ -55,7 +55,7 @@ You can edit the page by modifying `app/page.tsx`. The page auto-updates as you You can view your images created with `docker images`. -Open [http://localhost](http://localhost) with your browser to see the result. You can visit [http://localhost:8080](http://localhost:8080) to see the reverse proxy setup before the main application. +Open [http://localhost](http://localhost) with your browser to see the result. You can visit [http://localhost:8080](http://localhost:8080) to see the reverse proxy setup before the main application. The `docker-compose.yml` setup contains a production-ready setup using a reverse proxy.