exchangediary / exchange-diary Goto Github PK
View Code? Open in Web Editor NEWExchangeDiary backend server
License: MIT License
ExchangeDiary backend server
License: MIT License
작성 순서 GET api
로컬에서 go 서버 실행 및 로컬 db에서 실행
$ make run
docker compose 기반으로 로컬에서 실행가능
$ make down && make up
실제 배포할 서버
sandbox
페이즈에서 사용하는 db와 동일한 db를 바라본다. (돈 때문에)google cloud-build
를 사용해서, cloudbuild.yml에 세팅되어있는 정보를 기반으로 cloud run에 자동 배포 (/main 브랜치 push 시 트리거 발동)Diary API
GET /v1/members/verify?nickname=%s
#22 에 대한 후속 처리
{
code: str,
message: str,
data: {}
}
log level error를 넘어가면 slack으로 알림 발송
google cloud task에서 아래 TASK특성
으로 인해, 아래 방향으로 커밋을 수정해야함.
1. 다이어리방의 period를 수정하더라도, 다음 턴 부터 잗성주기가 적용된다. (원래 스펙이며, 1hr 제약조건을 만족한다.)
2. 1을 위해서 delete -> create task 과정을 진행하는 코드는 제거한다 (UpdateTask 스펙)
google cloud run은 기본적으로 stateless container
이다. 즉 컨테이너가 상태를 들고 있으면 안된다.
즉 alarm을 실행하기 위한 워커를 백그라운드에서 실행 하든지, google cloud storage
와의 connection을 들고있는 client를
gin 서버 init 시점에 들고 있으면 안된다는 뜻이다.
local에서 실행 할 때는 물론 로컬에서 cloud run을 대신해서 프로세스가 돌고 있었기 때문에, 문제가 없지만, 분명 cloud run에 배포가 되고 request가 유지가 되지 않는 시점에 파일 업로드 api 요청을 보내면 문제가 생길 듯하다.
우선 이런 가정만 해두고, 문제가 생기면 issue를 해결하도록하자.
해결방법은 느려지긴 하지만, google storage client에게 request가 들고있는 context를 주든지, 아니면 context.background()를 주는 방법이 있을 듯하다.
GET /v1/alarms
POST /token 요청을 보낼때, authCode랑 deviceToken(string)을 클라에서 준다.
서버에서는 authCode의 유저가 deviceToken을 기존에 db에 저장하고 있지만, post로 전달 된 deviceToken을 가지고 있지 않는다면 다중 디바이스로 간주하고 추가.
이후 서버쪽에서 파이어베이스(FCM)로 메시지 보낼 때, 토큰 만료 메시지 받는 경우에는 해당 deviceToken은 만료되었다고 간주하고, 삭제
약관은 클라이언트와 미리 약속한 ID 또는 키워드로 약관 동의를 받도록 한다.
서버에서는 POST /members 시점에 필수약관들 모두 체크했는지만 검사하고, 따로 db에 저장하지 않아도 될 것 같다.
Ios
: APNsAos
: FCM(firebase) or GCM(google cloud)A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.