-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
9,505 additions
and
0 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,4 @@ | ||
{ | ||
"presets": ["next/babel"], | ||
"plugins": ["inline-react-svg"] | ||
} |
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,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,5 @@ | ||
/public/**/** | ||
/node_modules | ||
.husky | ||
.next | ||
.dist |
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,51 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
extends: [ | ||
'plugin:react/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'plugin:prettier/recommended', | ||
'plugin:@next/next/recommended', | ||
], | ||
plugins: ['react-hooks', 'unused-imports'], | ||
rules: { | ||
'no-console': 0, | ||
'import/named': 0, | ||
'import/order': 1, | ||
'import/no-default-export': 0, | ||
'@typescript-eslint/ban-types': 'warn', | ||
'@typescript-eslint/explicit-function-return-type': 0, | ||
'@typescript-eslint/explicit-module-boundary-types': 0, | ||
'@typescript-eslint/no-explicit-any': 0, | ||
'@typescript-eslint/no-unnecessary-type-constraint': 0, | ||
'@typescript-eslint/no-var-requires': 0, | ||
'@typescript-eslint/no-unused-vars': 0, | ||
'unused-imports/no-unused-imports': 2, | ||
'unused-imports/no-unused-vars': [ | ||
1, | ||
{ | ||
vars: 'all', | ||
varsIgnorePattern: '^_', | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
'react-hooks/rules-of-hooks': 2, | ||
'react-hooks/exhaustive-deps': 1, | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
'import/resolver': { | ||
typescript: {}, | ||
node: { | ||
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'], | ||
moduleDirectory: ['node_modules', 'src'], | ||
}, | ||
}, | ||
}, | ||
} |
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,49 @@ | ||
name: Deploy App To Production | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
jobs: | ||
deploy-production: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build | ||
run: npx [email protected] build | ||
|
||
- name: AWS credentials Setting | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Upload _next to AWS S3 | ||
run: | | ||
aws s3 cp .open-next/assets/_next/static/ "s3://${{ secrets.PRODUCTION_AWS_BUCKET }}/_next/static/" --acl bucket-owner-full-control --recursive --cache-control \'public,max-age=31536000,immutable\' --exclude ".git/*" | ||
- name: Upload assets to AWS S3 | ||
run: | | ||
aws s3 cp .open-next/assets/ "s3://${{ secrets.PRODUCTION_AWS_BUCKET }}" --acl bucket-owner-full-control --recursive --cache-control \'public,max-age=0,s-maxage=31536000,must-revalidate\' --exclude ".open-next/_next/static/*" --exclude ".git/*" | ||
- name: Packing of lambda function(server function) | ||
run: cd .open-next/server-function && zip -r -9 ../../server-function.zip . | ||
|
||
- name: Update lambda function(server function) | ||
run: aws lambda update-function-code --function-name ${{ secrets.PRODUCTION_AWS_LAMBDA_SERVER_FUNCTION }} --zip-file fileb://server-function.zip | ||
|
||
- name: Packing of lambda function(image optimization function) | ||
run: cd .open-next/image-optimization-function && zip -r -9 ../../image-optimization-function.zip . | ||
|
||
- name: Update lambda function(image optimization function) | ||
run: aws lambda update-function-code --function-name ${{ secrets.PRODUCTION_AWS_LAMBDA_IMAGE_OPTIMIZATION_FUNCTION }} --zip-file fileb://image-optimization-function.zip | ||
|
||
- name: Cache Invalidation | ||
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.PRODUCTION_AWS_DISTRIBUTION_ID }} --paths "/*" | ||
|
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,48 @@ | ||
name: Deploy App To Staging | ||
|
||
on: | ||
push: | ||
branches: ['stage'] | ||
|
||
jobs: | ||
deploy-staging: | ||
runs-on: ubuntu-latest | ||
environment: staging | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build | ||
run: npx [email protected] build | ||
|
||
- name: AWS credentials Setting | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Upload _next to AWS S3 | ||
run: | | ||
aws s3 cp .open-next/assets/_next/static/ "s3://${{ secrets.STAGING_AWS_BUCKET }}/_next/static/" --acl bucket-owner-full-control --recursive --cache-control \'public,max-age=31536000,immutable\' --exclude ".git/*" | ||
- name: Upload assets to AWS S3 | ||
run: | | ||
aws s3 cp .open-next/assets/ "s3://${{ secrets.STAGING_AWS_BUCKET }}" --acl bucket-owner-full-control --recursive --cache-control \'public,max-age=0,s-maxage=31536000,must-revalidate\' --exclude ".open-next/_next/static/*" --exclude ".git/*" | ||
- name: Packing of lambda function(server function) | ||
run: cd .open-next/server-function && zip -r -9 ../../server-function.zip . | ||
|
||
- name: Update lambda function(server function) | ||
run: aws lambda update-function-code --function-name ${{ secrets.STAGING_AWS_LAMBDA_SERVER_FUNCTION }} --zip-file fileb://server-function.zip | ||
|
||
- name: Packing of lambda function(image optimization function) | ||
run: cd .open-next/image-optimization-function && zip -r -9 ../../image-optimization-function.zip . | ||
|
||
- name: Update lambda function(image optimization function) | ||
run: aws lambda update-function-code --function-name ${{ secrets.STAGING_AWS_LAMBDA_IMAGE_OPTIMIZATION_FUNCTION }} --zip-file fileb://image-optimization-function.zip | ||
|
||
- name: Cache Invalidation | ||
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.STAGING_AWS_DISTRIBUTION_ID }} --paths "/*" |
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 @@ | ||
# 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 | ||
.yarn | ||
.DS_Store | ||
*.pem | ||
|
||
# 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 | ||
*.swp |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint |
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,7 @@ | ||
{ | ||
"trailingComma": "all", | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"endOfLine": "auto" | ||
} |
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,29 @@ | ||
{ | ||
"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": "pwa-chrome", | ||
"request": "launch", | ||
"url": "http://localhost:3000" | ||
}, | ||
{ | ||
"name": "Next.js: debug full stack", | ||
"type": "node-terminal", | ||
"request": "launch", | ||
"command": "npm run dev", | ||
"console": "integratedTerminal", | ||
"serverReadyAction": { | ||
"pattern": "started server on .+, url: (https?://.+)", | ||
"uriFormat": "%s", | ||
"action": "debugWithChrome" | ||
} | ||
} | ||
] | ||
} |
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,44 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/node_modules": true, | ||
"**/*.log": true, | ||
"**/.next": true, | ||
"**/.github": true, | ||
"**/.husky": true, | ||
"**/.yarn": true, | ||
"**/.babelrc": true, | ||
"**/.editorconfig": true, | ||
"**/.eslintignore": true, | ||
"**/.yarnrc.yml": true, | ||
"**/commitlint.config.js": true, | ||
"**/next-env.d.ts": true, | ||
"**/.vscode": true, | ||
"**/.gitignore": true, | ||
"tsconfig.json": true, | ||
".eslintrc.js": true, | ||
"build": true, | ||
"dist": true, | ||
"customHttp.yml": true, | ||
".prettierrc": true | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
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 @@ | ||
nodeLinker: node-modules |
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,35 @@ | ||
## Why use NextJS-Template? | ||
|
||
1. Nextjs | ||
|
||
2. `.github` | ||
|
||
2. `.husky` | ||
|
||
3. `.vscode` | ||
|
||
4. `.prettierrc` | ||
|
||
5. `.eslintrc` | ||
|
||
6. `Google analytics` [Need to configure `code`] | ||
|
||
7. `Alias path: @/*` | ||
|
||
8. `Webpack SVGR` | ||
|
||
9. `sentry` [Need to configure `SENTRY_DSN`] | ||
|
||
10. `<Toast />` and `<Table />` | ||
|
||
11. `robots.txt` && `sitemap.xml` | ||
|
||
12. `github workfolow` | ||
|
||
13. `favicon.svg` | ||
|
||
14. `404 page` | ||
|
||
15. `Mui Themes` | ||
|
||
16. `Web3 Wagmi/Viem/ConnectKit` |
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 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
} |
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,33 @@ | ||
customHeaders: | ||
- pattern: '/' | ||
headers: | ||
- key: 'Strict-Transport-Security' | ||
value: 'max-age=31536000; includeSubDomains' | ||
- key: 'X-Frame-Options' | ||
value: 'SAMEORIGIN' | ||
- key: 'Cache-Control' | ||
value: 'public, max-age=0, s-maxage=300, must-revalidate' | ||
- pattern: '/imgs/**/*' | ||
headers: | ||
- key: 'Strict-Transport-Security' | ||
value: 'max-age=31536000; includeSubDomains' | ||
- key: 'X-Frame-Options' | ||
value: 'SAMEORIGIN' | ||
- key: 'Cache-Control' | ||
value: 'public, max-age=30, s-maxage=300, stale-while-revalidate' | ||
- pattern: '/_next/static/**/*' | ||
headers: | ||
- key: 'Strict-Transport-Security' | ||
value: 'max-age=31536000; includeSubDomains' | ||
- key: 'X-Frame-Options' | ||
value: 'SAMEORIGIN' | ||
- key: 'Cache-Control' | ||
value: 'public, max-age=31536000, s-maxage=31536000, immutable' | ||
- pattern: '/favicon.svg' | ||
headers: | ||
- key: 'Strict-Transport-Security' | ||
value: 'max-age=31536000; includeSubDomains' | ||
- key: 'X-Frame-Options' | ||
value: 'SAMEORIGIN' | ||
- key: 'Cache-Control' | ||
value: 'public, max-age=300, s-maxage=86400, stale-while-revalidate' |
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,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
Oops, something went wrong.