Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin2Shih committed Oct 9, 2024
0 parents commit 19cd278
Show file tree
Hide file tree
Showing 61 changed files with 8,606 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"next",
"prettier"
],
"plugins": ["@typescript-eslint", "prettier", "unicorn", "lit-a11y"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"prettier/prettier": [
"error",
{
"bracketSpacing": true,
"tabWidth": 2,
"printWidth": 80,
"useTabs": false,
"trailingComma": "es5",
"endOfLine": "auto",
"semi": true,
"singleQuote": true
}
],
"lit-a11y/alt-text": [
2
],
"arrow-body-style": "off",
"prefer-arrow-callback": "off",
"max-lines-per-function": "off",
"react/no-unescaped-entities": "off",
"react/no-unknown-property": 2,
"jest/no-deprecated-functions": "off",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"react/require-default-props": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_*$",
"argsIgnorePattern": "^_*$",
"destructuredArrayIgnorePattern": "^_*$"
}
],
"@typescript-eslint/no-explicit-any": "off",
"block-spacing": 1
}
}
32 changes: 32 additions & 0 deletions .github/workflows/precheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Code Check

on:
pull_request:
branches:
- '*'

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
environment:
name: development
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v4
with:
node-version: '21.1.0'

- name: Install dependencies
run: npm install

- name: Build Next.js app
env:
MONGO_CONNECTION_STRING: ${{ secrets.MONGO_CONNECTION_STRING }}
run: npm run build

- name: Success
run: echo "🚧 Build successful 🚧"
38 changes: 38 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Production Deployment

on:
release:
types: [published]

jobs:
deploy_staging:
name: Deploy Production
runs-on: ubuntu-latest
environment:
name: production
url: ${{ vars.ENV_URL }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v4
with:
node-version: '21.1.0'

- name: Install dependencies
run: npm install

- name: Lint and build code, then publish to Vercel
run: >
vercel
--token ${{ secrets.VERCEL_TOKEN }}
-n ${{ vars.VERCEL_PROJECT }}
--yes
--prod
--env MONGO_CONNECTION_STRING=${{ secrets.MONGO_CONNECTION_STRING }}
--build-env MONGO_CONNECTION_STRING=${{ secrets.MONGO_CONNECTION_STRING }}
- name: Success
run: echo "🚀 Deploy successful 🚀 "
39 changes: 39 additions & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Staging Deployment

on:
push:
branches:
- 'main'

jobs:
deploy_staging:
name: Deploy Staging
runs-on: ubuntu-latest
environment:
name: staging
url: ${{ vars.ENV_URL }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v4
with:
node-version: '21.1.0'

- name: Install dependencies
run: npm install

- name: Lint and build code, then publish to Vercel
run: >
vercel
--token ${{ secrets.VERCEL_TOKEN }}
-n ${{ vars.VERCEL_PROJECT }}
--yes
--prod
--env MONGO_CONNECTION_STRING=${{ secrets.MONGO_CONNECTION_STRING }}
--build-env MONGO_CONNECTION_STRING=${{ secrets.MONGO_CONNECTION_STRING }}
- name: Success
run: echo "🛠️ Deploy successful 🛠️"
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

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

# testing
/coverage

# next.js
/.next/
/out/

# production
/build
/build-assets

# misc
.DS_Store
*.pem

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

# local env files
.env
.env*.local

# vercel
.vercel

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

#
/.vscode/

# Local Netlify folder
.netlify
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 #include at Davis

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 19cd278

Please sign in to comment.