Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .buildkite/pipeline-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
ECR_NAMESPACE: "${IMAGE_REPOSITORY}:${BUILDKITE_PIPELINE_SLUG}"

# Define service directory were the Dockerfile is used
DOCKERFILE_LOCATION: "./services/app"
DOCKERFILE_LOCATION: "./"
steps:
- label: ":hammer: :docker: Building Docker Image"
key: "build-image"
Expand All @@ -45,7 +45,7 @@ steps:
- *ecr
- seek-oss/aws-sm#v2.0.0:
file:
- path: services/app/.env
- path: .env
secret-id: [NEED THIS CONFIGURED]

# Wait for images to finish building.
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions .ddev/config.mutagen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mutagen_enabled: true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./services/app
working-directory: ./

strategy:
matrix:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./services/app
working-directory: ./

strategy:
matrix:
Expand Down
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem
.idea

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

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# TypeScript
tsconfig.tsbuildinfo

# Storybook build files
storybook-static/
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run test command in the app service.
cd services/app
# Run test command
npm test
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ git init
```shell
git remote add origin git@github.com:forumone/[project-name].git
```
4. Update configuration in the `./services/app/.ddev/config.yaml`
4. Update configuration in the `./.ddev/config.yaml`
5. Update `name: [project name]` to the correct project name.


Expand All @@ -42,15 +42,15 @@ git remote add origin git@github.com:forumone/[project-name].git
##### No

Please remove:
* `./services/app/.storybook`
* In the `./services/app/package.json`, remove
* `./.storybook`
* In the `./package.json`, remove
```
...
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
...
```
* Uninstall the storybook related packages as well in `services/app/package.json`
* Uninstall the storybook related packages as well in `package.json`
* Run `npm i --package-lock-only`

#### Do you need github action linting?
Expand All @@ -68,7 +68,7 @@ Please delete: `./github` folder.
...
- seek-oss/aws-sm#v2.0.0:
file:
- path: services/app/.env
- path: .env
secret-id: [NEED THIS CONFIGURED]
...
```
Expand Down
6 changes: 2 additions & 4 deletions services/app/README.md → README.nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Note that Next v11 comes with the following installed already:

## Getting Started

Ensure that you are using the proper Node version for this app. We currently use v16. Assuming you have [nvm](https://github.com/nvm-sh/nvm) installed locally, you can simply run:
Ensure that you are using the proper Node version for this app. We currently use v18. Assuming you have [nvm](https://github.com/nvm-sh/nvm) installed locally, you can simply run:

```bash
nvm use
Expand All @@ -35,7 +35,7 @@ npm run dev

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

