diff --git a/.gitignore b/.gitignore
index 01b6b1f..4d570a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,4 +13,6 @@
# Common
.DS_Store
*.log
-.env
\ No newline at end of file
+.env
+
+.idea/
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..dcd73c7
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 디폴트 무시된 파일
+/../../피로체크/.idea/shelf/
+/../../피로체크/.idea/workspace.xml
+# 에디터 기반 HTTP 클라이언트 요청
+/../../피로체크/.idea/httpRequests/
+# Datasource local storage ignored files
+/../../피로체크/.idea/dataSources/
+/../../피로체크/.idea/dataSources.local.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..aa0b0f1
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..29f2e28
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..03d9549
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..722604f
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..e30031f
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..0fcafb0
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..557b024
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ "customColor": "",
+ "associatedIndex": 2
+}
+
+
+
+
+
+
+
+
+ {
+ "keyToString": {
+ "ASKED_MARK_IGNORED_FILES_AS_EXCLUDED": "true",
+ "Gradle./Users/seonju/Documents/플젝/피로체크/backend/pirocheck/build.gradle.executor": "Run",
+ "Gradle.pirocheck 빌드.executor": "Run",
+ "RequestMappingsPanelOrder0": "0",
+ "RequestMappingsPanelOrder1": "1",
+ "RequestMappingsPanelWidth0": "75",
+ "RequestMappingsPanelWidth1": "75",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "Spring Boot.PirocheckApplication.executor": "Run",
+ "git-widget-placeholder": "backend__sj",
+ "kotlin-language-version-configured": "true",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "project.structure.last.edited": "모듈",
+ "project.structure.proportion": "0.23046875",
+ "project.structure.side.proportion": "0.40229884",
+ "vue.rearranger.settings.migration": "true"
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1746360615858
+
+
+ 1746360615858
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git "a/.idea/\355\224\274\353\241\234\354\262\264\355\201\254.iml" "b/.idea/\355\224\274\353\241\234\354\262\264\355\201\254.iml"
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ "b/.idea/\355\224\274\353\241\234\354\262\264\355\201\254.iml"
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/backend/pirocheck/.gitattributes b/backend/pirocheck/.gitattributes
new file mode 100644
index 0000000..8af972c
--- /dev/null
+++ b/backend/pirocheck/.gitattributes
@@ -0,0 +1,3 @@
+/gradlew text eol=lf
+*.bat text eol=crlf
+*.jar binary
diff --git a/backend/pirocheck/.gitignore b/backend/pirocheck/.gitignore
new file mode 100644
index 0000000..8f30de9
--- /dev/null
+++ b/backend/pirocheck/.gitignore
@@ -0,0 +1,42 @@
+HELP.md
+.gradle
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+.idea
+.idea/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+bin/
+!**/src/main/**/bin/
+!**/src/test/**/bin/
+
+### IntelliJ IDEA ###
+*.iws
+*.iml
+*.ipr
+out/
+!**/src/main/**/out/
+!**/src/test/**/out/
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+
+### VS Code ###
+.vscode/
+
+### 환경 변수 ###
+../../.env
\ No newline at end of file
diff --git a/backend/pirocheck/build.gradle b/backend/pirocheck/build.gradle
new file mode 100644
index 0000000..db75dba
--- /dev/null
+++ b/backend/pirocheck/build.gradle
@@ -0,0 +1,51 @@
+plugins {
+ id 'java'
+ id 'org.springframework.boot' version '3.4.5'
+ id 'io.spring.dependency-management' version '1.1.7'
+}
+
+group = 'backend'
+version = '0.0.1-SNAPSHOT'
+
+java {
+ toolchain {
+ languageVersion = JavaLanguageVersion.of(17)
+ }
+}
+
+configurations {
+ compileOnly {
+ extendsFrom annotationProcessor
+ }
+}
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
+ compileOnly 'org.projectlombok:lombok'
+ annotationProcessor 'org.projectlombok:lombok'
+ testImplementation 'org.springframework.boot:spring-boot-starter-test'
+ testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
+
+ // REST API 사용을 위해 반드시 필요
+ implementation 'org.springframework.boot:spring-boot-starter-web'
+
+ // DTO에서 @Valid 사용 시 필요
+ implementation 'org.springframework.boot:spring-boot-starter-validation'
+
+ // PostgreSQL
+ runtimeOnly 'org.postgresql:postgresql'
+
+ // 환경변수 관리
+ implementation 'io.github.cdimascio:java-dotenv:5.2.2'
+
+ // Swagger
+ implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6'
+}
+
+tasks.named('test') {
+ useJUnitPlatform()
+}
diff --git a/backend/pirocheck/gradle/wrapper/gradle-wrapper.jar b/backend/pirocheck/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..9bbc975
Binary files /dev/null and b/backend/pirocheck/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/backend/pirocheck/gradle/wrapper/gradle-wrapper.properties b/backend/pirocheck/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..37f853b
--- /dev/null
+++ b/backend/pirocheck/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/backend/pirocheck/gradlew b/backend/pirocheck/gradlew
new file mode 100644
index 0000000..faf9300
--- /dev/null
+++ b/backend/pirocheck/gradlew
@@ -0,0 +1,251 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/backend/pirocheck/gradlew.bat b/backend/pirocheck/gradlew.bat
new file mode 100644
index 0000000..9d21a21
--- /dev/null
+++ b/backend/pirocheck/gradlew.bat
@@ -0,0 +1,94 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/backend/pirocheck/settings.gradle b/backend/pirocheck/settings.gradle
new file mode 100644
index 0000000..6789af9
--- /dev/null
+++ b/backend/pirocheck/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'pirocheck'
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/PirocheckApplication.java b/backend/pirocheck/src/main/java/backend/pirocheck/PirocheckApplication.java
new file mode 100644
index 0000000..b7e39e5
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/PirocheckApplication.java
@@ -0,0 +1,25 @@
+package backend.pirocheck;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import io.github.cdimascio.dotenv.Dotenv;
+
+@SpringBootApplication
+public class PirocheckApplication {
+
+ public static void main(String[] args) {
+
+ // .env 파일 로드
+ Dotenv dotenv = Dotenv.configure()
+ .directory("./") // .env 파일 경로 설정 (기본: 프로젝트 루트)
+ .load();
+
+ // 환경변수를 시스템 프로퍼티에 추가
+ dotenv.entries().forEach(entry ->
+ System.setProperty(entry.getKey(), entry.getValue())
+ );
+
+ SpringApplication.run(PirocheckApplication.class, args);
+ }
+
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/User/controller/UserController.java b/backend/pirocheck/src/main/java/backend/pirocheck/User/controller/UserController.java
new file mode 100644
index 0000000..9f8239d
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/User/controller/UserController.java
@@ -0,0 +1,44 @@
+package backend.pirocheck.User.controller;
+
+import backend.pirocheck.User.dto.request.LoginRequest;
+import backend.pirocheck.User.dto.response.LoginResponse;
+import backend.pirocheck.User.entity.User;
+import backend.pirocheck.User.repository.UserRepository;
+import backend.pirocheck.User.service.UserService;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpSession;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/api")
+@RequiredArgsConstructor
+public class UserController {
+
+ private final UserService userService;
+
+ // 로그인
+ @PostMapping("/login")
+ public ResponseEntity login(@RequestBody LoginRequest request, HttpSession session) {
+ User user = userService.login(request.getName(), request.getPassword());
+
+ //세션에 로그인 정보 저장
+ session.setAttribute("loginUser", user);
+
+ // 사용자 정보 응답
+ return ResponseEntity.ok(new LoginResponse(user));
+ }
+
+ // 로그아웃
+ @PostMapping("/logout")
+ public ResponseEntity logout(HttpSession session) {
+ session.invalidate(); // 세션 종료 (메모리에서 삭제)
+ return ResponseEntity.ok().build(); // 본문은 없음 (void)
+ }
+
+
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/User/dto/request/LoginRequest.java b/backend/pirocheck/src/main/java/backend/pirocheck/User/dto/request/LoginRequest.java
new file mode 100644
index 0000000..a530d8a
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/User/dto/request/LoginRequest.java
@@ -0,0 +1,12 @@
+package backend.pirocheck.User.dto.request;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class LoginRequest {
+
+ private String name;
+ private String password;
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/User/dto/response/LoginResponse.java b/backend/pirocheck/src/main/java/backend/pirocheck/User/dto/response/LoginResponse.java
new file mode 100644
index 0000000..ec9d65a
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/User/dto/response/LoginResponse.java
@@ -0,0 +1,19 @@
+package backend.pirocheck.User.dto.response;
+
+
+import backend.pirocheck.User.entity.User;
+import lombok.Getter;
+
+@Getter
+public class LoginResponse {
+
+ private Long id;
+ private String name;
+ private String role;
+
+ public LoginResponse(User user) {
+ this.id = user.getId();
+ this.name = user.getName();
+ this.role = user.getRole().name(); // MEMBER or ADMIN
+ }
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/User/entity/Role.java b/backend/pirocheck/src/main/java/backend/pirocheck/User/entity/Role.java
new file mode 100644
index 0000000..ce1c180
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/User/entity/Role.java
@@ -0,0 +1,6 @@
+package backend.pirocheck.User.entity;
+
+public enum Role {
+ ADMIN,
+ MEMBER
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/User/entity/User.java b/backend/pirocheck/src/main/java/backend/pirocheck/User/entity/User.java
new file mode 100644
index 0000000..e2b88d0
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/User/entity/User.java
@@ -0,0 +1,35 @@
+package backend.pirocheck.User.entity;
+
+import jakarta.persistence.*;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+@Entity
+@Getter
+@Table(name="users")
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+
+public class User {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ private String password; // 전화번호 일부
+
+ private String name;
+
+ private String email;
+
+ private String phone;
+
+ @Enumerated(EnumType.STRING)
+ private Role role; // MEMBER or ADMIN
+
+ private Integer generation;
+
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/User/repository/UserRepository.java b/backend/pirocheck/src/main/java/backend/pirocheck/User/repository/UserRepository.java
new file mode 100644
index 0000000..9f80d25
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/User/repository/UserRepository.java
@@ -0,0 +1,15 @@
+package backend.pirocheck.User.repository;
+
+import backend.pirocheck.User.entity.Role;
+import backend.pirocheck.User.entity.User;
+import io.swagger.v3.oas.annotations.Operation;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface UserRepository extends JpaRepository {
+ Optional findByName(String name);
+
+ List findByRole(Role role);
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/User/service/UserService.java b/backend/pirocheck/src/main/java/backend/pirocheck/User/service/UserService.java
new file mode 100644
index 0000000..304edd8
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/User/service/UserService.java
@@ -0,0 +1,19 @@
+package backend.pirocheck.User.service;
+
+import backend.pirocheck.User.entity.User;
+import backend.pirocheck.User.repository.UserRepository;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@RequiredArgsConstructor
+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("이름 또는 비밀번호가 일치하지 않습니다."));
+ }
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/controller/AttendanceController.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/controller/AttendanceController.java
new file mode 100644
index 0000000..ac5847a
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/controller/AttendanceController.java
@@ -0,0 +1,55 @@
+package backend.pirocheck.attendence.controller;
+
+import backend.pirocheck.attendence.dto.request.GetAttendanceByDateReq;
+import backend.pirocheck.attendence.dto.request.MarkAttendanceReq;
+import backend.pirocheck.attendence.dto.response.AttendanceSlotRes;
+import backend.pirocheck.attendence.dto.response.AttendanceStatusRes;
+import backend.pirocheck.attendence.entity.AttendanceCode;
+import backend.pirocheck.attendence.service.AttendanceService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDate;
+import java.util.List;
+
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/api/attendance")
+public class AttendanceController {
+
+ private final AttendanceService attendanceService;
+
+ // 특정 유저의 출석 정보
+ @GetMapping("/user")
+ public List getAttendanceByUserId(@RequestParam Long userId) {
+ return attendanceService.findByUserId(userId);
+ }
+
+ // 특정 유저의 특정 일자 출석 정보
+ @GetMapping("/user/date")
+ public List getAttendanceByUserIdAndDate(
+ @RequestParam Long userId,
+ @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date
+ ) {
+ return attendanceService.findByUserIdAndDate(userId, LocalDate.now());
+ }
+
+ // 출석체크 시작
+ @PostMapping("/start")
+ public AttendanceCode postAttendance() {
+ return attendanceService.generateCodeAndCreateAttendances();
+ }
+
+ // 출석코드 비교
+ @PostMapping("/mark")
+ public boolean markAttendance(@RequestBody MarkAttendanceReq req) {
+ return attendanceService.markAttendance(req.getUserId(), req.getCode());
+ }
+
+ // 출석체크 종료
+ @PutMapping("/expire")
+ public boolean expireAttendance(@RequestParam String code) {
+ return attendanceService.exprireAttendanceCode(code);
+ }
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/request/GetAttendanceByDateReq.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/request/GetAttendanceByDateReq.java
new file mode 100644
index 0000000..d731fb4
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/request/GetAttendanceByDateReq.java
@@ -0,0 +1,11 @@
+package backend.pirocheck.attendence.dto.request;
+
+import lombok.Getter;
+
+import java.time.LocalDate;
+
+@Getter
+public class GetAttendanceByDateReq {
+ private Long userId;
+ private LocalDate date;
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/request/MarkAttendanceReq.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/request/MarkAttendanceReq.java
new file mode 100644
index 0000000..a6aad92
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/request/MarkAttendanceReq.java
@@ -0,0 +1,9 @@
+package backend.pirocheck.attendence.dto.request;
+
+import lombok.Getter;
+
+@Getter
+public class MarkAttendanceReq {
+ private Long userId;
+ private String code;
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/AttendanceSlotRes.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/AttendanceSlotRes.java
new file mode 100644
index 0000000..81f0bbf
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/AttendanceSlotRes.java
@@ -0,0 +1,14 @@
+package backend.pirocheck.attendence.dto.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+public class AttendanceSlotRes {
+ private int order;
+ private boolean status;
+
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/AttendanceStatusRes.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/AttendanceStatusRes.java
new file mode 100644
index 0000000..2a965ac
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/AttendanceStatusRes.java
@@ -0,0 +1,15 @@
+package backend.pirocheck.attendence.dto.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDate;
+import java.util.List;
+
+@Getter
+@Setter
+public class AttendanceStatusRes {
+ private LocalDate date;
+ private List slots;
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/GetAttendanceByUserIdRes.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/GetAttendanceByUserIdRes.java
new file mode 100644
index 0000000..50fd6a4
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/dto/response/GetAttendanceByUserIdRes.java
@@ -0,0 +1,13 @@
+package backend.pirocheck.attendence.dto.response;
+
+import lombok.Getter;
+
+import java.time.LocalDate;
+
+@Getter
+public class GetAttendanceByUserIdRes {
+ private Long userId;
+ private LocalDate date;
+ private int order;
+ private boolean status;
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/entity/Attendance.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/entity/Attendance.java
new file mode 100644
index 0000000..af9ce56
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/entity/Attendance.java
@@ -0,0 +1,31 @@
+package backend.pirocheck.attendence.entity;
+
+import backend.pirocheck.User.entity.User;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDate;
+
+@Entity
+@Table(
+ name = "attendance",
+ uniqueConstraints = @UniqueConstraint(columnNames = {"user_id", "date", "order_number"})
+)
+@Getter @Setter
+public class Attendance {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @ManyToOne
+ @JoinColumn(name = "user_id", nullable = false)
+ private User user;
+
+ private LocalDate date;
+
+ @Column(name = "order_number")
+ private int order;
+
+ private boolean status;
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/entity/AttendanceCode.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/entity/AttendanceCode.java
new file mode 100644
index 0000000..358bf29
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/entity/AttendanceCode.java
@@ -0,0 +1,24 @@
+package backend.pirocheck.attendence.entity;
+
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDate;
+
+@Entity
+@Table(name = "attendance_code")
+@Getter @Setter
+public class AttendanceCode {
+ @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ private String code;
+
+ private LocalDate date;
+
+ @Column(name = "order_number")
+ private int order;
+
+ private boolean isExpired = false;
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/repository/AttendanceCodeRepository.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/repository/AttendanceCodeRepository.java
new file mode 100644
index 0000000..2c30b55
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/repository/AttendanceCodeRepository.java
@@ -0,0 +1,14 @@
+package backend.pirocheck.attendence.repository;
+
+import backend.pirocheck.attendence.entity.AttendanceCode;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.time.LocalDate;
+import java.util.Optional;
+
+@Repository
+public interface AttendanceCodeRepository extends JpaRepository {
+ int countByDate(LocalDate date);
+ Optional findByCodeAndDate(String code, LocalDate date);
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/repository/AttendanceRepository.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/repository/AttendanceRepository.java
new file mode 100644
index 0000000..445f157
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/repository/AttendanceRepository.java
@@ -0,0 +1,17 @@
+package backend.pirocheck.attendence.repository;
+
+import backend.pirocheck.attendence.entity.Attendance;
+import backend.pirocheck.attendence.entity.AttendanceCode;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Optional;
+
+@Repository
+public interface AttendanceRepository extends JpaRepository {
+ List findByUserId(Long userId);
+ List findByUserIdAndDate(Long userId, LocalDate date);
+ Optional findByUserIdAndDateAndOrder(Long userId, LocalDate date, int order);
+}
diff --git a/backend/pirocheck/src/main/java/backend/pirocheck/attendence/service/AttendanceService.java b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/service/AttendanceService.java
new file mode 100644
index 0000000..42ffe8f
--- /dev/null
+++ b/backend/pirocheck/src/main/java/backend/pirocheck/attendence/service/AttendanceService.java
@@ -0,0 +1,143 @@
+package backend.pirocheck.attendence.service;
+
+import backend.pirocheck.User.entity.Role;
+import backend.pirocheck.User.entity.User;
+import backend.pirocheck.User.repository.UserRepository;
+import backend.pirocheck.attendence.dto.response.AttendanceSlotRes;
+import backend.pirocheck.attendence.dto.response.AttendanceStatusRes;
+import backend.pirocheck.attendence.entity.Attendance;
+import backend.pirocheck.attendence.entity.AttendanceCode;
+import backend.pirocheck.attendence.repository.AttendanceCodeRepository;
+import backend.pirocheck.attendence.repository.AttendanceRepository;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDate;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.stream.Collectors;
+
+@Service
+@RequiredArgsConstructor
+public class AttendanceService {
+
+ private final AttendanceRepository attendanceRepository;
+ private final AttendanceCodeRepository attendanceCodeRepository;
+ private final UserRepository userRepository;
+
+ // 출석코드 생성 함수
+ @Transactional
+ public AttendanceCode generateCodeAndCreateAttendances() {
+ LocalDate today = LocalDate.now();
+
+ // 오늘 생성된 출석코드 개수 = 현재까지 생성된 차시 수 + 1 (MAX=3)
+ int currentOrder = attendanceCodeRepository.countByDate(today) + 1;
+
+ // 1. 출석 코드 생성
+ String code = String.valueOf(ThreadLocalRandom.current().nextInt(1000, 10000));
+
+ AttendanceCode attendanceCode = new AttendanceCode();
+ attendanceCode.setCode(code);
+ attendanceCode.setDate(today);
+ attendanceCode.setOrder(currentOrder);
+ attendanceCodeRepository.save(attendanceCode);
+
+ // 2. user 권한을 가진 학생 리스트 조회
+ List users = userRepository.findByRole(Role.MEMBER);
+
+ // 3. 각 학생에 대해 출석 데이터 미리 생성
+ for (User user : users) {
+ Attendance attendance = new Attendance();
+ attendance.setUser(user);
+ attendance.setDate(LocalDate.now());
+ attendance.setOrder(currentOrder);
+ attendance.setStatus(false); // 기본은 false
+ attendanceRepository.save(attendance);
+ }
+ return attendanceCode;
+ }
+
+ // 출석코드 만료처리 함수
+ @Transactional
+ public boolean exprireAttendanceCode(String code) {
+ Optional codeOpt = attendanceCodeRepository.findByCodeAndDate(code, LocalDate.now());
+
+ if (codeOpt.isEmpty()) {
+ return false;
+ }
+
+ AttendanceCode attendanceCode = codeOpt.get();
+
+ if (attendanceCode.isExpired()) {
+ return false;
+ }
+
+ attendanceCode.setExpired(true);
+ attendanceCodeRepository.save(attendanceCode);
+
+ return true;
+ }
+
+ // 출석처리 함수
+ @Transactional
+ public boolean markAttendance(Long userId, String inputCode) {
+ // 1. 출석코드 일치 비교
+ Optional validCodeOpt = attendanceCodeRepository.findByCodeAndDate(inputCode, LocalDate.now());
+
+ if (validCodeOpt.isEmpty()) return false;
+
+ AttendanceCode code = validCodeOpt.get();
+
+ // 2. 해당 유저의 출석 레코드 조회
+ Optional attendanceOpt = attendanceRepository.findByUserIdAndDateAndOrder(userId, code.getDate(), code.getOrder());
+
+ if (attendanceOpt.isEmpty()) return false;
+
+ // 3. 출석 처리
+ Attendance attendance = attendanceOpt.get();
+ attendance.setStatus(true);
+ attendanceRepository.save(attendance);
+
+ return true;
+ }
+
+ // 유저의 전체 출석 현황을 조회하는 함수
+ public List findByUserId(Long userId) {
+ List attendances = attendanceRepository.findByUserId(userId);
+
+ // 날짜별로 그룹화
+ Map> grouped = attendances.stream()
+ .collect(Collectors.groupingBy(Attendance::getDate));
+
+ // 날짜별로 DTO 변환
+ return grouped.entrySet().stream()
+ .map(entry -> {
+ LocalDate date = entry.getKey();
+ List slots = entry.getValue().stream()
+ .map(a -> new AttendanceSlotRes(a.getOrder(), a.isStatus()))
+ .sorted(Comparator.comparingInt(AttendanceSlotRes::getOrder))
+ .toList();
+
+ AttendanceStatusRes dto = new AttendanceStatusRes();
+ dto.setDate(date);
+ dto.setSlots(slots);
+ return dto;
+ })
+ .sorted(Comparator.comparing(AttendanceStatusRes::getDate).reversed())
+ .toList();
+ }
+
+ // 유저의 특정 날짜의 출석 현황을 조회하는 함수
+ public List findByUserIdAndDate(Long userId, LocalDate date) {
+ List attendances = attendanceRepository.findByUserIdAndDate(userId, date);
+
+ return attendances.stream()
+ .map(a -> new AttendanceSlotRes(a.getOrder(), a.isStatus()))
+ .sorted(Comparator.comparingInt(AttendanceSlotRes::getOrder))
+ .toList();
+ }
+}
diff --git a/backend/pirocheck/src/main/resources/application.yml b/backend/pirocheck/src/main/resources/application.yml
new file mode 100644
index 0000000..656f19b
--- /dev/null
+++ b/backend/pirocheck/src/main/resources/application.yml
@@ -0,0 +1,12 @@
+spring:
+ datasource:
+ url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
+ username: ${DB_USER}
+ password: ${DB_PASSWORD}
+ jpa:
+ hibernate:
+ ddl-auto: update
+ show-sql: true
+ properties:
+ hibernate:
+ format_sql: true
\ No newline at end of file
diff --git a/backend/pirocheck/src/test/java/backend/pirocheck/PirocheckApplicationTests.java b/backend/pirocheck/src/test/java/backend/pirocheck/PirocheckApplicationTests.java
new file mode 100644
index 0000000..ed24e06
--- /dev/null
+++ b/backend/pirocheck/src/test/java/backend/pirocheck/PirocheckApplicationTests.java
@@ -0,0 +1,13 @@
+package backend.pirocheck;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class PirocheckApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}