Skip to content

Commit

Permalink
Merge pull request #516 from woowacourse-teams/develop
Browse files Browse the repository at this point in the history
Release: v2.0.0
  • Loading branch information
wonyongChoi05 authored Oct 19, 2023
2 parents 9b78a2f + c19ecfc commit 2f73f90
Show file tree
Hide file tree
Showing 248 changed files with 5,855 additions and 2,683 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/frontend-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Frontend Deploy to Dev

on:
push:
branches: [develop]
paths: frontend/**
branches:
- develop
paths:
- frontend/**
- .github/**

jobs:
build-dockerfile:
Expand All @@ -18,8 +21,24 @@ jobs:
with:
node-version: '18.x'

- name: Cache Yarn global cache
uses: actions/cache@v3
with:
path: '**/.yarn'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache Yarn project cache
uses: actions/cache@v3
with:
path: '**/.yarn/cache'
key: ${{ runner.os }}-yarn-project-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-project-
- name: Install dependencies
run: yarn
run: yarn install --immutable

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down
25 changes: 22 additions & 3 deletions .github/workflows/frontend-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Frontend Deploy to Prod

on:
push:
branches: [main]
paths: frontend/**
branches:
- main
paths:
- frontend/**
- .github/**

jobs:
build-dockerfile:
Expand All @@ -18,8 +21,24 @@ jobs:
with:
node-version: '18.x'

- name: Cache Yarn global cache
uses: actions/cache@v3
with:
path: '**/.yarn'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache Yarn project cache
uses: actions/cache@v3
with:
path: '**/.yarn/cache'
key: ${{ runner.os }}-yarn-project-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-project-
- name: Install dependencies
run: yarn
run: yarn install --immutable

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/frontend-storybook-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Frontend Storybook Deploy To S3

on:
push:
branches:
- develop
paths:
- frontend/**
- .github/**

jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./frontend
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

steps:
- name: Use repository source
uses: actions/checkout@v3

- name: Use node.js
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Cache Yarn global cache
uses: actions/cache@v3
with:
path: '**/.yarn'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache Yarn project cache
uses: actions/cache@v3
with:
path: '**/.yarn/cache'
key: ${{ runner.os }}-yarn-project-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-project-
- name: Install dependencies
run: yarn install --immutable

- name: Build Storybook
run: yarn build:sb

- name: Upload storybook build files to temp artifact
uses: actions/upload-artifact@v3
with:
name: Storybook
path: frontend/storybook-static
deploy:
needs: build
runs-on: front-dev-server
steps:
- name: Remove previous version app
working-directory: .
run: rm -rf frontend/storybook

- name: Download the built file to AWS EC2
uses: actions/download-artifact@v3
with:
name: Storybook
path: frontend/storybook

- name: Upload to S3
run: |
aws s3 sync frontend/storybook s3://2023-team-project/2023-zipgo/storybook --delete
49 changes: 39 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
# 2023-zipgo
<p align="center">
<img src="https://github.com/woowacourse-teams/2023-zipgo/assets/24777828/e7eefb82-4bbf-47cd-a6ef-dc756d97c77d" alt="์ง‘๊ณ  README ๋ฐฐ๋„ˆ" />
<p align="center">
<img src="https://img.shields.io/badge/react-v18.2.0-9cf?logo=react" alt="react v18.2.0" />
<img src="https://img.shields.io/badge/spring_boot-v3.1.1-green?logo=springbootโ€ alt="spring-boot v3.1.1" />
<img src="https://img.shields.io/badge/typescript-v5.1.6-blue?logo=typescriptโ€ alt="typescript v5.1.6"/>
<img src="https://img.shields.io/badge/mysql-v8.0.34-blue?logo=mysql" alt="mysql v8.0.34"/>
</p>

## ๋ฉค๋ฒ„
**์ดˆ๋ณด ์ง‘์‚ฌ์˜ ๋ฐ˜๋ ค๋™๋ฌผ ์‹ํ’ˆ ์„ ํƒ์„ ๋„์™€์ฃผ๋Š” ์„œ๋น„์Šค**, ์ง‘์‚ฌ์˜๊ณ ๋ฏผ์ž…๋‹ˆ๋‹ค.

| Frontend | Frontend | Frontend |
| :--------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: |
| <img src="https://avatars.githubusercontent.com/u/24777828?v=4" width=100px alt="์ฒต์Šค"/> | <img src="https://avatars.githubusercontent.com/u/79056677?v=4" width=100px alt="๋…ธ์•„์ด์ฆˆ"/> | <img src="https://avatars.githubusercontent.com/u/72087183?v=4" width=100px alt="์—๋””"/> |
| [์ฒต์Šค](https://github.com/HyeryongChoi) | [๋…ธ์•„์ด์ฆˆ](https://github.com/n0eyes) | [์—๋””](https://github.com/ksone02)
์ „๋ฌธ๊ฐ€๋“ค์˜ ์‚ฌ๋ฃŒ ์„ ํƒ ๊ธฐ์ค€์€ ๋ฌด์—‡์ผ๊นŒ์š”?

๋‹ค์–‘ํ•œ ์ „๋ฌธ๊ฐ€๋“ค์ด ์ธ์ •ํ•˜๋Š” [์ข‹์€ ์‚ฌ๋ฃŒ ์„ ํƒ ๊ธฐ์ค€]([https://translucent-mallet-426.notion.site/dae305b85c8146399d7de6a0e74b773d](https://www.notion.so/dae305b85c8146399d7de6a0e74b773d?pvs=21)), **์ง‘์‚ฌ์˜ ๊ณ ๋ฏผ**์—์„œ ํ™•์ธํ•˜์„ธ์š”!

| Backend | Backend | Backend | Backend |
|:--------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------:|:----------------------------------:| :----------------------------------:|
| <img src="https://avatars.githubusercontent.com/u/73161212?v=4" width=100px alt="๊ฐ€๋น„"/> | <img src="https://avatars.githubusercontent.com/u/76938931?v=4" width=100px alt="๋ฌด๋ฏผ"/> | <img src="https://avatars.githubusercontent.com/u/94087228?v=4" width=100px alt="๋ฒ ๋ฒ "/> | <img src="https://avatars.githubusercontent.com/u/61582017?v=4" width=100px alt="๋กœ์ง€"/> |
| [๊ฐ€๋น„](https://github.com/iamjooon2) | [๋ฌด๋ฏผ](https://github.com/parkmuhyeun) | [๋ฒ ๋ฒ ](https://github.com/wonyongChoi05) | [๋กœ์ง€](https://github.com/kyY00n)
- [zipgo.pet](https://zipgo.pet)
- [zipgo.wiki](https://github.com/woowacourse-teams/2023-zipgo/wiki)

# Skills

### Frontend Tech Stack
![Frontend Tech Stacks](https://github.com/woowacourse-teams/2023-zipgo/assets/24777828/4372f950-d29e-46a0-807c-79d78a7f6913)

### Backend Tech Stack
![Backend Tech Stacks](https://github.com/woowacourse-teams/2023-zipgo/assets/24777828/a4643676-e669-43f5-9bb4-d2f4e92ed470)

# Infra Structure
![Zigo Infra](https://github.com/woowacourse-teams/2023-zipgo/assets/24777828/09847ae1-2aac-41a1-9302-4a2b49a284e0)


### Frontend Infra Structure
![image](https://github.com/woowacourse-teams/2023-zipgo/assets/24777828/eac9e8af-2df3-486a-9812-6a39ab36eb4e)

### Backend Infra Structure
![image](https://github.com/woowacourse-teams/2023-zipgo/assets/24777828/c6b9ec96-1301-4088-98d1-1e1ec1d3b334)


# Member

| [์ฒต์Šค](https://github.com/HyeryongChoi) | [๋…ธ์•„์ด์ฆˆ](https://github.com/n0eyes) | [์—๋””](https://github.com/ksone02) | [๊ฐ€๋น„](https://github.com/iamjooon2) | [๋ฌด๋ฏผ](https://github.com/parkmuhyeun) | [๋ฒ ๋ฒ ](https://github.com/wonyongChoi05) | [๋กœ์ง€](https://github.com/kyY00n) |
| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| <img src="https://avatars.githubusercontent.com/u/24777828?v=4" width=200px alt="์ฒต์Šค" /> | <img src="https://avatars.githubusercontent.com/u/79056677?v=4" width=200px alt="๋…ธ์•„์ด์ฆˆ" /> | <img src="https://avatars.githubusercontent.com/u/72087183?v=4" width=200px alt="์—๋””" /> | <img src="https://avatars.githubusercontent.com/u/73161212?v=4" width=200px alt="๊ฐ€๋น„" /> | <img src="https://avatars.githubusercontent.com/u/76938931?v=4" width=200px alt="๋ฌด๋ฏผ" /> | <img src="https://avatars.githubusercontent.com/u/94087228?v=4" width=200px alt="๋ฒ ๋ฒ "/> | <img src="https://avatars.githubusercontent.com/u/61582017?v=4" width=200px alt="๋กœ์ง€" /> |
| Frontend | Frontend | Frontend | Backend | Backend | Backend | Backend |
4 changes: 4 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

implementation group: 'com.datadoghq', name: 'dd-trace-api', version: '1.21.0'

implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
Expand Down Expand Up @@ -110,6 +112,7 @@ jacocoTestReport {
'**/*Response*',
'**/*Request*',
'**/BaseTimeEntity',
'**/KakaoOAuthClient',
'**/*Dto*',
'**/S3*',
'**/*Interceptor*',
Expand Down Expand Up @@ -149,6 +152,7 @@ jacocoTestCoverageVerification {
'*.*Exception*',
'*.*Dto',
'*.S3*',
'*.KakaoOAuthClient*',
'*.*Response',
'*.*Request',
'*.BaseTimeEntity',
Expand Down
28 changes: 0 additions & 28 deletions backend/deploy-dev.sh

This file was deleted.

28 changes: 0 additions & 28 deletions backend/deploy-prod.sh

This file was deleted.

40 changes: 40 additions & 0 deletions backend/src/main/java/zipgo/aspect/ConnectionProxyHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package zipgo.aspect;

import org.springframework.web.context.request.RequestContextHolder;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ConnectionProxyHandler implements InvocationHandler {

private static final String QUERY_PREPARE_STATEMENT = "prepareStatement";

private final Object connection;
private final QueryCounter queryCounter;

public ConnectionProxyHandler(Object connection, QueryCounter queryCounter) {
this.connection = connection;
this.queryCounter = queryCounter;
}

@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
countQuery(method);
return method.invoke(connection, args);
}

private void countQuery(Method method) {
if (isPrepareStatement(method) && isRequest()) {
queryCounter.increaseCount();
}
}

private boolean isPrepareStatement(Method method) {
return method.getName().equals(QUERY_PREPARE_STATEMENT);
}

private boolean isRequest() {
return RequestContextHolder.getRequestAttributes() != null;
}

}
18 changes: 18 additions & 0 deletions backend/src/main/java/zipgo/aspect/QueryCounter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package zipgo.aspect;

import lombok.Getter;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;

@Getter
@Component
@RequestScope
public class QueryCounter {

private int count;

public void increaseCount() {
count++;
}

}
29 changes: 29 additions & 0 deletions backend/src/main/java/zipgo/aspect/QueryCounterAop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package zipgo.aspect;

import lombok.RequiredArgsConstructor;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

import java.lang.reflect.Proxy;

@Aspect
@Component
@RequiredArgsConstructor
public class QueryCounterAop {

private final QueryCounter queryCounter;

@Around("execution(* javax.sql.DataSource.getConnection(..))")
public Object getConnection(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
Object connection = proceedingJoinPoint.proceed();

return Proxy.newProxyInstance(
connection.getClass().getClassLoader(),
connection.getClass().getInterfaces(),
new ConnectionProxyHandler(connection, queryCounter)
);
}

}
Loading

0 comments on commit 2f73f90

Please sign in to comment.