To run [Storybook](https://storybook.js.org), open a new tab in your terminal, navigate to the `services/app` directory, and run:
To run [Storybook](https://storybook.js.org), open a new tab in your terminal, and run:

```bash
npm run storybook
Expand Down Expand Up @@ -122,6 +122,4 @@ Note that bypassing the Husky check is frowned upon.
## Notes

* Code for the app is currently configured to go into the `pages` directory (for [Next.js pages](https://nextjs.org/docs/basic-features/pages)) and `source` for theming, components, providers, helpers, etc.
* Starting in Next.js v9.4, TypeScript errors do not show up in your browser when running the dev server (i.e. `npm run dev`). However, TS errors will prevent `next build` (i.e. `npm run build`) from running successfully. Be sure to run `npm run lint` and `npm run tsc` before committing and pushing code. This will give you lint and TS errors that will most likely cause your builds to fail.
* For discussion: should we include a [TS checker in the config](https://github.com/vercel/next.js/issues/12735#issuecomment-629404102)? Note that a Next.js dev warns that [this will greatly slow development](https://github.com/vercel/next.js/issues/12735#issuecomment-629404842).
* The current favicon implementation will probably not display correctly locally in Chrome (v94), but does display correctly in Firefox and Safari. Note that the favicon _does_ display correctly once deployed. Not sure why.
28 changes: 11 additions & 17 deletions README.project.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,45 @@ Note that Next v13 comes with the following installed already:
* [Webpack v5](https://webpack.js.org/concepts/)
* [CSS Modules](https://github.com/css-modules/css-modules)

## Getting Started

## Initial Setup

1. Setup [husky](https://typicode.github.io/husky/#/) by installing it at the base of the repo.
1. Run [nvm](https://github.com/nvm-sh/nvm) so your local node version matches the project's node version:
```bash
npm ci
nvm use
```

2. Go to the `services/app` directory.
1. Install dependencies locally. This helps some IDEs using tools like IntelliSense to properly wireup packages to your app files,
or if you simply want to run `npm` commands outside of `ddev`.
View the `README.nextjs.md` file to see how to run commands outside of ddev.
```bash
cd services/app
npm ci
```

3. Install dependencies. To install and run the app without ddev, see the README inside the app directory.
1. Install dependencies for ddev.
You will need to install dependencies and run the app in the same environment (either Docker/Linux for both
or your local OS for both). Otherwise, you can end up with incompatible versions of some packages.
```bash
ddev nextjs npm ci
```

3. Start up the app. To do that, run `ddev start` from within the `services/app` directory:
1. Start up the app by running `ddev start`:
```bash
ddev start
```

## Starting and stopping the project

After following the "Initial Setup" instructions, you can start the local development server for the app by going to the `services/app` directory and running:
After following the "Initial Setup" instructions, you can start the local development server for the app by running:
```bash
ddev start
```
Open [https://YOUR-PROJECT.ddev.site/](https://YOUR-PROJECT.ddev.site/) with your browser to see the app. Note that the script will continue to run in your terminal tab. Killing or exiting the script (e.g. `ctrl+C`) will stop the Nextjs app.
Open [https://YOUR-PROJECT.ddev.site/](https://YOUR-PROJECT.ddev.site/) with your browser to see the app. If using storybook, use port `6006` by default to view it: [https://YOUR-PROJECT.ddev.site:6006](https://YOUR-PROJECT.ddev.site:6006).

To stop `ddev` for the project:
```bash
ddev stop
```

Note that these `ddev` commands _must_ be run in the `services/app` directory.

## Icons
After adding a new SVG to `source/01-global-icon/svgs`, you will need to
generate the React components:
Expand Down Expand Up @@ -166,9 +164,5 @@ If you would want to use `npm`, please do `ddev npm [package]`.

To verify that it is working please run: `ddev nextjs monit` and if it is not working as expected please try the following:
* Stop DDev, `ddev stop`
* Remove `node_modules` folder from the `services/app`
* Remove `node_modules`
* Then restart DDev, `ddev start`

### Helpful script

If you do not want to go into the `services/app` directory and want to stay at the root of the project, use `sh dev [ddev command]`.
4 changes: 2 additions & 2 deletions capistrano/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The name for the application, should only be things that can be in a directory name
set :application, 'NYU-CDHDB'
set :application, 'SOME-APP-NAME'

# The repo URL
set :repo_url, 'https://github.com/forumone/NYU-CDHDB'
set :repo_url, 'https://github.com/forumone/SOME-REPO-NAME'

# Or use the line below to deploy via rsync
set :scm, :rsync
Expand Down
8 changes: 4 additions & 4 deletions capistrano/deploy/dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set :stage, :dev

# An array containing site URL, used for Varnish bans
set :site_url, %w{dev.cdhdb.nyusom.byf1.dev}
set :site_url, %w{dev.SOME_SITE.byf1.dev}

# An array containing drupal sites to copy settings files in
set :site_folder, %w{default}
Expand All @@ -21,9 +21,9 @@
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
role :app, %w{cdhdb@nyusom.byf1.dev}, :primary => true
role :web, %w{cdhdb@nyusom.byf1.dev}
role :db, %w{cdhdb@nyusom.byf1.dev}
role :app, %w{SOME_USER@SOME_SITE.byf1.dev}, :primary => true
role :web, %w{SOME_USER@SOME_SITE.byf1.dev}
role :db, %w{SOME_USER@SOME_SITE.byf1.dev}

# Extended Server Syntax
# ======================
Expand Down
8 changes: 4 additions & 4 deletions capistrano/deploy/stage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set :stage, :stage

# An array containing site URL, used for Varnish bans
set :site_url, %w{stage.cdhdb.nyusom.byf1.dev}
set :site_url, %w{stage.SOME_SITE.byf1.dev}

# An array containing drupal sites to copy settings files in
set :site_folder, %w{default}
Expand All @@ -21,9 +21,9 @@
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
role :app, %w{cdhdb@nyusom.byf1.dev}, :primary => true
role :web, %w{cdhdb@nyusom.byf1.dev}
role :db, %w{cdhdb@nyusom.byf1.dev}
role :app, %w{SOME_USER@SOME_SITE.byf1.dev}, :primary => true
role :web, %w{SOME_USER@SOME_SITE.byf1.dev}
role :db, %w{SOME_USER@SOME_SITE.byf1.dev}

# Extended Server Syntax
# ======================
Expand Down
2 changes: 0 additions & 2 deletions dev

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading