-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Set up project structure, auth, and database (#1)
- Loading branch information
1 parent
0fdd998
commit 967e593
Showing
40 changed files
with
2,333 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: [ | ||
"next/core-web-vitals", | ||
"next/typescript", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/stylistic", | ||
"plugin:prettier/recommended", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint", "prettier"], | ||
root: true, | ||
rules: { | ||
"prettier/prettier": "warn", | ||
"@typescript-eslint/consistent-type-definitions": ["error", "type"], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: pr-check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
# default types | ||
- opened | ||
- reopened | ||
- synchronize | ||
# run when PR title or body changes | ||
- edited | ||
branches: | ||
- main | ||
jobs: | ||
lint-and-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: latest | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "latest" | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Enforce linting rules | ||
run: pnpm run lint | ||
|
||
- name: Enforce formatting rules | ||
run: pnpm run check-format | ||
|
||
- name: Check that PR title follows conventional commits using regex | ||
env: | ||
TITLE: ${{ github.event.pull_request.title }} | ||
run: | | ||
echo "Your PR title is '$TITLE'" | ||
regex="(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z[[:space:]]+\))?:[[:space:]].+" | ||
if [[ $TITLE =~ $regex ]]; then | ||
echo "PR title follows conventional commits" | ||
else | ||
echo "PR title does not follow conventional commits format" | ||
echo "Prefix your PR title with a descriptor such as 'feat:' and then summarize your change" | ||
echo "See the following link for more information: https://www.conventionalcommits.org/en/v1.0.0/" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Next.js: debug server-side", | ||
"type": "node-terminal", | ||
"request": "launch", | ||
"command": "npm run dev" | ||
}, | ||
{ | ||
"name": "Next.js: debug client-side", | ||
"type": "chrome", | ||
"request": "launch", | ||
"url": "http://localhost:3000" | ||
}, | ||
{ | ||
"name": "Next.js: debug full stack", | ||
"type": "node", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/node_modules/.bin/next", | ||
"runtimeArgs": [ | ||
"--inspect" | ||
], | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"serverReadyAction": { | ||
"action": "debugWithEdge", | ||
"killOnServerStop": true, | ||
"pattern": "- Local:.+(https?://.+)", | ||
"uriFormat": "%s", | ||
"webRoot": "${workspaceFolder}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,78 @@ | ||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). | ||
# St. Christopher Truckers Relief Fund (SCF) | ||
|
||
## Description | ||
|
||
SCF is a non-profit that has multiple programs that promote the health and well-being of truckers. | ||
|
||
They have multiple intake forms, with some on their website and some on Google Forms. Each program is managed either through an Excel spreadsheet or a database. | ||
|
||
The goal is to consolidate all of the programs into one intake form and create admin and user dashboards. | ||
|
||
Please read the Product Requirement Document here: (insert link later) | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
### Prerequisites | ||
|
||
Please have the following installed on your machine: | ||
|
||
- Node.js | ||
- PNPM | ||
- MongoDB Compass | ||
- VSCode | ||
|
||
Please have the following VSCode extensions installed: | ||
|
||
- Prettier | ||
- ESLint | ||
- Code Spell Checker | ||
- markdownlint | ||
|
||
### Environment Variables | ||
|
||
Create a `.env.local` file in the root directory of the project and add the following variables: | ||
|
||
```text | ||
MONGODB_URI=mongodb+srv://<username>:<password>@scf-cluster.ukm7k.mongodb.net/scf-test?retryWrites=true&w=majority&appName=SCF-Cluster | ||
NEXTAUTH_URL=http://localhost:3000/ | ||
NEXTAUTH_SECRET= | ||
``` | ||
|
||
Please contact leadership to obtain the database credentials and the NEXTAUTH_SECRET. | ||
|
||
### Running the App | ||
|
||
1. Run `pnpm install` to install the dependencies. | ||
2. Run `pnpm run dev` to start the development server. | ||
|
||
### Contributing | ||
|
||
Branch protections are enabled on this repository. | ||
To contribute, please create a new branch and make a pull request. | ||
|
||
Your pull request title must follow the conventional commits specification. An example of a valid pull request title is: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
```text | ||
feat: Add pending form submissions table | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
Your PR must pass linting, formatting, and PR title checks before it can be merged. | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
The `pnpm run lint` command can be used to check for linting errors. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. | ||
The `pnpm run check-format` command can be used to check for formatting errors. | ||
|
||
## Learn More | ||
The `pnpm run format` command can be used to fix formatting errors. | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
### Testing | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
For your convenience, there are many tools available to test out components, actions, etc. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! | ||
`/test/client/page.tsx` is a page that can be accessed at `/test/client` and is used to test out client-side components. | ||
|
||
## Deploy on Vercel | ||
`/test/server/page.tsx` is a page that can be accessed at `/test/server` and is used to test out server-side components. | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
`/test/account/page.tsx` is a page that can be accessed at `/test/account` and is used to make test accounts. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. | ||
The `.vscode/launch.json` file is configured to run Next.js in debug mode. This can let you step through your code line by line and inspect variables. | ||
To start debug mode, navigate to the `Run and Debug` tab in VSCode, select the mode, and click the green play button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.