Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
444 commits
Select commit Hold shift + click to select a range
5cf99ac
Merge branch 'deploy' of https://github.com/ScoopADive/Backend into d…
gomdoricake Aug 13, 2025
571140e
fix: 구글 로그인 auth_url 에 scope 추가
gomdoricake Aug 13, 2025
2925967
Update deploy.yml
gomdoricake Aug 13, 2025
bb41251
fix: nginx.conf 에 /swagger/ 추가
gomdoricake Aug 14, 2025
155548d
fix: 환경변수명 변경 (GOOGLE_SECRET)
gomdoricake Aug 14, 2025
e870480
Merge branch 'deploy' of https://github.com/ScoopADive/Backend into d…
gomdoricake Aug 14, 2025
9791b9a
fix: nginx.conf 에 /swagger/ 추가
gomdoricake Aug 14, 2025
eecb3fd
fix: 불필요한 import 삭제
gomdoricake Aug 14, 2025
da11a5d
feat: nginx.conf 에 /static/ 관련 설정 추가
gomdoricake Aug 14, 2025
a1c3177
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
d50e642
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
4627ef1
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
9267feb
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
cfb37cb
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
736e076
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
524be8b
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
c3fa6d4
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
9e9956e
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
9faee83
feat: nginx.conf 에 /swagger/ 관련 설정 변경
gomdoricake Aug 14, 2025
a192200
fix: 구글 소셜 로그인
gomdoricake Aug 14, 2025
6ea0e4b
fix: /signup/, /signin/ 주석해제
gomdoricake Aug 14, 2025
532a15a
feat: SECURE_SSL_REDIRECT 설정
gomdoricake Aug 14, 2025
b858f1a
feat: SECURE_SSL_REDIRECT 설정
gomdoricake Aug 14, 2025
874e016
fix: 세팅 수정
gomdoricake Aug 19, 2025
a513d49
feat: Swagger UI url 설정
gomdoricake Aug 19, 2025
f72a14a
fix: 구글 로그인 프론트 페이지 리디렉트 수정
gomdoricake Aug 19, 2025
36bc70c
fix: 구글 로그인 관련 view 수정
gomdoricake Aug 19, 2025
1e9919b
fix: 구글 로그인 관련 view 수정
gomdoricake Aug 19, 2025
fe8fe6b
fix: pk 를 id 로 변경
gomdoricake Aug 20, 2025
9dbb8db
fix: 버킷리스트 모든 유저의 버킷리스트 한번에 가져오는 오류 해결
gomdoricake Aug 27, 2025
9389464
fix: GET 좋아요 permission 수정
gomdoricake Aug 29, 2025
a561f56
feat: GET /mypage/profile 구현
gomdoricake Sep 3, 2025
2580b09
feat: Job 에 created_at 어트리뷰트 추가
gomdoricake Sep 4, 2025
35cf034
feat: 좋아요 여부 구현
gomdoricake Sep 4, 2025
bb6c7d4
feat: 좋아요 여부 구현
gomdoricake Sep 4, 2025
61dffc8
fix: like 관련 url 명 통일
gomdoricake Sep 5, 2025
40cc756
fix: like 관련 url 명 통일
gomdoricake Sep 5, 2025
efbe664
fix: like 관련 url 명 통일
gomdoricake Sep 5, 2025
9206be7
fix: like 관련 url 명 통일
gomdoricake Sep 5, 2025
dfec8e0
fix: /mypage/profile 의 응답에 license 추가
gomdoricake Sep 5, 2025
86399f4
fix: buddy 입력 방식 변경
gomdoricake Sep 5, 2025
1627bc3
fix: Equipment 입력 방식 변경
gomdoricake Sep 5, 2025
696f734
fix: Equipment 입력 방식 변경
gomdoricake Sep 5, 2025
d7c314e
fix: Equipment 입력 방식 변경
gomdoricake Sep 5, 2025
810b0f1
fix: Equipment 입력 방식 변경
gomdoricake Sep 5, 2025
8cc2ddc
fix: Equipment 입력 방식 변경
gomdoricake Sep 5, 2025
f1b9c87
fix: Equipment 입력 방식 변경
gomdoricake Sep 5, 2025
5b34176
fix: 임시로 equipment, divecenter 관련 제거
gomdoricake Sep 5, 2025
522f7e7
fix: 임시로 equipment, divecenter 관련 제거
gomdoricake Sep 5, 2025
4c22851
fix: equipment 관련 코드 수정
gomdoricake Sep 5, 2025
dba1585
fix: equipment 관련 코드 수정
gomdoricake Sep 5, 2025
d000880
fix: equipment 임시 삭제
gomdoricake Sep 5, 2025
a6c78a9
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
0280af3
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
e2e47b6
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
b5f5b52
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
1a57ad4
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
564308c
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
8fc4a62
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
a3b776b
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
a4659b1
fix: buddy, equipment 초기화
gomdoricake Sep 5, 2025
f812751
delete: migrations 파일 삭제
gomdoricake Sep 5, 2025
ddb030c
Revert "fix: /mypage/profile 의 응답에 license 추가"
gomdoricake Sep 5, 2025
9bc93f9
Revert "Revert "fix: /mypage/profile 의 응답에 license 추가""
gomdoricake Sep 5, 2025
9150dc3
Revert "fix: /mypage/profile 의 응답에 license 추가"
gomdoricake Sep 5, 2025
13e6c5d
Merge branch 'develop' into deploy
gomdoricake Sep 6, 2025
6749320
Revert "fix: /mypage/profile 의 응답에 license 추가"
gomdoricake Sep 6, 2025
829d501
Merge branch 'develop' of https://github.com/ScoopADive/Backend into …
gomdoricake Sep 6, 2025
16af240
Revert "Revert "fix: /mypage/profile 의 응답에 license 추가""
gomdoricake Sep 6, 2025
084ce64
Revert "fix: /mypage/profile 의 응답에 license 추가"
gomdoricake Sep 6, 2025
fde4e68
Revert "Revert "fix: /mypage/profile 의 응답에 license 추가""
gomdoricake Sep 6, 2025
0248c53
Revert "fix: buddy 입력 방식 변경"
gomdoricake Sep 6, 2025
a1f6ecd
Revert "Revert "Revert "fix: /mypage/profile 의 응답에 license 추가"""
gomdoricake Sep 6, 2025
e0c8ecb
fix: buddy, equipment 고치기 전으로 되돌리기
gomdoricake Sep 6, 2025
b32dbaa
feat: /mypage/profile 응답에 license 추가
gomdoricake Sep 6, 2025
acb68ca
fix: buddy 를 TextField 으로 변경
gomdoricake Sep 6, 2025
a606f19
fix: likes 를 read only 로 변경
gomdoricake Sep 6, 2025
8a17cff
fix: Dockerfile 수정
gomdoricake Sep 6, 2025
8b0b2ca
fix: Dockerfile 수정
gomdoricake Sep 6, 2025
7d367ce
fix: Dockerfile 수정
gomdoricake Sep 6, 2025
924a133
fix: LogbookSerializer 에 equipment 관련 코드 수정
gomdoricake Sep 8, 2025
6cc7953
fix: LogbookSerializer 에 equipment 관련 코드 수정
gomdoricake Sep 8, 2025
5ed24da
fix: Dockerfile 수정
gomdoricake Sep 8, 2025
24fd8c8
fix: Dockerfile, docker-compose 수정
gomdoricake Sep 8, 2025
42b0d00
feat: wordpress 관련 코드 생성
gomdoricake Sep 17, 2025
ac95166
feat: wordpress 관련 코드 생성
gomdoricake Sep 17, 2025
41fc349
feat: wordpress 관련 코드 생성
gomdoricake Sep 17, 2025
3f6b7e8
feat: wordpress 관련 코드 생성
gomdoricake Sep 17, 2025
071d10f
feat: wordpress 관련 코드 생성
gomdoricake Sep 17, 2025
e033dfe
fix: latin-1 오류 수정
gomdoricake Sep 17, 2025
28b9dab
fix: latin-1 문제 Dockerfile 수정
gomdoricake Sep 17, 2025
3a9ee6e
fix: latin-1 문제 Dockerfile 수정
gomdoricake Sep 17, 2025
19e7700
fix: latin-1 문제 Dockerfile 수정
gomdoricake Sep 17, 2025
ab15918
fix: latin-1 문제 Dockerfile 수정
gomdoricake Sep 17, 2025
91f1cea
fix: latin-1 문제 Dockerfile 수정
gomdoricake Sep 17, 2025
830848a
fix: wp_login 에서 @login_required
gomdoricake Sep 17, 2025
4aa6727
fix: wp_callback 에서 @login_required 제거
gomdoricake Sep 17, 2025
bad5de9
fix: wp_callback 에서 토큰 처리
gomdoricake Sep 17, 2025
b8cfc6e
add: 구글 로그인 스웨거 테스트
gomdoricake Sep 18, 2025
926651f
add: 구글 로그인 스웨거 테스트
gomdoricake Sep 18, 2025
c050c92
add: 구글 로그인 스웨거 테스트
gomdoricake Sep 18, 2025
5b838db
fix: 워드프레스 로그인 스웨거 나타내기
gomdoricake Sep 18, 2025
32f492d
feat: /api/wordpress/oauth/login/swagger/ 구현
gomdoricake Sep 18, 2025
4736bc4
feat: /api/wordpress/oauth/login/swagger/ 구현
gomdoricake Sep 18, 2025
10e7466
feat: /api/wordpress/oauth/login/swagger/ 구현
gomdoricake Sep 18, 2025
024e7c9
feat: /api/wordpress/oauth/login/swagger/ 구현
gomdoricake Sep 18, 2025
0253fcc
feat: /api/wordpress/oauth/login/swagger/ 구현
gomdoricake Sep 18, 2025
63d8fc1
add: WP_REDIRECT_URI_SWAGGER 추가
gomdoricake Sep 19, 2025
3dffb68
Update deploy.yml
gomdoricake Sep 19, 2025
34f3603
Update deploy.yml
gomdoricake Sep 19, 2025
763c338
add: WP_REDIRECT_URI_SWAGGER 추가
gomdoricake Sep 19, 2025
561def5
Merge branch 'deploy' of https://github.com/ScoopADive/Backend into d…
gomdoricake Sep 19, 2025
9c9499c
fix: LogbookPostViewSet 에 @action 데코레이터 추가
gomdoricake Sep 19, 2025
3a711ee
fix: WordPress LogbookPost 함수 재구현
gomdoricake Sep 19, 2025
0e80f16
fix: 워드프레스 토큰 중복 방지
gomdoricake Sep 20, 2025
57a1b54
fix: post_to_wordpress() 함수 수정
gomdoricake Sep 20, 2025
d9aa85f
fix: WordPress 토큰 처리 오류 해결
gomdoricake Sep 20, 2025
6c048bf
fix: WordPressToken 모델 수정
gomdoricake Sep 20, 2025
e45f212
fix: WordPressToken 에 필드 추가
gomdoricake Sep 24, 2025
f56dbba
fix: LogbookPostViewSet 에서 스웨거로 필드 입력 가능하게 수정
gomdoricake Sep 24, 2025
d8ef630
fix: 워드프레스 로그인 관련 함수 모두 permission_class 를 AllowAny 로 변경
gomdoricake Sep 28, 2025
8e1a406
add: 추천 시스템을 위한 Preferences 모델 생성
gomdoricake Sep 30, 2025
4bcf54c
fix: Preferences 에서 user 필드를 read_only 로 변경
gomdoricake Sep 30, 2025
832c2d5
fix: PreferencesSerializer 에서 user 정보 자동 추가하도록 수정
gomdoricake Sep 30, 2025
60f631a
feat: OpenAI API 를 활용한 스팟 추천 시스템 개발
gomdoricake Oct 29, 2025
74e12b4
feat: settings 앱 생성
gomdoricake Nov 2, 2025
1e0ec2b
feat: settings 앱 생성
gomdoricake Nov 2, 2025
a03e06d
feat: settings 앱 생성
gomdoricake Nov 2, 2025
7527cbd
feat: settings 앱 생성
gomdoricake Nov 2, 2025
32b5f89
fix: budget_min, budget_max 필드 타입 변경
gomdoricake Nov 2, 2025
76a9ce7
fix: migrations 파일 꼬임 삭제
gomdoricake Nov 2, 2025
8b8cabf
fix: PreferencesViewSet 클래스 수정
gomdoricake Nov 2, 2025
26897e6
fix: PreferencesViewSet 클래스 수정
gomdoricake Nov 2, 2025
ac31f61
fix: PreferencesViewSet 클래스 수정
gomdoricake Nov 2, 2025
30d3fb6
fix: SpotsRecommendationView 클래스 authentication 코드 수정
gomdoricake Nov 2, 2025
4480ed6
fix: wp_callback 에 'HEAD' 요청 허용
gomdoricake Nov 6, 2025
4aff453
fix: wp_login 에 'HEAD' 요청 허용
gomdoricake Nov 6, 2025
aa8b940
fix: CORS 관련 미들웨어 재설정
gomdoricake Nov 6, 2025
fbe530f
fix: wp_callback 에 POST, OPTIONS 허용
gomdoricake Nov 6, 2025
c102e66
fix: WP_REDIRECT_URI quite 로 변경
gomdoricake Nov 6, 2025
c4fe215
fix: proxy_pass 변경
gomdoricake Nov 6, 2025
232fbdd
fix: 에러 확인을 위해 잠시 DEBUG를 True 로 설정
gomdoricake Nov 6, 2025
8fd4e9b
fix: wp_callback 함수에서 WordPressToken 생성 오류 해결
gomdoricake Nov 6, 2025
c7106e7
fix: wp_callback 함수에서 WordPressToken 생성 오류 해결
gomdoricake Nov 6, 2025
f65d328
add: setting.py 에 LOGGING 관련 세팅 추ㄱ
gomdoricake Nov 6, 2025
d138383
fix: nginx.conf 에 http 버전 1.1로 변경
gomdoricake Nov 7, 2025
b11e1f7
fix: nginx.conf 에 http 버전 1.1로 변경
gomdoricake Nov 7, 2025
d0a5d54
test: wp_callback 테스트 코드 삽입
gomdoricake Nov 7, 2025
45ca42b
fix: nginx.conf 에서 proxy_pass 변경
gomdoricake Nov 7, 2025
025e8ea
fix: nginx.conf 에서 proxy_pass 변경, docker-compose 에서 컨테이너 이름 변경
gomdoricake Nov 7, 2025
7160897
fix: nginx.conf 에서 proxy_pass 변경
gomdoricake Nov 7, 2025
8fe75b9
fix: nginx.conf 에서 proxy_pass 변경
gomdoricake Nov 7, 2025
9b8eb17
fix: nginx.conf 에서 proxy_pass 변경
gomdoricake Nov 7, 2025
ca537e1
fix: nginx.conf 에서 proxy_pass 변경
gomdoricake Nov 7, 2025
77f3246
fix: nginx.conf 에서 proxy_pass 변경
gomdoricake Nov 7, 2025
a9320e8
fix: wp_callback 함수 수정
gomdoricake Nov 7, 2025
caea7af
fix: wp_callback 함수 수정
gomdoricake Nov 7, 2025
26ad556
fix: docker-compose.yml 수정
gomdoricake Nov 7, 2025
93de2d8
fix: nginx.conf 수정
gomdoricake Nov 7, 2025
aa0ea5c
fix: nginx.conf 수정
gomdoricake Nov 7, 2025
cd5d125
fix: wp_callback 함수 수정
gomdoricake Nov 7, 2025
22fbb78
fix: wp_callback 함수 수정
gomdoricake Nov 7, 2025
4675d72
add: proxy_set_header 에 Cookie 추가
gomdoricake Nov 7, 2025
e363037
add: wp_callback 함수에 @csrf_exempt 추가
gomdoricake Nov 7, 2025
b440cfe
fix: wp_callback 함수 수정
gomdoricake Nov 7, 2025
08bfb36
fix: wp_callback 함수 수정
gomdoricake Nov 7, 2025
cbe2c2f
fix: wp_callback 에서 raw_token 수정
gomdoricake Nov 7, 2025
4ea0e10
fix: URL-safe base64 적용
gomdoricake Nov 7, 2025
9414cc7
fix: wp_login 에 state 및 token 추가
gomdoricake Nov 7, 2025
4771101
fix: User = get_user_model() 로 변경
gomdoricake Nov 7, 2025
4b19ef8
fix: wordpress 다중 연결 가능케 수정
gomdoricake Nov 7, 2025
50b9c37
fix: LogbookPostViewSet 에서 html 구조 변경
gomdoricake Nov 7, 2025
ca3e14b
fix: WordPress 팝업창 문제 해결
gomdoricake Nov 8, 2025
db4f312
fix: WordPress 팝업창 문제 해결
gomdoricake Nov 8, 2025
22e1f2d
fix: CustomPrompt 에서 Preferences 접근 에러 수정
gomdoricake Nov 8, 2025
79d0777
add: proxy_set_header 에 Origin 추가
gomdoricake Nov 10, 2025
d6b546b
add: proxy_set_header 에 Authorization 추가
gomdoricake Nov 10, 2025
c094241
fix: nginx 에서 백엔드 프론트엔드 서버 분리
gomdoricake Nov 10, 2025
db346ae
add: CORS_ALLOW_CREDENTIALS 설정 변경
gomdoricake Nov 10, 2025
72c3039
fix: proxy_pass http://django 끝에 / 추가
gomdoricake Nov 10, 2025
4a42c50
fix: proxy_pass http://django 끝에 / 삭제
gomdoricake Nov 10, 2025
3f14a99
add: CSRF 및 SESSION 관련 설정 추가
gomdoricake Nov 10, 2025
613e791
add: SameSite 설정 및 세션/로그인 만료 설정
gomdoricake Nov 10, 2025
0381700
add: .gitignore 에 swagger.html 추가
gomdoricake Nov 11, 2025
02ca408
add: CSRF_TRUSTED_ORIGINS 에 api.scoopadive.com 추가
gomdoricake Nov 11, 2025
5e4e45b
add: ALLOWED_HOSTS, CORS_ALLOWED_ORIGINS에 api.scoopadive.com 추가
gomdoricake Nov 11, 2025
aa9801f
fix: schema_view 의 url api.scoopadive.com 으로 변경
gomdoricake Nov 11, 2025
a2e0281
fix: schema_view 에서 url https://scoopadive.com/api 로 변경
gomdoricake Nov 11, 2025
d884b37
Delete swagger.html
gomdoricake Nov 11, 2025
2e2d015
fix: swagger urlpatterns 수정
gomdoricake Nov 11, 2025
48c63f8
Merge branch 'deploy' of https://github.com/ScoopADive/Backend into d…
gomdoricake Nov 11, 2025
f6bec46
fix: schema_view URL 수정
gomdoricake Nov 11, 2025
dd80aaf
fix: ssl 인증서 경로 api.scoopadive.com 으로 변경
gomdoricake Nov 11, 2025
c5f1fb5
add: location /swagger.json /swagger.yaml 추가
gomdoricake Nov 12, 2025
3bab054
fix: 장고 OpenAPI 스펙 url 변경
gomdoricake Nov 12, 2025
086f8a6
add: ai 앱 이름 recommend로 변경 후 비동기 OpenAI 처리 추가 구현
gomdoricake Nov 12, 2025
8ed5ab2
add: requirements.txt 에 aiohttp 모듈 추가
gomdoricake Nov 12, 2025
0246456
add: requirements.txt 에 aiohttp 모듈 추가
gomdoricake Nov 12, 2025
f1e7b32
fix: 비동기 함수 실행을 동기처럼 변환 (asgiref.sync.async_to_sync)
gomdoricake Nov 12, 2025
42a865b
add: requirements.txt 에 S3 에 필요한 패키지 (django-storages[boto3], boto3) 추가
gomdoricake Nov 13, 2025
b2a8939
add: S3 버킷 관련 환경변수 설정
gomdoricake Nov 13, 2025
4da79cd
Update deploy.yml
gomdoricake Nov 13, 2025
80dd3e4
feat: Photo S3 이미지 업로드 앱 구현
gomdoricake Nov 13, 2025
f7344ad
Merge branch 'deploy' of https://github.com/ScoopADive/Backend into d…
gomdoricake Nov 13, 2025
4b9beb9
fix: router url 에서 오타 수정 photos -> photo
gomdoricake Nov 13, 2025
7b2d33d
fix: photo router url 변경
gomdoricake Nov 13, 2025
32a3b23
fix: photo router url 변경
gomdoricake Nov 13, 2025
bcc25c9
chore: 띄어쓰기 등 변화
gomdoricake Nov 14, 2025
89af0b5
add: Logbook likes 에 비동기식 방법 구현
gomdoricake Nov 14, 2025
72326cc
Merge branch 'develop' into deploy
gomdoricake Nov 14, 2025
2f82a29
add: 서버 부하 및 CPU 사용량/병렬 처리 테스트용 k6 추가
gomdoricake Nov 14, 2025
4cbf8e6
add: 서버 부하 및 CPU 사용량/병렬 처리 테스트용 k6 추가
gomdoricake Nov 14, 2025
27bd2c8
fix: photo 에 generate_presigned_url Url 추가
gomdoricake Nov 14, 2025
5373c93
fix: 로그인 url 마지막에 / 추가
gomdoricake Nov 14, 2025
f3436ee
add: k6 에 가상 사용자 옵션 추가
gomdoricake Nov 14, 2025
f8539e9
add: k6 병렬처리 실험을 위한 CMD 수정
gomdoricake Nov 14, 2025
545ab47
add: requirements.txt 에 uvicorn 추가
gomdoricake Nov 14, 2025
50ab061
add: Logbook 모델에 dive_image_url 필드 추가
gomdoricake Nov 14, 2025
23c4a27
fix: docker-compose 에서 async 병렬처리 적용 가능하도록 command 변경
gomdoricake Nov 14, 2025
a869b11
feat: LikesAsyncView 개발
gomdoricake Nov 14, 2025
698117c
fix: S3 presigned URL 시리얼라이저 문제 수정
gomdoricake Nov 14, 2025
15eff35
fix: latency 측정을 위한 worker 수 4개로 증가
gomdoricake Nov 14, 2025
568ff96
fix: latency 측정을 위한 worker 수 8개로 증가
gomdoricake Nov 14, 2025
f6967cb
fix: Photo 및 Logbook 에서 image url 필드 타입을 URLField 에서 CharField 로 변경
gomdoricake Nov 14, 2025
e65be18
feat: Celery 와 Redis 설정 추가
gomdoricake Nov 15, 2025
2be75c4
fix: Redis, Celery 테스트를 위한 js 파일 수정
gomdoricake Nov 15, 2025
ec05ffc
fix: Redis, Celery 테스트를 위한 js 파일 수정
gomdoricake Nov 15, 2025
29fd4ae
add: Logbook 뷰 처리에 Redis 캐시 적용
gomdoricake Nov 15, 2025
4d19921
Merge branch 'develop-optimization' into deploy
gomdoricake Nov 15, 2025
3c245e3
add: Redis Cache 관련 설정 추가
gomdoricake Nov 15, 2025
69a498a
Update deploy.yml
gomdoricake Nov 17, 2025
e66bcfe
feat: 물고기 분류 Fishial API 호출 기능 개발
gomdoricake Nov 17, 2025
de806c9
Merge branch 'develop-fishial' into deploy
gomdoricake Nov 17, 2025
a7f3b2d
Merge branch 'deploy' of https://github.com/ScoopADive/Backend into d…
gomdoricake Nov 17, 2025
9fb3600
fix: PhotoViewSet 의 classify 수정
gomdoricake Nov 17, 2025
8a07208
fix: Fishial API 에러 테스트를 위한 테스트 코드
gomdoricake Nov 17, 2025
af52317
fix: generate_presigned_url 다시 추가
gomdoricake Nov 17, 2025
9e008d6
fix: Fishial API 에러 테스트를 위한 테스트 코드
gomdoricake Nov 17, 2025
67b4b0e
fix: direct-upload.url 로 PUT 요청 추가
gomdoricake Nov 17, 2025
417276d
add: Photo 객체에 classified_as 필드 추가
gomdoricake Nov 17, 2025
440e2c9
add: Photo 객체에 classified_as 필드 추가
gomdoricake Nov 17, 2025
dadd626
add: Photo 객체에 classified_as 필드 추가
gomdoricake Nov 17, 2025
d3785c7
fix: migrations 꼬임 문제를 해결하기 위해 photo migrations 파일 삭제
gomdoricake Nov 17, 2025
575e1e4
add: generate_presigned_url 추가
gomdoricake Nov 17, 2025
00177c0
add: Photo 모델에 classified_as 필드 추가
gomdoricake Nov 17, 2025
41c35b2
fix: classified_as 필드가 GET 요청 때만 드러나도록 수정
gomdoricake Nov 17, 2025
1f49ee6
fix: PhotoViewSet의 classify 수정
gomdoricake Nov 17, 2025
f74bbe1
UPDATE README.md: system architecture
gomdoricake Nov 21, 2025
ffe57e6
Update README.md
gomdoricake Dec 15, 2025
ceb24d8
Update README.md
gomdoricake Dec 15, 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
93 changes: 93 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Scoopadive Deploy to Lightsail

