Imported from BaB-LoG/BaBLog-BE (
AGENTS.md). Install upstream withnpx skills add BaB-LoG/BaBLog-BE. Copyright stays with the author.
Repository Guidelines
Project Structure & Module Organization
src/main/java/com/ssafy/bablog: Spring Boot entry point (BaBLogBeApplication.java) and future domain layers (controller/service/repository). Use package-per-layer and keep package name stable for component scanning.src/main/resources: Configuration (application.yml) plusstatic/andtemplates/for any web assets. Favor profile-specific config files (e.g.,application-dev.yml) instead of editing defaults in place.- λͺ©ν/λͺ©ν κΈ°λ‘ λͺ¨λμ
com.ssafy.bablog.goal,com.ssafy.bablog.goal_historyν¨ν€μ§μ μμΌλ©°, λ§€νΌ XMLμsrc/main/resources/mapperμ μμ΅λλ€. src/test/java/com/ssafy/bablog: JUnit tests; mirror the main package structure so Springβs test slicing and context loading stay predictable.
Build, Test, and Development Commands
./mvnw clean package: Full build with dependency resolution; produces the runnable JAR intarget/../mvnw spring-boot:run: Run the API locally; respectsapplication.ymland env overrides (preferred during development)../mvnw test: Execute unit and integration tests../mvnw -DskipTests package: Build quickly when tests are not needed (avoid for release artifacts).- Environment: Java 17; keep your IDE and toolchain aligned with the Maven
java.versionproperty.
Coding Style & Naming Conventions
- Follow standard Spring conventions: classes in PascalCase, methods/fields in camelCase, constants in UPPER_SNAKE_CASE.
- Indentation: 4 spaces; avoid tabs. Let the formatter manage imports and ordering.
- Lombok is availableβprefer
@Slf4j,@Getter,@RequiredArgsConstructorfor boilerplate reduction, but ensure explicit constructors where clarity matters. - Package by layer (
controller,service,repository,config,domain) and align MyBatis mappers/interfaces under a dedicatedrepositorysubpackage.
Testing Guidelines
- Frameworks: JUnit 5 via
spring-boot-starter-testand MyBatis test starter. - Naming: Mirror the class under test with a
Testssuffix (e.g.,UserServiceTests), and use clear test method names (methodUnderTest_condition_expectedResult). - Keep tests isolated; prefer in-memory databases or dedicated test containers over shared environments. Provide sample data builders instead of brittle fixtures.
- Run
./mvnw testbefore pushing; add focused runs with./mvnw -Dtest=ClassNameTests testfor quick iterations.
Commit & Pull Request Guidelines
- Commits: Imperative, concise subjects (e.g.,
Add user mapper for sign-up). Group related changes; avoid βmisc fixes.β Reference issue IDs when applicable. - Pull Requests: Include a short summary, rationale, and testing notes (
./mvnw testoutput or manual steps). Attach screenshots/log snippets for observable changes. Ensure new endpoints/configs are documented or discoverable in code comments/config files.
Security & Configuration Tips
- Do not commit secrets. Use environment variables (
SPRING_DATASOURCE_URL,SPRING_DATASOURCE_USERNAME,SPRING_DATASOURCE_PASSWORD) or profile-specific config files ignored by VCS. - Keep local overrides in
application-local.propertiesand activate via-Dspring.profiles.active=localwhen running./mvnw spring-boot:run.
Additional GuideLines
- νκ΅μ΄λ‘ μμ μ μ§νν΄μ£ΌμΈμ.
- λΉμ μ μννΈμ¨μ΄ μμ§λμ΄, νλ‘ νΈμλ κ°λ°μ, λ°±μλ κ°λ°μ, μΉ μλΉμ€ κ°λ° ν λ§€λμ μ λλ€.
- μλ£λ₯Ό μ‘°μ¬νκΈ° μν΄ μΈν°λ· κ²μ λ° κΈ°ν μλ£ μ‘°μ¬λ₯Ό μ κ·Ήμ μΌλ‘ νμ©ν΄μ£ΌμΈμ. μμ μ΄ μ£Όμ΄μ§λ©΄ λ¨κ³μ μΌλ‘ μμ μ λΆν νμΈμ.
- μμ νλλ λκ΄μ 0, κ°κ΄μ 10 μ΄λ©΄ 9-10μ νλλ₯Ό μ μ§ν΄μ£ΌμΈμ.
- μμ μ μ§ννμ€ λ λΆμ‘±ν μ§μ λ° κ°λ μ΄ μλμ§ κ²ν ν΄μ£ΌμΈμ. μμνκ±°λ κ΄λ ¨ μ§μ λ° κ²½νμ΄ μλ κ°λ μ λ°κ²¬νμλ©΄ κ°λ μ μ μ, κΈ°λ₯, λͺ©μ , μμ, κΈ°λν¨κ³Ό λ±μ νμνλ€κ³ μκ°νλ μ 보λ₯Ό μ λΆ μ‘°μ¬νμ μ μμ μ μ’ ν©μ μΌλ‘ νμ©νμΈμ. μ‘°μ¬ν μ 보 λ΄μλ λλ€λ₯Έ μμν κ°λ μ΄ μλ€λ©΄ ν΄λΉ κ°λ μ λν΄μλ λμΌν μμ μ μ§νν΄μ£ΌμΈμ.
- μμ μ μμνκΈ° μ μ μμ μ μννκΈ° μν 3κ°μ§ λ°©λ²μ μ‘°μ¬νμκ³ μκ°ν΄μ£ΌμΈμ. κ·Έλ¦¬κ³ 3κ°μ§ μ€μμ μ΄λ€ λ°©λ²μ μ¬μ©ν΄μΌ ν둬ννΈ λ° μλΉμ€μ μꡬμ¬νμ μΆ©μ‘±μν¬ μ μμμ§ κ²ν ν΄μ£ΌμΈμ. μ μ λ λ°©λ²μ΄ κ³Όμ° ν둬ννΈλ₯Ό μμ±ν μ¬μ©μμ μꡬμ¬νλ₯Ό μΆ©μ‘±μν€λμ§ λ€μ νλ² κ²ν ν΄μ£ΌμΈμ. κ²ν ν λΆμ‘±ν λΆλΆμ μ°Ύμμ κ°μ ν μ μλ λ°©λ²μ μ‘°μ¬νμΈμ. μ΄λ¬ν λ°©λ² μ‘°μ¬, λ°©λ² μ ν, κ²ν μμ μ μ΅λ 5λ² λ°λ³΅ ν μμ μ μ§νν΄μ£ΌμΈμ.
- μμ μ μννλ©΄ ν΄λΉ μμ μ λν΄μ κ°μ ν΄μΌ ν μ¬νμ΄ μλμ§ νλ² λ μ κ²ν΄μ£ΌμΈμ. κ°μ μ¬νμ 3κ°μ§ μ μν λ€μ μ΄λ€ λ°©μμΌλ‘ κ°μ ν΄μΌ νλ‘μ νΈλ₯Ό λ μμ νκ³ λ μ’μ μλΉμ€λ₯Ό ꡬνν μ μμμ§ μκ°ν΄μ£ΌμΈμ. κ·Έλ¦¬κ³ κ°μ λ°©μμ μ ννμ¬ νλ‘μ νΈμ λ°μν΄μ£ΌμΈμ.
- μΈν°λ· κ²μμ ν λμλ κ°κ°μ μΉ λ¬Έμκ° μ λ’°μ±κ³Ό μ΅μ μ±μ μ λΆ κ°μΆκ³ μλμ§ λ¨Όμ νλ¨ν΄μ£Όμ μΌ ν©λλ€. μλνλ©΄ μμ¦ μΈν°λ·μλ κ²μ μμ§ μμ λν¬λ₯Ό λ Έλ¦¬κ³ AIλ‘ μμ°ν SEO μ΅μ νλ μΉ λ¬Έμκ° λ무 λ§μ΅λλ€. κ·Έλμ μλ£μ μ΅μ μ± λΏλ§ μλλΌ μ λ’°μ±κΉμ§ νμ ν΄μ£Όμ μΌ ν©λλ€.
- μΆκ°μ μΈ μμ² μ¬νμ΄ λ°μνμ λλ λμΌν νλ‘μΈμ€λ₯Ό μ§ννμΈμ.
Project Description
- μ΄ νλ‘μ νΈλ BaBLogλΌλ μλΉμ€μ λ°±μλ μλ²μ λλ€.
- νλ‘ νΈ μλ μλ²λ
BaBLog-FE/μ Vue 3 + Viteλ‘ κ΅¬νλμ΄ μμ΅λλ€. - λΉλλ maven, DBλ MySQL, SQL Mapperλ‘ mybatisλ₯Ό μ¬μ©ν©λλ€.
κΈ°λ₯
- νμ(Member)
- νμ κ°μ ν μ΄μ©μ΄ κ°λ₯ν μλΉμ€μ λλ€.
- μΈμ¦ / μΈκ°λ spring securityμ jwtλ₯Ό νμ©ν©λλ€.
- μλ¨(meal)
- μ¬μ©μκ° μμΉ¨, μ μ¬, μ λ , κΈ°νμ ν΄λΉνλ λ©λ΄λ₯Ό μ λ ₯νλ©΄, ν΄λΉ λ©λ΄μ μμ μ±λΆμ λΆμν΄μ μλ €μ€λλ€.
- κΈ°λ‘μ λͺ¨λ νκ³ , νλ£¨κ° μ§λλ©΄ μ λ μ μμ±ν κΈ°λ‘μ λν AIκ° νκ°ν©λλ€.
- λͺ©ν(goal)
- μ¬μ©μλ μμ μ λͺ©νλ₯Ό μ€μ ν μ μμ΅λλ€.
- λͺ©ν μμΉκ° μκ³ , λ²νΌ ν΄λ¦ λΉ μ¦κ°ν μμΉλ₯Ό μ§μ μ§μ ν μ μμ΅λλ€.
DB
- src/main/resources/static/DDL.sql νμΌμ μ°λ¦¬ νλ‘μ νΈμ DBμ DDL μΏΌλ¦¬λ¬Έμ΄ μμ±λμ΄ μμ΅λλ€. DBμ ν μ΄λΈμ ννλ ν΄λΉ νμΌμ μ°Έκ³ νμΈμ.
- MyBatis SQL Mapperλ₯Ό νλ‘μ νΈ μ€νμΌλ‘ μ±νν©λλ€.