This repository has been archived by the owner on Aug 17, 2024. It is now read-only.
-
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.
Merge pull request #1 from ajktown/hello-world
Hello world
- Loading branch information
Showing
107 changed files
with
5,441 additions
and
492 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,7 @@ | ||
|
||
# scripts directory | ||
node_modules | ||
dist | ||
scripts | ||
.env | ||
.next |
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,37 @@ | ||
name: Bug | ||
description: Report a bug encountered while using the project | ||
labels: | ||
- bug | ||
body: | ||
- type: textarea | ||
id: background | ||
attributes: | ||
label: Background | ||
description: | | ||
What happened? | ||
Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: expected | ||
attributes: | ||
label: What did you expect to happen? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: repro | ||
attributes: | ||
label: How can we reproduce it (as minimally and precisely as possible)? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: todos | ||
attributes: | ||
label: TODOs | ||
value: | | ||
``` | ||
- [ ] TODO: Write your TODOs here | ||
``` |
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,23 @@ | ||
name: Dependency | ||
description: Update dependency versions for the project | ||
labels: | ||
- dependency | ||
body: | ||
- type: textarea | ||
id: background | ||
attributes: | ||
label: Background | ||
description: | | ||
What would you like to be refactored? | ||
Please provide as much info as possible | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: todos | ||
attributes: | ||
label: TODOs | ||
value: | | ||
``` | ||
- [ ] TODO: Write your TODOs here | ||
``` |
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,23 @@ | ||
name: Documentation | ||
description: Improve documentation for the project | ||
labels: | ||
- documentation | ||
body: | ||
- type: textarea | ||
id: background | ||
attributes: | ||
label: Background | ||
description: | | ||
What would you like to be documented? | ||
Please provide as much info as possible | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: todos | ||
attributes: | ||
label: TODOs | ||
value: | | ||
``` | ||
- [ ] TODO: Write your TODOs here | ||
``` |
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,23 @@ | ||
name: Enhancement Tracking Issue | ||
description: Provide supporting details for a feature in development | ||
labels: | ||
- enhancement | ||
body: | ||
- type: textarea | ||
id: background | ||
attributes: | ||
label: Background | ||
description: | | ||
Before explain the feature, please provide some background and lacking points. | ||
What is lacking? What is needed? Why is it needed? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: todos | ||
attributes: | ||
label: TODOs | ||
value: | | ||
``` | ||
- [ ] TODO: Write your TODOs here | ||
``` |
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,23 @@ | ||
name: Infrastructure | ||
description: Improve CI/CD for the project | ||
labels: | ||
- infra | ||
body: | ||
- type: textarea | ||
id: background | ||
attributes: | ||
label: Background | ||
description: | | ||
What would you like to be added for CI/CD? | ||
Please provide as much info as possible | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: todos | ||
attributes: | ||
label: TODOs | ||
value: | | ||
``` | ||
- [ ] TODO: Write your TODOs here | ||
``` |
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,23 @@ | ||
name: Performance | ||
description: Improve performance for the project | ||
labels: | ||
- performance | ||
body: | ||
- type: textarea | ||
id: background | ||
attributes: | ||
label: Background | ||
description: | | ||
What would you like to be changed for the improved performance? | ||
Please provide as much info as possible | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: todos | ||
attributes: | ||
label: TODOs | ||
value: | | ||
``` | ||
- [ ] TODO: Write your TODOs here | ||
``` |
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,23 @@ | ||
name: Refactor | ||
description: Refactor codes/structure for the project | ||
labels: | ||
- refactor | ||
body: | ||
- type: textarea | ||
id: background | ||
attributes: | ||
label: Background | ||
description: | | ||
What would you like to be refactored? | ||
Please provide as much info as possible | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: todos | ||
attributes: | ||
label: TODOs | ||
value: | | ||
``` | ||
- [ ] TODO: Write your TODOs here | ||
``` |
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,41 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ajktown | ||
password: ${{ secrets.AJKTOWN_ORG_ACTION }} | ||
|
||
- name: Build the Docker image for PR | ||
if: github.event_name == 'pull_request' | ||
run: docker build . --file Dockerfile --tag ajktown/golf:pr${{ github.event.pull_request.number }} | ||
|
||
- name: Push the Docker image for PR | ||
if: github.event_name == 'pull_request' | ||
run: docker push ajktown/golf:pr${{ github.event.pull_request.number }} | ||
|
||
- name: Build the Docker image as latest | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
run: docker build . --file Dockerfile --tag ajktown/golf:latest | ||
|
||
- name: Push the Docker image as latest | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
run: docker push ajktown/golf:latest |
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 @@ | ||
######## ! Build Stage ! ####### | ||
FROM node:18 AS build | ||
|
||
WORKDIR /app | ||
|
||
# Install app dependencies | ||
COPY package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Copy all files | ||
COPY . . | ||
|
||
# Delete .env.local file as FE itself is production ready | ||
RUN rm -f .env.local | ||
|
||
# Build the app | ||
RUN yarn build | ||
|
||
######## ! Production Stage ! ######## | ||
FROM node:18 | ||
|
||
WORKDIR /app | ||
|
||
# Copy only the production node modules from the build stage | ||
COPY --from=build /app/node_modules ./node_modules | ||
# Copy the built Next.js app | ||
COPY --from=build /app/.next ./.next | ||
COPY --from=build /app/public ./public | ||
COPY package.json yarn.lock ./ | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 3200 | ||
|
||
# Start the app | ||
CMD ["yarn", "start"] |
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
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,19 @@ | ||
/** | ||
* This file is a must for jest to compile your TS spec (test) data | ||
* into javascript file. To learn more, check out the documents below. | ||
* | ||
* https://jestjs.io/docs/getting-started#using-typescript | ||
* | ||
* This file was auto generated by the following command on Console | ||
* $ yarn test config:init | ||
*/ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
moduleNameMapper: { | ||
"^@/(.*)$": "<rootDir>/src/$1", | ||
}, | ||
}; | ||
|
||
// TODO: Somehow the moduleNameMapper new setting causes the problem of yarn test, where individual test passes no problem. |
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,4 +1,16 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
/** | ||
* === reactStrictMode === | ||
* If the value is true, then it will run the effect twice, this is only to figure out any | ||
* hooks used in a wrong sense. | ||
* Check the reference following: | ||
* https://stackoverflow.com/questions/71735407/why-my-custom-hook-is-executed-twice-when-i-use-it-once | ||
* === End === | ||
* | ||
*/ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
}; | ||
|
||
export default nextConfig; |
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.