on:
push:
branches:
- deploy

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/scoopadive:latest
build-args: |
BUILDKIT_INLINE_CACHE=1
no-cache: true

- name: SSH and deploy using docker-compose
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.LIGHTSAIL_HOST }}
username: ubuntu
key: ${{ secrets.LIGHTSAIL_SSH_KEY }}

script: |
echo "==> 이동: /home/ubuntu/Backend"
cd /home/ubuntu/Backend

echo "==> 환경변수 파일 생성 (.env)"
cat <<EOF > .env
GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_REDIRECT=${{ secrets.GOOGLE_REDIRECT }}
GOOGLE_CALLBACK_URI=${{ secrets.GOOGLE_CALLBACK_URI }}
GOOGLE_SECRET=${{ secrets.GOOGLE_SECRET }}

AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_STORAGE_BUCKET_NAME=${{ secrets.AWS_STORAGE_BUCKET_NAME }}
AWS_S3_REGION_NAME=${{ secrets.AWS_S3_REGION_NAME }}
AWS_S3_SIGNATURE_VERSION=${{ secrets.AWS_S3_SIGNATURE_VERSION }}

WP_CLIENT_ID=${{ secrets.WP_CLIENT_ID }}
WP_CLIENT_SECRET=${{ secrets.WP_CLIENT_SECRET }}
WP_REDIRECT_URI=${{ secrets.WP_REDIRECT_URI }}
WP_REDIRECT_URI_SWAGGER=${{ secrets.WP_REDIRECT_URI_SWAGGER }}

