Skip to content

LoCoMap/locomap-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LocoMap Backend

Image

μœ„μΉ˜ 기반 μ‹€μ‹œκ°„ μ†Œμ…œ ν”Œλž«νΌ LocoMap의 λ°±μ—”λ“œ μ„œλ²„μž…λ‹ˆλ‹€. μ§€μ˜€ν•΄μ‹œ(Geohash)λ₯Ό 핡심 μΈν”„λΌλ‘œ ν™œμš©ν•˜μ—¬ μ‚¬μš©μž μœ„μΉ˜ 기반 μ±„νŒ…, ν”Όλ“œ, λŒ€ν”Όμ†Œ 정보λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.

기술 μŠ€νƒ

λΆ„λ₯˜ 기술
Language Java 21
Framework Spring Boot 4.0.2
Build Gradle
Database MySQL
Cache Redis
ORM Spring Data JPA (Hibernate)
WebSocket STOMP + SockJS
Monitoring Prometheus + Micrometer + Grafana
Load Test k6

ν”„λ‘œμ νŠΈ ꡬ쑰

src/main/java/com/locomap/backend/
β”œβ”€β”€ domain/
β”‚   β”œβ”€β”€ user/        # μ‚¬μš©μž 관리 (νšŒμ›κ°€μž…, 둜그인, μœ„μΉ˜)
β”‚   β”œβ”€β”€ feed/        # ν”Όλ“œ (포슀트 CRUD)
β”‚   β”œβ”€β”€ chat/        # μœ„μΉ˜ 기반 μ‹€μ‹œκ°„ μ±„νŒ…
β”‚   └── shelter/     # 곡곡 λŒ€ν”Όμ†Œ 정보
└── global/
    β”œβ”€β”€ config/      # WebSocket, Redis, CORS, λ©”νŠΈλ¦­ μ„€μ •
    β”œβ”€β”€ exception/   # κΈ€λ‘œλ²Œ μ˜ˆμ™Έ 처리
    └── util/        # GeohashUtil (μ§€μ˜€ν•΄μ‹œ 인코딩/λ””μ½”λ”©/거리 계산)

μ£Όμš” κΈ°λŠ₯

μ‚¬μš©μž (User)

  • νšŒμ›κ°€μž… / 둜그인
  • μ‚¬μš©μž ν”„λ‘œν•„ 쑰회
  • μ˜¨λ³΄λ”© μ™„λ£Œ 처리 (μœ„μΉ˜ λ™μ˜ 및 초기 μœ„μΉ˜ μ €μž₯)

ν”Όλ“œ (Feed)

  • 포슀트 CRUD
  • 감정(emotion) νƒœκ·Έ 및 μœ„μΉ˜ 정보 포함
  • 전체 ν”Όλ“œ μ΅œμ‹ μˆœ 쑰회

μ±„νŒ… (Chat)

  • μ§€μ˜€ν•΄μ‹œ 기반 μ±„νŒ…λ°© μžλ™ 생성 및 쑰회
  • STOMP / SockJS WebSocket μ‹€μ‹œκ°„ λ©”μ‹œμ§€ μ†‘μˆ˜μ‹ 
  • μ£Όλ³€ μ±„νŒ…λ°© 쑰회 (Geohash prefix 필터링 β†’ Haversine 거리 계산 2단계 방식)

μ‰˜ν„° (Shelter)

  • 곡곡 API(safetydata.go.kr) 연동 λŒ€ν”Όμ†Œ 정보 쑰회
  • Redis Geo μΊμ‹±μœΌλ‘œ μœ„μΉ˜ 기반 μ£Όλ³€ μ‰˜ν„° λΉ λ₯Έ 검색 (TTL 24h)

API λͺ©λ‘

User

Method Endpoint μ„€λͺ…
POST /api/users νšŒμ›κ°€μž…
POST /api/users/login 둜그인
GET /api/users/{userId} ν”„λ‘œν•„ 쑰회
POST /api/users/{userId}/onboarding μ˜¨λ³΄λ”© μ™„λ£Œ

Feed

Method Endpoint μ„€λͺ…
GET /api/posts 전체 ν”Όλ“œ μ΅œμ‹ μˆœ 쑰회
POST /api/posts 포슀트 생성
GET /api/posts/{postId} 포슀트 상세 쑰회
PUT /api/posts/{postId} 포슀트 μˆ˜μ •
DELETE /api/posts/{postId} 포슀트 μ‚­μ œ

Chat

Method Endpoint μ„€λͺ…
GET /api/chat/room/{geohash} μ±„νŒ…λ°© 쑰회 / μ—†μœΌλ©΄ 생성
GET /api/chat/room/{geohash}/messages λ©”μ‹œμ§€ λͺ©λ‘ 쑰회
GET /api/chat/rooms/nearby?lat=&lng=&radius= μ£Όλ³€ μ±„νŒ…λ°© 쑰회 (κΈ°λ³Έ 반경 5km)
WS /ws (STOMP) μ‹€μ‹œκ°„ λ©”μ‹œμ§€ 전솑

WebSocket λ©”μ‹œμ§€ 경둜: /app/chat/{geohash} β†’ /topic/chat/{geohash}

Shelter

Method Endpoint μ„€λͺ…
GET /api/shelters?page=&pageNo= λŒ€ν”Όμ†Œ λͺ©λ‘ 쑰회 (νŽ˜μ΄μ§•)
GET /api/shelters/nearby?lat=&lng=&limit= μ£Όλ³€ λŒ€ν”Όμ†Œ 쑰회

About

πŸ“μœ„μΉ˜ 기반 μ•ˆμ‹¬ λ„€νŠΈμ›Œν¬ μ„œλΉ„μŠ€ - λ°±μ—”λ“œ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors