Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from ajktown/hello-world
Browse files Browse the repository at this point in the history
Hello world
  • Loading branch information
mlajkim authored Jul 20, 2024
2 parents 02484d4 + 80d6a25 commit e56eca8
Show file tree
Hide file tree
Showing 107 changed files with 5,441 additions and 492 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# scripts directory
node_modules
dist
scripts
.env
.next
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yaml
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
```
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/dependency.yaml
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
```
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yaml
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
```
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.yaml
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
```
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/infrastructure.yaml
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
```
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/performance.yaml
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
```
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor.yaml
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
```
41 changes: 41 additions & 0 deletions .github/workflows/docker-image.yaml
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
35 changes: 35 additions & 0 deletions Dockerfile
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"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next
### Getting Started

#### Run api server
The Wordnote application depends on the ajktown-api server.
The Golf - AJK Town application depends on the ajktown-api server.
Please install it first. https://github.com/ajktown/api.


Expand Down
19 changes: 19 additions & 0 deletions jest.config.js
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.
14 changes: 13 additions & 1 deletion next.config.mjs
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;
20 changes: 19 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,41 @@
"latest": "yarn logDate && yarn upgrade --latest && yarn audit && yarn inspect",
"format": "prettier --ignore-path .gitignore \"src/**/*.+(ts|js|tsx)\" --write",
"logDate": "echo $(date +%y%m%d) > ./yarn-latest.record",
"test": "yarn jest",
"dev": "next dev -p 3200",
"build": "next build",
"start": "next start -p 3200",
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.12.0",
"@emotion/styled": "^11.12.0",
"@mui/icons-material": "^5.16.4",
"@mui/lab": "^5.0.0-alpha.172",
"@mui/material": "^5.16.4",
"@react-oauth/google": "^0.12.1",
"axios": "^1.7.2",
"deep-object-diff": "^1.1.9",
"iso-639-1": "^3.1.2",
"luxon": "^3.4.4",
"next": "14.2.5",
"prettier": "^3.3.3",
"react": "^18",
"react-dom": "^18"
"react-confetti": "^6.1.0",
"react-dom": "^18",
"react-use": "^17.5.0",
"recoil": "^0.7.7"
},
"devDependencies": {
"@types/luxon": "^3.4.2",
"@types/mocha": "^10.0.7",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.5",
"jest": "^29.7.0",
"ts-jest": "^29.2.3",
"typescript": "^5"
}
}
Loading

0 comments on commit e56eca8

Please sign in to comment.