DB_NAME=${{ secrets.DB_NAME }}
DB_USER=${{ secrets.DB_USER }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}

SECRET_KEY=${{ secrets.SECRET_KEY }}

OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}

FISHIAL_CLIENT_ID=${{ secrets.FISHIAL_CLIENT_ID }}
FISHIAL_CLIENT_SECRET=${{ secrets.FISHIAL_CLIENT_SECRET }}

EOF

echo "==> 최신 이미지 Pull"
sudo docker-compose pull web

echo "==> 기존 컨테이너 중지 및 제거"
sudo docker-compose down

echo "==> 최신 이미지 기반 컨테이너 다시 실행"
sudo docker-compose up -d

echo "==> 마이그레이션 실행"
sudo docker-compose exec -T web python manage.py migrate

echo "✅ 배포 완료!"
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
db.sqlite3
.env
secrets.json

# Python 관련 캐시 파일들
__pycache__/
*.pyc
*.pyo

# Django Migrations — init 파일은 포함하고, 나머지만 제외
**/migrations/*.pyc
**/migrations/*.pyo
**/migrations/__pycache__/
!**/migrations/__init__.py

# Visualized Graphviz Files
*.dot
*.png
swagger.html
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .idea/scoopadive-backend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

WORKDIR /scoopadive

