Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
01ee583
Merge pull request #5 from pirogramming/frontend_sj
Imggaggu May 4, 2025
f6d919f
[fix]: InputBlock component 수정 및 reset.css 등록
NamKyeongMin May 4, 2025
cba9227
resolve conflict: keep index.css, App.css deleted
NamKyeongMin May 4, 2025
531ffc2
resolve conflict: keep index.css, App.css deleted
NamKyeongMin May 4, 2025
1406900
resolve conflict: keep index.css, App.css deleted
NamKyeongMin May 4, 2025
906cf8c
[feat]add Assignment, deposit, Home, Login page/Initial setup: routi…
qkrxogmla May 5, 2025
c7c8c09
Merge pull request #9 from pirogramming/fronted_th
qkrxogmla May 5, 2025
07a1ca2
[feat]intro page
qkrxogmla May 5, 2025
77abdfc
Merge pull request #11 from pirogramming/frontend_th
qkrxogmla May 5, 2025
ecee2f3
[feat]로그인 페이지 기능 구현 완료
qkrxogmla May 5, 2025
52258d0
Merge pull request #12 from pirogramming/frontend_th
qkrxogmla May 5, 2025
48e3234
[refactor] 로그인 API fetch 로직 분리 (api/user.js)
qkrxogmla May 5, 2025
2ac7f4a
[feat]Home page 구현 완료
qkrxogmla May 5, 2025
4178fd2
Merge pull request #15 from pirogramming/frontend_th
qkrxogmla May 5, 2025
d8d0e3b
[Merge] frontend to frontend_sj
Imggaggu May 7, 2025
f760f93
[Fix] header component & home page title font
Imggaggu May 7, 2025
6fa40be
[Feat] add AssignmentInfoBlock component& create Assignment Check page
Imggaggu May 7, 2025
c686e53
[Merge] origin to local
Imggaggu May 7, 2025
6627116
Merge pull request #18 from pirogramming/frontend_sj
Imggaggu May 7, 2025
2cec2c2
[Fix] login page title font
Imggaggu May 7, 2025
968d688
Merge pull request #19 from pirogramming/frontend_sj
Imggaggu May 7, 2025
67525c9
[feat]deposit page
qkrxogmla May 7, 2025
0b1d468
Merge pull request #20 from pirogramming/frontend_th
qkrxogmla May 7, 2025
f51993d
[fix]Assignment page
qkrxogmla May 7, 2025
cff7528
Merge pull request #21 from pirogramming/frontend_th
qkrxogmla May 7, 2025
f1f7c7a
Merge frontend into frontend_km and resolve conflict
NamKyeongMin May 7, 2025
8cd2571
Merge branch 'frontend' into frontend_km
NamKyeongMin May 7, 2025
d2b4fc6
Merge pull request #23 from pirogramming/frontend_km
NamKyeongMin May 7, 2025
e5e75a1
[add]: Attendacne page, InputBlock 컴포넌트 수정
NamKyeongMin May 7, 2025
0d2dbc4
Merge pull request #25 from pirogramming/frontend_km
NamKyeongMin May 7, 2025
af238d0
[fix]: InputBlock 컴포넌트 values 없는 예외 처리
NamKyeongMin May 7, 2025
dffff68
[add]: boom img
NamKyeongMin May 7, 2025
8f69067
Merge pull request #26 from pirogramming/frontend_km
NamKyeongMin May 7, 2025
29f6ccd
[add]: boom img
NamKyeongMin May 7, 2025
e1f294c
Merge pull request #27 from pirogramming/frontend_km
NamKyeongMin May 7, 2025
6bfd0c2
[add]: boom.png 추가
NamKyeongMin May 7, 2025
7344416
[add]: boom_filled_color 추가
NamKyeongMin May 7, 2025
34ac7be
public구조 수정
qkrxogmla May 7, 2025
52f08b1
Merge pull request #30 from pirogramming/frontend_th
qkrxogmla May 7, 2025
1b6272b
[Feat] Connect backend and frontend for Assignment section
Imggaggu May 7, 2025
6db8e8a
[Chore] Remove unused imports
Imggaggu May 7, 2025
585d1eb
merge frontend to frontend_sj
Imggaggu May 7, 2025
a28e2de
[add]: Attend_week_component 추가
NamKyeongMin May 7, 2025
c5e9808
Merge pull request #31 from pirogramming/frontend_km
NamKyeongMin May 7, 2025
a79c6f6
사용되지는 않는 코드 삭제
qkrxogmla May 7, 2025
8d5f861
Merge pull request #33 from pirogramming/frontend_th
qkrxogmla May 7, 2025
7309089
[fix]: public/img 통일
NamKyeongMin May 7, 2025
e915aec
Merge pull request #34 from pirogramming/frontend_km
NamKyeongMin May 7, 2025
b7efae5
Merge pull request #36 from pirogramming/frontend_sj
Imggaggu May 7, 2025
5a06c9d
[add]: Attendance base tool 완성
NamKyeongMin May 7, 2025
fa86b48
Merge pull request #37 from pirogramming/frontend_km
NamKyeongMin May 7, 2025
4c29dda
[Fix] assignment api url
Imggaggu May 7, 2025
15ee0e5
Merge pull request #38 from pirogramming/frontend_sj
Imggaggu May 7, 2025
90a4be0
Merge pull request #39 from pirogramming/frontend
Imggaggu May 7, 2025
edcdf39
Merge pull request #40 from pirogramming/main
Imggaggu May 7, 2025
ecfb7b2
install npm
Imggaggu May 7, 2025
10a5d95
update README.md
Imggaggu May 7, 2025
4ce8b8c
npm재설치
qkrxogmla May 7, 2025
8a782ed
Merge pull request #41 from pirogramming/frontend_th
qkrxogmla May 7, 2025
8691e9a
Merge pull request #43 from pirogramming/frontend
qkrxogmla May 7, 2025
c049062
Update README.md
Imggaggu May 7, 2025
1708459
npm재설치
qkrxogmla May 7, 2025
cd00a30
[Fix] export mapStatus
Imggaggu May 7, 2025
286ca48
Merge pull request #44 from pirogramming/frontend_th
qkrxogmla May 7, 2025
203f50a
install npm
Imggaggu May 7, 2025
859a238
re-install npm
Imggaggu May 7, 2025
95d13c3
[Fix]package.json
Imggaggu May 7, 2025
08df23e
[Fix] deploy.yml
Imggaggu May 7, 2025
f6f42be
[Fix] package.json
Imggaggu May 7, 2025
9c9b585
[Fix] deploy.yml
Imggaggu May 7, 2025
ba635a6
frontend 배포 성공
Imggaggu May 7, 2025
e0a5702
give permission gradlew
Imggaggu May 7, 2025
1c4fb21
grant permission
Imggaggu May 7, 2025
409b387
[Fix] deploy.yml for backend
Imggaggu May 7, 2025
b7b5080
deploy.yml:Create .env file
Imggaggu May 7, 2025
4a19d0d
배포 순서 바꾸기
Imggaggu May 7, 2025
52a7c50
build& env 생성 합치기
Imggaggu May 7, 2025
58e1c08
test 생략
Imggaggu May 7, 2025
4465362
찐막
Imggaggu May 7, 2025
6f26bcc
장재훈 천재
Imggaggu May 7, 2025
6a5364c
[HotFix]Deploy 성공
Imggaggu May 7, 2025
50f1211
Merge pull request #45 from pirogramming/deploy
Imggaggu May 7, 2025
ff4c525
[Fix] intro page font
Imggaggu May 8, 2025
6fc3aa0
[feat] 보증금 차감 수정
seonjuuu May 8, 2025
8bf9a7c
[feat] login exception
seonjuuu May 8, 2025
2884082
Merge pull request #47 from pirogramming/backend_sj
seonjuuu May 8, 2025
0cb5077
[feat] login exception
seonjuuu May 8, 2025
10653bb
Merge pull request #48 from pirogramming/backend_sj
seonjuuu May 8, 2025
5f6a566
[fix]: InputBlock 입력 글자 안보이는 이슈 해결
NamKyeongMin May 10, 2025
ace8277
Merge pull request #49 from pirogramming/frontend_km
NamKyeongMin May 10, 2025
dd1160d
Merge pull request #50 from pirogramming/frontend
NamKyeongMin May 10, 2025
d546d17
[add]: 출석체크 현황 가져오기+출석체크 반영
NamKyeongMin May 10, 2025
3bdd279
Merge pull request #51 from pirogramming/frontend_km
NamKyeongMin May 10, 2025
d8a40ac
Merge pull request #52 from pirogramming/frontend
NamKyeongMin May 10, 2025
3abfb0c
Merge pull request #53 from pirogramming/main
Imggaggu May 10, 2025
739a87f
[add]: boom-img-container 동적 구현
NamKyeongMin May 10, 2025
e1b5a7c
Merge pull request #55 from pirogramming/frontend_km
NamKyeongMin May 10, 2025
b1da7e0
Merge pull request #56 from pirogramming/frontend
NamKyeongMin May 10, 2025
41b405f
[feat] feat: 세션 보안 강화 및 만료 시 401 응답 처리 추가
seonjuuu May 10, 2025
887ae46
Merge pull request #57 from pirogramming/backend_sj
seonjuuu May 10, 2025
807cf52
[feat] WebConfig
seonjuuu May 11, 2025
8c24691
[fix] React와 연결 설정
l-wanderer01 May 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 49 additions & 39 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,9 @@ on:
branches: [deploy]

jobs:
frontend:
name: Deploy Frontend to S3
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install dependencies
run: |
cd frontend
npm ci

- name: Build frontend
run: |
cd frontend
npm run build

- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
AWS_S3_BUCKET: www.pirocheck.org
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: frontend/dist

backend:
name: Deploy Backend to EC2
needs: frontend
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
Expand All @@ -53,10 +19,18 @@ jobs:
distribution: 'temurin'
java-version: '17'

- name: Build backend
- name: Create .env file& Build backend
run: |
cd backend
./gradlew build --no-daemon
cd backend/pirocheck
echo DB_HOST=${{ secrets.DB_HOST }} >> .env
echo DB_PORT=${{ secrets.DB_PORT }} >> .env
echo DB_NAME=${{ secrets.DB_NAME }} >> .env
echo DB_USER=${{ secrets.DB_USER }} >> .env
echo DB_PASSWORD=${{ secrets.DB_PASSWORD }} >> .env

chmod +x gradlew
./gradlew build -x test --no-daemon


- name: Restore PEM file
run: |
Expand All @@ -65,7 +39,7 @@ jobs:

- name: Copy JAR to EC2
run: |
scp -o StrictHostKeyChecking=no -i pirocheck.pem backend/build/libs/*.jar ubuntu@${{ secrets.EC2_HOST }}:/home/ubuntu/app.jar
scp -o StrictHostKeyChecking=no -i pirocheck.pem backend/pirocheck/build/libs/*.jar ubuntu@${{ secrets.EC2_HOST }}:/home/ubuntu/

- name: Restart Spring Boot on EC2
run: |
Expand Down Expand Up @@ -97,3 +71,39 @@ jobs:
"color": 16711680
}]
}' ${{ secrets.DISCORD_WEBHOOK }}

frontend:
name: Deploy Frontend to S3
needs: backend
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install dependencies
run: |
cd frontend
rm -rf node_modules package-lock.json
npm install
npm install --save-dev vite rollup

- name: Build frontend
run: |
cd frontend
npm run build

- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
AWS_S3_BUCKET: www.pirocheck.org
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: frontend/dist
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@
.env
*.pem
.idea/

2 changes: 1 addition & 1 deletion backend/pirocheck/gradlew
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ do
*) app_path=$APP_HOME$link ;;
esac
done

# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DepositService {
private final DepositRepository depositRepository;
private final UserRepository userRepository;
private final AttendanceRepository attendanceRepository;
private final AssignmentRepository assignmentRepository; // 확인
private final AssignmentRepository assignmentRepository;

@Transactional
public DepositResDto getDeposit(Long userId) {
Expand All @@ -31,12 +31,12 @@ public DepositResDto getDeposit(Long userId) {

// 출석 실패
int failAttendanceCount = attendanceRepository.countByUserAndStatusFalse(user);
int descentAttendance = failAttendanceCount * 10000;
int descentAttendance = failAttendanceCount * 10_000;

// 과제 실패
int failAssignmentCount = assignmentRepository.countByUserAndSubmitted(user, AssignmentStatus.FAILURE); // 확인
int weakAssignmentCount = assignmentRepository.countByUserAndSubmitted(user, AssignmentStatus.INSUFFICIENT); // 확인
int descentAssignment = failAssignmentCount * 10_000 + weakAssignmentCount * 5_000;
int failAssignmentCount = assignmentRepository.countByUserAndSubmitted(user, AssignmentStatus.FAILURE);
int weakAssignmentCount = assignmentRepository.countByUserAndSubmitted(user, AssignmentStatus.INSUFFICIENT);
int descentAssignment = failAssignmentCount * 20_000 + weakAssignmentCount * 10_000;

// 방어권
int ascentDefence = deposit.getAscentDefence();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package backend.pirocheck.User.exception;

import backend.pirocheck.Attendance.dto.response.ApiResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

// InvalidLoginException (로그인 실패)
@ExceptionHandler(InvalidLoginException.class)
public ResponseEntity<ApiResponse<?>> handleInvalidLoginException(InvalidLoginException e) {
return ResponseEntity
.status(HttpStatus.UNAUTHORIZED) // 401 상태 코드
.body(ApiResponse.error(e.getMessage())); // 에러 메시지 전달
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package backend.pirocheck.User.exception;

public class InvalidLoginException extends RuntimeException{
public InvalidLoginException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package backend.pirocheck.User.filter;

import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.springframework.web.filter.OncePerRequestFilter;

import java.io.IOException;

public class SessionCheckFilter extends OncePerRequestFilter {

@Override
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
throws ServletException, IOException {

String path = request.getRequestURI();

// 로그인/로그아웃 요청은 세션 체크 제외
if (path.startsWith("/api/login") || path.startsWith("/api/logout")) {
filterChain.doFilter(request, response); // 다음 필터나 컨트롤러로 넘기는 명령어
return; // 세션 검사 안함
}

HttpSession session = request.getSession(false); // 세션이 없으면 새로 만들지 않고 null을 리턴 (true : 새로 생성)

if (session == null || session.getAttribute("loginUser") == null) {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); // 401 설정
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write("{\"success\":false,\"message\":\"세션이 만료되었습니다.\",\"data\":null}");
return;
}

filterChain.doFilter(request, response);

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package backend.pirocheck.User.service;

import backend.pirocheck.User.entity.User;
import backend.pirocheck.User.exception.InvalidLoginException;
import backend.pirocheck.User.repository.UserRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand All @@ -12,8 +13,14 @@ public class UserService {
private final UserRepository userRepository;

public User login(String name, String password) {
return userRepository.findByName(name)
.filter(user -> user.getPassword().equals(password))
.orElseThrow(() -> new IllegalArgumentException("이름 또는 비밀번호가 일치하지 않습니다."));
User user = userRepository.findByName(name)
.orElseThrow(() -> new InvalidLoginException("해당 사용자가 존재하지 않습니다.")); //401

if (!user.getPassword().equals(password)) {
throw new InvalidLoginException("비밀번호가 일치하지 않습니다."); //401
}

return user;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package backend.pirocheck.config;

import backend.pirocheck.User.filter.SessionCheckFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SessionCheckFilterConfig {

@Bean
public FilterRegistrationBean<SessionCheckFilter> sessionCheckFilter() {
FilterRegistrationBean<SessionCheckFilter> registrationBean = new FilterRegistrationBean<>();
registrationBean.setFilter(new SessionCheckFilter());
registrationBean.addUrlPatterns("/api/*");
registrationBean.setOrder(1);
return registrationBean;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package backend.pirocheck.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**") // 백엔드 API 요청에만 CORS 허용
.allowedOrigins("http://pirocheck.org:3000") // 프론트 배포 URL
.allowedMethods("GET", "POST", "PUT", "DELETE") // 허용할 HTTP 메서드
.allowCredentials(true); // 세션 쿠키 주고받기 허용
}
}
11 changes: 10 additions & 1 deletion backend/pirocheck/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,13 @@ spring:
properties:
hibernate:
format_sql: true
open-in-view: false
open-in-view: false
server:
servlet:
session:
cookie:
http-only: true # 세션 쿠키를 HttpOnly로 설정 (JS에서 접근 불가)
secure: false # HTTPS 전용 전송 (Https -> true로 바꿔야 함)
same-site: Lax # CSRF 방지
timeout: 30m # 세션 타임아웃 30분 (30 minutes)
address: 0.0.0.0
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
Loading