# -----------------------------
# 시스템 패키지 설치
# -----------------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
locales \
&& rm -rf /var/lib/apt/lists/*

# -----------------------------
# UTF-8 locale 설정
# -----------------------------
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen

ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

# -----------------------------
COPY requirements.txt /scoopadive/
RUN pip install --upgrade pip && pip install -r requirements.txt

COPY . /scoopadive/

EXPOSE 8000

CMD ["gunicorn", "scoopadive.wsgi:application", "-k","uvicorn.workers.UvicornWorker", "--workers", "1","--bind", "0.0.0.0:8000"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Backend
# System Architecture

<img width="4865" height="1971" alt="scoopadive_stack_readme" src="https://github.com/user-attachments/assets/1d763476-7b90-4879-b021-7438478ffcad" />
Empty file added accounts/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions accounts/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions accounts/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AccountsConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "accounts"
Empty file added accounts/migrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions accounts/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions accounts/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
10 changes: 10 additions & 0 deletions accounts/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

from django.urls import path, include
from .views import GoogleLoginView, GoogleCallbackView

app_name = "accounts"

urlpatterns = [
path('google/login/', GoogleLoginView.as_view(), name='google_login'),
path('google/callback/', GoogleCallbackView.as_view(), name='google_callback'),
]
116 changes: 116 additions & 0 deletions accounts/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import requests
from django.http import JsonResponse
from django.shortcuts import redirect
from rest_framework.views import APIView
from rest_framework import permissions
from rest_framework_simplejwt.tokens import RefreshToken
from allauth.socialaccount.models import SocialAccount
from auths.models import User
from scoopadive.settings import GOOGLE_REDIRECT, GOOGLE_CLIENT_ID, GOOGLE_CALLBACK_URI, GOOGLE_SECRET

FRONTEND_URL = "https://scoopadive.com" # 메인 페이지 URL


# --------------------------
# 1. 구글 로그인 시작
# --------------------------
class GoogleLoginView(APIView):
permission_classes = [permissions.AllowAny]

def get(self, request):
state = "swagger" if request.GET.get("swagger") == "1" else ""

auth_url = (
f"{GOOGLE_REDIRECT}?response_type=code"
f"&client_id={GOOGLE_CLIENT_ID}"
f"&redirect_uri={GOOGLE_CALLBACK_URI}"
f"&scope=email%20profile%20openid"
f"&access_type=offline"
f"&prompt=consent"
)
if state:
auth_url += f"&state={state}" # 👈 여기 추가
return redirect(auth_url)



# --------------------------
# 2. 구글 OAuth 콜백
# --------------------------
class GoogleCallbackView(APIView):
permission_classes = [permissions.AllowAny]

def get(self, request):
code = request.GET.get("code")
state = request.GET.get("state")

if not code:
return redirect(f"{FRONTEND_URL}/login?error=auth_code_missing")

# 1️⃣ 구글 토큰 요청
token_data = {
"code": code,
"client_id": GOOGLE_CLIENT_ID,
"client_secret": GOOGLE_SECRET,
"redirect_uri": GOOGLE_CALLBACK_URI,
"grant_type": "authorization_code",
}
token_req = requests.post("https://oauth2.googleapis.com/token", data=token_data)
if token_req.status_code != 200:
return redirect(f"{FRONTEND_URL}/login?error=token_request_failed")

access_token = token_req.json().get("access_token")
if not access_token:
return redirect(f"{FRONTEND_URL}/login?error=no_access_token")

# 2️⃣ 구글 유저 정보 가져오기
user_info_req = requests.get(
"https://www.googleapis.com/oauth2/v1/userinfo",
params={"access_token": access_token},
)
if user_info_req.status_code != 200:
return redirect(f"{FRONTEND_URL}/login?error=userinfo_request_failed")

user_info = user_info_req.json()
email = user_info.get("email")
username = user_info.get("name") or email.split("@")[0]
uid = user_info.get("id")
if not email:
return redirect(f"{FRONTEND_URL}/login?error=no_email")

# 3️⃣ User 생성 or 가져오기
user, _ = User.objects.get_or_create(
email=email,
defaults={"username": username, "is_active": True}
)

# 4️⃣ SocialAccount 연결
SocialAccount.objects.get_or_create(
provider="google",
uid=uid,
defaults={"user": user, "extra_data": user_info}
)

# 5️⃣ JWT 발급
refresh = RefreshToken.for_user(user)
access_token_str = str(refresh.access_token)

# 6️⃣ Swagger 모드면 JSON 반환
if state == "swagger": # 👈 Swagger 모드일 때만 JSON
return JsonResponse({
"access": access_token_str,
"refresh": str(refresh),
"email": email,
"username": username,
"id": user.id,
})

# 7️⃣ 기본은 프론트엔드로 redirect
frontend_redirect_url = (
f"{FRONTEND_URL}/oauth2/redirect?"
f"token={access_token_str}"
f"&email={email}"
f"&name={username}"
f"&id={user.id}"
)
return redirect(frontend_redirect_url)
Empty file added auths/__init__.py
Empty file.
Loading
Loading