<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 장아령 on Medium]]></title>
        <description><![CDATA[Stories by 장아령 on Medium]]></description>
        <link>https://medium.com/@dkfud2121?source=rss-11d27d0a7794------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*enfL2Ugjuix0OhVi</url>
            <title>Stories by 장아령 on Medium</title>
            <link>https://medium.com/@dkfud2121?source=rss-11d27d0a7794------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:06:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dkfud2121/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[JWT token, 이것만은 알고 가자!]]></title>
            <link>https://medium.com/@dkfud2121/jwt-token-%EC%9D%B4%EA%B2%83%EB%A7%8C%EC%9D%80-%EC%95%8C%EA%B3%A0-%EA%B0%80%EC%9E%90-d96a49fbcabe?source=rss-11d27d0a7794------2</link>
            <guid isPermaLink="false">https://medium.com/p/d96a49fbcabe</guid>
            <category><![CDATA[jwt]]></category>
            <dc:creator><![CDATA[장아령]]></dc:creator>
            <pubDate>Tue, 29 Aug 2023 07:56:32 GMT</pubDate>
            <atom:updated>2023-08-29T07:57:10.880Z</atom:updated>
            <content:encoded><![CDATA[<h3>✅ 세션과 차이</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DC_u-T51AzMFHDUvI0v6Fg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RD_ZHDuUI3xoqzWSvve4Kg.png" /><figcaption>with JWT token</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLUgrJzX7qV2TAdbNwsKzQ.png" /><figcaption>without JWT token</figcaption></figure><h3>✅ JWT 구조</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LyWSCb8r0_9CUwaCBDDR3Q.png" /></figure><ol><li>Header</li></ol><ul><li>JWT 에서 사용할 타입과 해시 알고리즘 종류</li></ul><p>2. Payload</p><ul><li>서버에서 첨부한 사용자 권한 정보와 사용자 데이터</li><li>Claim : “…” : “…” : key-value의 한 쌍</li></ul><p>3. Signature(서명)</p><ul><li>토큰의 변조는 signature 영역에서 해결</li><li>Sinature는 인코딩 된 header, payload, secret을 합친 뒤 이를 header에 지정한 알고리즘으로 해싱</li><li>Signature가 만들어지기 위해서는 인코딩 된 header, 인코딩 된 payload 그리고 secret이 필요</li><li>header와 payload, secret 값 중 어느 하나라도 일치하지 않으면 signature는 완전히 다른 값을 갖게 됩니다.</li><li>Header, Payload 를 Encode를 한 이후 Header 에 명시된 해시함수를 적용하고, 개인키(Private Key)로 서명한 전자서명</li></ul><p>Simple JWT에서는 secret으로 Django 프로젝트마다 사용하는 secret_key를 기본으로 이용.&gt; setting.py에서 확인 가능!</p><h3>✅ JWT 토큰 전달 및 검증</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D7Mbuq_WP4FU-r3nRtAc7A.png" /></figure><ol><li><strong>회원가입/로그인 시도</strong> → 클라이언트: refresh_token, access_token 반환</li><li><strong>로그인 필요한 서비스</strong> → (<em>로그인 한 상태라 가정</em>) 클라이언트: HTTP Header 에 토큰을 담아 서버로 전달 — 우리 서비스는 access token을 헤더에 담는다.</li><li><strong>JWT 검증_서버</strong>: header, payload, secrete을 이용해 signature를 해싱한 뒤 JWT의 Signature와 같은 지 확인</li></ol><blockquote><em>만약 payload 변조 시 : 클라이언트에서 전송한 signature와 서버에서 해싱한 signature가 다름</em></blockquote><blockquote><em>🔥토큰 검증 시 payload에 담긴 유저 정보를 통해 유저 틍정 후 인증된 유저 처리</em></blockquote><blockquote><em>→ JWT 인증은 별도의 DB 탐색 없이도 빠르게 유저 인증 수행</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F3BWTeM6pP3aPqF76fmZQQ.png" /><figcaption>회원가입, 로그인 시 refresh, access 토큰 발급</figcaption></figure><blockquote><em>사용자가 로그아웃 시도하면 해당 토큰은 blacklist 에 올려서 재사용 불가</em></blockquote><h3>✅ Access Token 과 Refresh Token</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oai81IeTzPRvyrRXEIQCEw.png" /></figure><blockquote><em>만약!</em></blockquote><p>client : 만료된 Access Token과 Refresh Token 전송</p><p>→ 서버: 저장된 Refresh Token 과 수신한 Refresh Token 비교</p><p>→ 일치할 시 Access Token 재발급</p><h3>✅ Access Token &amp; Refresh Token 동작 과정</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RQ1h6wdI34d9KUZQFsqb0w.png" /></figure><h3>코드로 살펴보자!</h3><pre>잠깐) 토큰 유효시간 설정<br>setting.py에서 설정 가능!<br>SIMPLE_JWT = {<br>    &#39;ACCESS_TOKEN_LIFETIME&#39;: timedelta(minutes=5),<br>    &#39;REFRESH_TOKEN_LIFETIME&#39;: timedelta(days=90),<br>	...</pre><p><a href="https://velog.io/@vamos_eon/JWT%EB%9E%80-%EB%AC%B4%EC%97%87%EC%9D%B8%EA%B0%80-%EA%B7%B8%EB%A6%AC%EA%B3%A0-%EC%96%B4%EB%96%BB%EA%B2%8C-%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94%EA%B0%80-%EC%82%AC%EC%9A%A9%EC%B2%982">JWT란 무엇인가? 그리고 어떻게 사용하는가? (2) — 사용처</a></p><p><a href="https://velog.io/@gimminjae/JWT%EB%9E%80-%EC%99%9C-%EC%82%AC%EC%9A%A9%ED%95%A0%EA%B9%8C-%EC%9E%A5%EB%8B%A8%EC%A0%90%EC%9D%80">JWT란? 왜 사용할까? 장단점은?</a></p><p><a href="https://jwt.io/">JWT.IO</a></p><p><a href="https://prolog.techcourse.co.kr/studylogs/2272">우아한테크코스 학습로그 저장소</a></p><p><a href="https://r4bb1t.tistory.com/38">[인증] JWT로 로그인 인증 1. 쿠키에 저장하기</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d96a49fbcabe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2023SB Summer BootCamp Team-J]]></title>
            <link>https://medium.com/@dkfud2121/2023sb-summer-bootcamp-team-j-8a03b6340464?source=rss-11d27d0a7794------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a03b6340464</guid>
            <category><![CDATA[projects]]></category>
            <dc:creator><![CDATA[장아령]]></dc:creator>
            <pubDate>Fri, 04 Aug 2023 19:06:11 GMT</pubDate>
            <atom:updated>2023-10-04T12:31:20.535Z</atom:updated>
            <content:encoded><![CDATA[<h3>This is 4 you</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D4feyewNHWqnHYWF.jpeg" /></figure><blockquote><strong><em>서비스 소개</em></strong></blockquote><p>우리의 서비스는 사용자가 4장의 사진을 만화 그림체로 바꾸고 이를 4컷 프레임에 삽입할 수 있는 플랫폼입니다. 사용자는 그림을 텍스트나 기타 장식으로 더 꾸밀 수 있으며, 최종 결과물을 앨범 형식으로 저장할 수 있습니다.</p><blockquote><strong><em>시스템 아키텍처</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tCB9FPdY7nMLm3yS.png" /></figure><p>시스템 아키텍처는 우리의 서비스의 다양한 구성 요소를 효율적으로 처리할 수 있도록 설계되었습니다. 리액트와 스타일드 컴포넌트로 구성된 프론트엔드는 사용자 친화적인 인터페이스를 제공하여 변환 및 사용자 정의 과정을 원활하게 수행합니다. 백엔드에서는 장고와 django Rest Framework를 사용하여 API 엔드포인트 및 데이터 처리를 관리합니다. 구니콘은 장고 애플리케이션의 WSGI 서버로서 고성능과 안정성을 제공합니다. 엔진엑스는 클라이언트 요청을 백엔드로 전달하는 리버스 프록시 서버로 동작하며 정적 파일 서빙을 담당하여 로딩 속도를 개선합니다.</p><blockquote><strong>비동기 처리를 통한 Latency 감소</strong></blockquote><p>우리 서비스의 핵심 기능인 이미지 변환 시 Latency가 1분에 가까워 사용자 이탈율이 높아질 것으로 예상했습니다. 이 문제는 총 네개의 이미지를 세개의 AI 변환 모델에 각각 삽입하기 때문에 발생하는 문제였습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tyNdnEZYImMZgT_dStRlRQ.png" /></figure><p>이 문제를 해결하기 위해 비동기 처리 방식을 채택했습니다.</p><p>백그라운드 작업인 이미지 처리와 렌더링과 같은 비동기 작업을 처리하기 위해 <strong>Celery</strong>를 사용합니다. 이는 <strong>RabbitMQ</strong> 메시지 브로커와 함께 작동하여 작업을 여러 워커로 분산 처리하여 응답 시간을 줄이고 애플리케이션의 전반적인 성능을 향상시킵니다. 그 결과 AI 모델에서 이미지를 반환할 때 Latency를 1분대에서 10초대로 줄일 수 있었습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dq-W4FZMVgJ6D3i8EKcvUQ.png" /></figure><p>시스템의 건강 상태와 성능을 모니터링하기 위해 <strong>프로메테우스</strong>, 그라파나, <strong>cAdvisor</strong>를 사용합니다. 프로메테우스는 모니터링과 경고를 위한 오픈소스 시스템으로 실시간으로 웹 애플리케이션의 성능, 가용성 및 리소스 사용률을 파악합니다. 그라파나는 프로메테우스와 같은 모니터링 데이터를 시각적으로 표현하여 대시보드를 구축하는데 사용됩니다. <strong>cAdvisor</strong>는 Docker 컨테이너와 호스트 시스템의 리소스 사용량 메트릭을 수집하여 웹 애플리케이션의 성능을 최적화합니다.</p><p>개발 및 배포 프로세스에는 <strong>도커</strong>를 사용하여 컨테이너화된 애플리케이션을 만들고 배포하여 일관성 있고 이식성이 좋은 환경을 유지합니다. 도커 컨테이너를 AWS EC2 인스턴스에 배포하여 확장 가능한 가상 서버를 활용하며 효율적인 리소스 관리를 수행합니다. 사용자가 업로드한 이미지와 기타 데이터를 저장하기 위해 AWS S3를 사용합니다. 이는 데이터 관리를 용이하게 하고 안정성과 확장성을 제공합니다.</p><blockquote><strong><em>데이터베이스</em></strong></blockquote><p>본 프로젝트에서는 관계형 데이터베이스인 <strong>MySQL</strong>을 선택했습니다. 이는 무료로 사용할 수 있으며, 대용량 데이터 처리에 적합하고 빠른 처리 속도를 제공합니다. MySQL의 관계형 데이터베이스 구조는 데이터 간의 관계를 정의하고 관리하는데 유연성을 제공합니다. 이를 통해 Django 백엔드와 빠르게 통합할 수 있으며, 사용자 데이터를 효율적으로 관리하고 복잡한 쿼리를 수행할 수 있습니다. 또한, 데이터베이스의 일관성과 무결성을 보장하여 안정적인 데이터 저장 및 관리를 할 수 있습니다. MySQL은 신뢰성 있는 데이터베이스 선택으로서 프로젝트의 성공적인 완성과 운영에 기여하고 있습니다.</p><blockquote><strong><em>백엔드</em></strong></blockquote><p>회원 가입, 로그인, 로그아웃: Django의 내장 인증 시스템과 Django Rest Framework를 활용하여 사용자 인증과 권한 관리 기능을 구현했습니다. 이를 통해 ORM(Object-Relational Mapping)을 사용하여 데이터베이스와 상호작용하면서 데이터베이스의 테이블을 객체로 쉽게 다룰 수 있었습니다. ORM의 장점은 SQL 쿼리 작성 대신 Python 객체와 메서드를 활용하여 데이터베이스 조작을 수행할 수 있어 개발자들이 간편하고 직관적으로 데이터를 관리할 수 있었습니다. 또한 데이터베이스의 변경 사항을 자동으로 추적하여 데이터 일관성과 무결성을 보장하고 복잡한 쿼리를 추상화하여 개발 생산성을 향상시켰습니다. JWT 토큰을 사용하여 사용자 데이터를 보호하고 원활한 회원 가입 및 로그인 경험을 제공했습니다.</p><p>이미지 처리, 사용자 정의 및 앨범 관리와 같은 다양한 작업을 처리하기 위해 API 엔드포인트를 구현했습니다. ORM의 활용으로 데이터베이스와의 상호작용을 단순화하고 모델과 관련된 작업들을 보다 쉽게 구현할 수 있었습니다. 모든 API는 Swagger를 통해 문서화되어 팀원들이 API를 효과적으로 이해하고 사용할 수 있습니다. ORM을 통해 추상화된 데이터베이스 조작은 API의 개발과 유지보수를 간편하게 하고, 프론트엔드와의 데이터 통신을 원활하게 하여 더 나은 사용자 경험을 제공할 수 있었습니다.</p><blockquote><strong><em>프론트엔드</em></strong></blockquote><p>회원 가입, 로그인 페이지: 프론트엔드는 사용자 친화적인 회원 가입 및 로그인 페이지를 제공하여 사용자가 안전하게 계정을 만들고 로그인할 수 있도록 합니다. 사용자가 필요한 정보를 입력하고, 유효성을 검사하는 기능을 구현하여 신속하고 원활한 회원 가입과 로그인 프로세스를 지원합니다.</p><p>프론트엔드는 이미지 업로드, 사용자 정의 및 최종 결과물을 앨범 형식으로 저장하는 다양한 페이지를 제공합니다. 사용자가 이미지를 업로드하면, htmlToCanvas 라이브러리를 활용하여 사용자가 커스텀한 이미지를 하나의 이미지로 저장합니다. 이렇게 변환된 이미지는 앨범 형식으로 저장되어 사용자가 언제든지 다시 확인하고 공유할 수 있습니다. React Router를 활용하여 이러한 페이지 간의 원활한 이동을 보장하여 사용자 경험을 향상시킵니다. 사용자가 직접 이미지를 꾸며가며 캐릭터를 만들고, 그 결과물을 앨범 형태로 저장하고 공유할 수 있어 창의적인 콘텐츠를 제작하고 공유하는 재미를 느낄 수 있습니다.</p><blockquote><strong><em>프로젝트에 사용한 기타 도구</em></strong></blockquote><p><strong>프로메테우스, 그라파나, cAdvisor</strong>를 이용하여 시스템의 성능과 리소스 사용량을 실시간으로 모니터링합니다. 이를 통해 우리는 서비스의 안정성과 가용성을 지속적으로 감시하여 문제를 즉각적으로 대응하고 사용자들에게 더 나은 경험을 제공합니다.</p><p>부하테스트를 통해 우리의 서비스의 성능과 확장성을 검증합니다. <strong>K6</strong>를 이용하여 가상의 접속자를 모의하여 시스템에 부하를 주는 상황을 재현하고 서비스의 한계를 파악합니다. 이를 통해 사용자들이 다수일 때에도 빠르고 안정적인 서비스를 제공하고자 합니다.</p><p>모니터링과 부하테스트는 우리의 전체적인 비전을 실현하기 위한 중요한 도구로서 사용자들의 요구를 만족시키고 발전시키는데 중점을 두고 있습니다. 우리는 사용자의 피드백을 반영하여 서비스를 개선하고 최상의 품질을 제공하기 위해 지속적으로 노력하고 있습니다. 이를 통해 사용자 중심의 편리하고 빠른 이미지 변환 서비스를 제공하고자 합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W60lbq9bcn5OmL2H.png" /></figure><blockquote><strong><em>데모 영상</em></strong></blockquote><p>우리의 서비스 기능과 사용법을 보여주는 데모 영상을 준비했습니다. 이 영상에서는 이미지를 만화 그림체로 변환하고 사용자 정의하는 과정을 시연하며 최종 결과물을 앨범 형식으로 저장하는 과정을 보여줍니다.</p><p><a href="https://youtu.be/7PtvCe3YHYY">2023 Summer Bootcam Team-J 1차 demo</a></p><blockquote><strong><em>팀원들</em></strong></blockquote><p><a href="https://github.com/2023SB-TeamJ/2023SB-Team-J">https://github.com/2023SB-TeamJ/2023SB-Team-J</a></p><p>백엔드:</p><ul><li>아령: github.com<a href="https://github.com/aristo0922">@aristo0922</a></li><li>희은: github.com<a href="https://github.com/kubit2">@kubit2</a></li><li>도우: github.com@<a href="https://github.com/kimdw0823">kimdw</a>0823</li><li>지우: github.com<a href="https://github.com/alpakaka0o0">@alpakaka0o0</a></li></ul><p>프론트엔드:</p><ul><li>선재: github.com<a href="https://github.com/sunjae98">@sunjae98</a></li><li>택기: github.com<a href="https://github.com/TaekkiMin">@TaekkiMin</a></li><li>진우: github.com<a href="https://github.com/nagosu">@nagosu</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a03b6340464" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[G-Diary]]></title>
            <link>https://medium.com/@dkfud2121/g-diary-3e90e87722a2?source=rss-11d27d0a7794------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e90e87722a2</guid>
            <category><![CDATA[5-week-project]]></category>
            <category><![CDATA[sellicon-valley-bootcamp]]></category>
            <category><![CDATA[g-diary]]></category>
            <category><![CDATA[ai-drawing-diary]]></category>
            <category><![CDATA[konlpy]]></category>
            <dc:creator><![CDATA[장아령]]></dc:creator>
            <pubDate>Fri, 03 Feb 2023 14:27:07 GMT</pubDate>
            <atom:updated>2023-02-04T00:21:35.356Z</atom:updated>
            <content:encoded><![CDATA[<h3>Grim-Diary : Silicon Valley Boot Camp (23, 5week project) Team G</h3><p>일기를 작성하면 하루동안 있었던 일을 돌아보고 자기 객관화를 통해 우울감을 완화할 수 있다고 한다. 그러나 글쓰기를 어려워하는 현대인은 일기 작성을 어려워하는 경우가 부지기수다. 이에 본 프로젝트는 가벼운 마음으로 일기를 작성하고 즐거움을 느낄 수 있도록 그림일기 서비스를 구현했다.</p><p>일반적인 그림일기와 차별화한 서비스를 제공하기 위해 일기장 내용에서 명사를 추출하여 그림일기에 사용할 이미지를 추천한다. 사용자는 추천받은 이미지를 선택하여 그림일기에 추가할 수 있고, 그 위에 그림을 덧붙여 본인만의 그림을 완성할 수 있다.</p><h3>프론트 기술 소개</h3><ul><li>react</li></ul><blockquote>리액트는 가상 DOM을 사용하여 웹과 앱 프론트엔드 개발을 위한 빠른 렌더링 속도가 보장되어 사용자에게 빠른 서비스를 제공할 수 있다. 또한 각각의 독립된 모듈인 Component 기반으로 중복된 코드를 최소화하여 복잡한 UI를 효과적으로 수정가능하고 재사용이 용이하다.</blockquote><blockquote>React hook 을 이용해 state값이 변화되었을 때, 자동으로 변화 감지 후 렌더링 되어 상태관리와 상태변화가 수월하다.</blockquote><ul><li>zustand</li></ul><blockquote>react 상태 관리 라이브러리</blockquote><blockquote>한 개의 중앙에 집중된 형식의 스토어 구조를 활용하면서, 상태를 정의하고 사용하는 방법이 단순하다.</blockquote><blockquote>React에 직접적으로 의존하지 않기 때문에 자주 바뀌는 상태를 직접 제어할 수 있는 방법도 제공한다.</blockquote><h3>백엔드 기술 소개</h3><ul><li>django</li></ul><blockquote>ai 라이브러리를 활용하기 때문에 파이썬 프레임워크가 프로젝트에 적합하다고 판단했다. 플라스크는 자유도가 높아서 개발 시 신경써야 할 부분이 많아서 어렵게 느껴질 수 있다고 판단했다. 반면 장고는 orm을 통한 db 접근 가능, 빠른 개발, 빠른 배포 가능함, flask 에 비해 비교적 자유도가 낮지만 프레임워크를 처음 이용하는 팀원에게 좋은 툴이라고 판단했다.</blockquote><h3>AI 기술 소개</h3><ul><li>konlpy</li></ul><blockquote>NLP(Natural Language Processing)는 텍스트에서 의미있는 정보를 분석하고 추출하는 일련의 기술 집합이다. 본 프로젝트에서는 그중에서도 한국어 자연어 처리하는 파이썬 패키지인 KoNLPy를 사용하기로 했다.</blockquote><p>KoNLPy로 문장을 분석하는 데 사용 가능한 라이브러리는 Hannanum, Kkma, Komoran, Mecab, Twitter까지 총 5가지로 나뉜다. 이들 간 성능을 비교해봤다.</p><p>💡 “아버지가방에들어가신다”</p><p>첫번째 케이스는 띄어쓰기 없이 입력된 값에 대한 처리다. 사용자의 입력이 어떻게 들어올 지 모르기 때문에 띄어쓰기 처리 또한 중요한 요소라고 생각했다. 그 결과 Kkma, Mecab, Twitter 이 세개의 라이브러리가 유효한 값을 출력해낸다. 이 중에서 가장 괜찮은 결과를 내는 것은 Mecab 이다.</p><p>💡 <em>“아이폰 기다리다 지쳐 애플공홈에서 언락폰질러버렸다 6+ 128기가실버ㅋ”</em></p><p>사전에 없는 내용을 입력했을 때 어떻게 처리가 될까. Mecab과 Twitter에서는 인간에게 익숙한 단위로 결과를 보여준다. ‘아이폰’, ‘애플’, ‘공홈’, ‘언락폰’ 등 일상에서 자주 사용하는 언어를 출력한다. 그러나 우리의 서비스에서는 단어의 원형이 더 중요하다. 왜냐하면 그림 일기에서 그림을 제공할 때 인공지능이 그림을 그리는 것이 아닌, DB에 저장된 그림을 기반으로 적절하게 그림 리스트를 산출한다. 즉, 그림일기에서 우리가 구현 가능한 것은 ‘아이폰 언락폰 6+ 128기가 실버’ 그림을 보여주는 것이 아니라 ‘휴대폰’ 그림을 보여주는 것이다. 때문에 ‘폰’이라는 단어를 추출할 수 있는 Kkma(꼬꼬마) 라이브러리를 사용했다.</p><ul><li>celery — rabbitmq</li></ul><p>비동기 작업을 도와주는 python framework 로 worker 의 한 종류이다. celeruy 는 즉각적인 답을 주기 어려운 경우 활용하여 결과가 바로 나오지 않더라도 다음 작업을 수행할 수 있도록 한다. celery가 동작하는 동안 celery에 당도하는 task가 쌓여 중복처리, 혹은 누락 되는 경우가 있다. 이런 일을 방지하고자 redis나 rabbitmq와 같은 브로커와 함께 사용한다. 본 프로젝트는 rabbitmq를 메시지 브로커로 활용하기로 했다.</p><p>👆🏻celery와 rabbitmq를 실행할 때 rabbitmq 를 먼저 실행하고 나서 celery를 실행해야 한다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KjAU-8fKlG1p0ncZHSCoNw.gif" /><figcaption>회원가입 페이지</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*S5GoAUjDc52uPrwJjTU0mw.gif" /><figcaption>커버 사진 변경</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p48baqjkdJOgKPskD3cNeA.png" /><figcaption>사용법 안내</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*oUrbxg_ua9_ottl2MU_dIg.gif" /><figcaption>일기장 조회</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9EN4s4tv8QOi5ahP2swFsg.gif" /><figcaption>일기작성</figcaption></figure><ul><li>reference</li></ul><p><a href="https://konlpy.org/ko/latest/">https://konlpy.org/ko/latest/</a></p><ul><li>github</li></ul><p><a href="https://github.com/2023-SV-winter-bootcamp-G-Diary/G-Diary">https://github.com/2023-SV-winter-bootcamp-G-Diary/G-Diary</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e90e87722a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet The Past(MTP)]]></title>
            <link>https://medium.com/@dkfud2121/meet-the-past-mtp-9f35c1371e00?source=rss-11d27d0a7794------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f35c1371e00</guid>
            <dc:creator><![CDATA[장아령]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 16:58:53 GMT</pubDate>
            <atom:updated>2022-09-30T16:58:53.620Z</atom:updated>
            <content:encoded><![CDATA[<h3>프로젝트 기간 <strong>2022–08–27 ~2022–10–01</strong></h3><p>찢겨지고 구겨진 추억의 이미지가 있으신가요?</p><p>누군가의 기억과 가까운 모습으로 추억을 되살려드리겠습니다.</p><p>사진을 원형에 가까운 모습으로 복구해드리는 서비스를 이용해보세요</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*pdxXTxvkYMM8qqJ1" /></figure><p><strong>소프트웨어 아키텍처</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*_uJl_mKOyKYqVhUw" /></figure><p><strong>기술 스택</strong></p><ul><li><strong>Frontend</strong>: React, typescript, redux</li><li><strong>Backend:</strong> Django, Django-Rest-FrameWork</li><li><strong>Web Server:</strong> Nginx</li><li><strong>WSGI:</strong> Gunicorn</li><li><strong>AI:</strong> Pythorch, dlib, OpenCV</li><li><strong>DB:</strong> PostgreSQL</li><li><strong>Deployment:</strong> Docker, AWS EC2, AWS S3</li><li><strong>API Test:</strong> Postman</li><li><strong>API Documentation:</strong> Swagger</li><li><strong>Monitoring:</strong> Prometheus, Grafana</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8u0Kjjel6fgkOHf-" /></figure><h3>AI (Deep Latent Space Translation)</h3><p>참조 <em>— </em><a href="https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life"><em>https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life</em></a><em> </em><a href="https://www.researchgate.net/publication/344261043_Old_Photo_Restoration_via_Deep_Latent_Space_Translation"><em>https://www.researchgate.net/publication/344261043_Old_Photo_Restoration_via_Deep_Latent_Space_Translation</em></a></p><p><strong>React</strong></p><ol><li>빠른 렌더링 속도</li></ol><p>리액트는 가상 DOM을 사용하여 웹과 앱 프론트엔드 개발을 위한 빠른 렌더링 속도가 보장되어 사용자에게 빠른 서비스를 제공할 수 있습니다</p><p>2. Component 기반의 디렉토리 구조</p><p>재사용이 가능한 각각의 독립된 모듈인 Component 기반으로 중복된 코드를 최소화하여 복잡한 UI를 효과적으로 수정가능하고 재사용이 용이합니다.</p><p>3. React Hooks</p><p>Hooks[State Hook, Effect Hook 등] 라이브러리를 이용하여 state값이 변화되었을 때, 자동으로 변화 감지 후 렌더링 되어 상태관리와 상태변화가 수월합니다.</p><p><strong>Redux</strong></p><p>세션을 통한 데이터 관리는 안정성 및 시간측면에서 비 효율적이라는 단점이 있습니다.</p><ol><li>데이터의 중앙화가 가능</li><li>전역 상태를 관리하는데 매우 효과적이다. 우리 프로젝트에서는 TaskId, 토큰 정보 및 유저정보를 Redux를 통해 전역변수로 관리하였습니다.</li><li>단방향 모델링</li></ol><ul><li>action - dispatch를 통한 단방향의 상태값 업데이트는 에러를 찾기 쉽고 디버깅에 용이합니다.</li></ul><p>특히 모든 페이지에서 공통으로 관리하는 UserEmail 및 토큰정보를 전역변수로 관리하여 리덕스 사용에 의한 이점을 살려 프로젝트에 적용하였습니다.</p><h3>Backend</h3><p><strong>Celery, Redis, RabbitMq</strong></p><p>Celery는 시간이 오래 걸리는 AI관련 작업을 각각 worker에 분배하여 비동기로 처리함으로써 다음 요청을 지체없이 받을 수 있습니다.</p><p>Celery 처리 결과물에 대한 스토어로 Redis를 사용했습니다.</p><p>메모리 DB이기 때문에 AI처리결과의 빠른 조회가 가능했으며 추가로 Postgre의 읽기 부하를 감소시킬 수있었습니다.</p><p>RabbitMQ는 트래픽이 많아졌을 때 데이터를 큐에 적재하여 완충역할을 해주기에 사용했습니다.</p><p><strong>Django, Restframework 사용이유</strong></p><ol><li>파이썬 프로젝트를 쉽게 발전시킬 수 있습니다.</li></ol><p>파이썬 프로젝트를 웹 기반으로 발전시키기 쉽고 웹 개발에 웹 크롤링을 이용한 인공지능 분야의 파이썬 라이브러리를 적극적 활용할수 있습니다.</p><p>2. 웹 개발 입문자의 진입 장벽을 낮춰줍니다.</p><p>웹서버를 설치하지 않고 파이썬 명령어 하나로 서버를 실행할 수 있고, 데이터베이스를 추가로 설치하지 않고, 파이썬 코드로 데이터베이스를 충분히 다룰수 있습니다.</p><p>3. 관리자 페이지를 기본적으로 제공합니다.</p><p>관리자 페이지를 통해 개발중인 웹사이트의 데이터베이스 구조를 쉽게 파악할수 있고, 내용의 수정 및 삭제가 가능합니다.</p><p>4. 보안 기능을 기본적으로 제공합니다.</p><p>장고 보안 가이드에 따라 웹 개발을 진행하게 되므로 보안 실수를 하지 않게 됩니다</p><p>5. DRF를 사용하게 되면, view 와 model사이에 serializer라는 것을 사용하게 되며 View에서 Serializer를 가져와서 사용하게 되면 Model에서 꺼낸 데이터를 Queryset의 형태가 아니라 json형태로 데이터를 받아올수 있습니다.</p><h3>DB</h3><p><strong>PostgreSQL 사용 이유</strong></p><ol><li>표준 SQL준수</li></ol><p>SQLite or MySQL보다 표준에 좀더 가깝게 구현하는 것을 목표로 한다. 전체 핵심 SQL:2011 규정에 필요한 179개의 기능중 160개를 지원하며 긴 목록의 선택적 기능도 지원합니다.</p><p>2. 오픈소스 및 커뮤니티가 이끄는 데이터 베이스입니다.</p><p>완전한 오픈소스 프로젝트인 PostgreSQL의 소스코드는 대규모 헌신적인 커뮤니티에서 개발 되었다. DBMS 작업하는 방법을 설명하는 공식문서, 위치, 수많은 리소스를 유지 관리하고 기여합니다.</p><p>3. 확장성이 뛰어납니다.</p><p>사용자는 카탈로그 기반 작업과 동적 로드 사용을 통해 PostgreSQL을 프로그래밍 방식으로 즉시 확장할 수 있습니다. 공유 라이버리와 같은 객체 코드 파일을 지정할 수 있고 필요에 따라 로드할수도 있습니다.</p><p><strong>실행 방법</strong></p><p>1단계 — yarn모듈 설치</p><pre>git clone --recursive &lt;https://github.com/Meet-the-past/docker.git&gt;cd docker/frontend<br>yarn</pre><p>2단계 — AI 모듈 설치 (<a href="https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life">https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life</a>)</p><pre>cd ../backend<br>mkdir ai<br>cd aicd Face_Enhancement/models/networks/<br>git clone &lt;https://github.com/vacancy/Synchronized-BatchNorm-PyTorch&gt;<br>cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .<br>cd ../../../<br>cd Global/detection_models<br>git clone &lt;https://github.com/vacancy/Synchronized-BatchNorm-PyTorch&gt;<br>cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .<br>cd ../../<br>Download the landmark detection pretrained modelcd Face_Detection/<br>wget &lt;http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2&gt;<br>bzip2 -d shape_predictor_68_face_landmarks.dat.bz2<br>cd ../<br>Download the pretrained model, put the file Face_Enhancement/checkpoints.zip under ./Face_Enhancement, and put the file Global/checkpoints.zip under ./Global. Then unzip them respectively.cd Face_Enhancement/<br>wget &lt;https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip&gt;<br>unzip face_checkpoints.zip<br>cd ../<br>cd Global/<br>wget &lt;https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip&gt;<br>unzip global_checkpoints.zip<br>cd ../../../../</pre><p>3단계 — 도커 실행</p><pre>docker-compose -f docker-compose.prod.yml up -d --build</pre><p>모니터링 설명</p><h3>힘들었던 점 &amp; 느낀점</h3><p>5주의 짧은 기간과 학업과 병행하던 탓에 프로젝트 진행이 쉽지 않았습니다.</p><p>Docker, Nginx, Gunicorn, React, Django를 처음 배우고 협업하는 과정에서 많은 어려움이 있었지만</p><p>구글링 및 멘토님께 물어보며 배운 것을 끊임없이 찾으려고 노력한 끝에 결과물을 완성할 수 있었습니다.</p><h3>프로젝트를 통해 얻은것들</h3><p>이 프로젝트를 하면서 웹과 서버가 어떻게 작동하는지 깨달았습니다.</p><p>다른 팀원의 코드를 보고, 연결하는 과정을 살펴보며, 수업에서만 듣던 데이터 통신과 연결이 어떻게 이루어졌는지 알아보는 좋은 시간이었습니다.</p><p>실제로 Git, Github, Notion, Slack과 같은 팀 협업 도구를 사용하여 프로젝트 진행에 필요한 협업 태도 및 기술을 배울 수 있는 좋은 기회가 되었습니다.</p><p><strong>팀 소개</strong></p><p><a href="https://github.com/teawon">정태원</a> <a href="https://github.com/hyeokinen">김건혁</a> <a href="https://github.com/chloe1129">이채현</a> <a href="https://github.com/SeongbinPark">박성빈</a> <a href="https://github.com/PARK-Su-yeon">박수연</a> <a href="https://github.com/aristo0922">장아령</a></p><p>깃허브 주소</p><p><a href="https://github.com/Meet-the-past/">https://github.com/Meet-the-past/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f35c1371e00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet The Past(MTP)]]></title>
            <link>https://medium.com/@dkfud2121/meet-the-past-mtp-9f3df63c4217?source=rss-11d27d0a7794------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f3df63c4217</guid>
            <category><![CDATA[seongnam-ai-internship]]></category>
            <category><![CDATA[meetthepast]]></category>
            <category><![CDATA[tpm]]></category>
            <dc:creator><![CDATA[장아령]]></dc:creator>
            <pubDate>Wed, 28 Sep 2022 16:42:47 GMT</pubDate>
            <atom:updated>2022-09-30T16:45:25.663Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Project Period 2022–08–27 ~2022–10–01</strong></p><blockquote><em>Do you have images of torn and crumpled memories? We will revive the memories in a form close to someone’s memory. Try a service that restores photos to their original shape</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wxp78TFflH8L933DbQOWzA.png" /></figure><h3>Software Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CzDQ5ReWHsEx4gG1.png" /></figure><h3>Tech Stack</h3><ul><li><strong>Frontend</strong>: React, typescript, redux</li><li><strong>Backend:</strong> Django, Django-Rest-FrameWork</li><li><strong>Web Server:</strong> Nginx</li><li><strong>WSGI:</strong> Gunicorn</li><li><strong>AI:</strong> Pythorch, dlib, OpenCV</li><li><strong>DB:</strong> PostgreSQL</li><li><strong>Deployment:</strong> Docker, AWS EC2, AWS S3</li><li><strong>API Test:</strong> Postman</li><li><strong>API Documentation:</strong> Swagger</li><li><strong>Monitoring:</strong> Prometheus, Grafana</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*a5Aq2AFsRrWwQ-hp.png" /></figure><h3>AI (Deep Latent Space Translation)</h3><blockquote><em>Reference — </em><a href="https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life"><em>https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life</em></a><em> </em><a href="https://www.researchgate.net/publication/344261043_Old_Photo_Restoration_via_Deep_Latent_Space_Translation"><em>https://www.researchgate.net/publication/344261043_Old_Photo_Restoration_via_Deep_Latent_Space_Translation</em></a></blockquote><h3>Frontend</h3><h3>Why use react?</h3><blockquote>1. Fast rendering speedReact uses the virtual DOM to ensure fast rendering speeds for web and app front-end development, enabling fast service to users.</blockquote><blockquote>2. Component-based directory structureBased on Component, each independent module that can be reused, it is possible to effectively modify the complex UI by minimizing the duplicated code and it is easy to reuse.</blockquote><blockquote>3. React HooksWhen the state value is changed using the Hooks [State Hook, Effect Hook, etc.] library, it is automatically rendered after detecting the change, making state management and state change easy.</blockquote><h3>Why use Redux?</h3><blockquote><em>Data management through sessions has the disadvantage of being inefficient in terms of stability and time.</em></blockquote><blockquote><em>1. Data can be centralized- Very effective for managing global state. In our project, TaskId, token information, and user information were managed as global variables through Redux.</em></blockquote><blockquote><em>2. One-way modeling- Action — One-way state value update through dispatch makes it easy to find errors and debug. In particular, UserEmail and token information, which are commonly managed on all pages, are managed as global variables and applied to projects utilizing the advantages of using Redux.</em></blockquote><h3>Backend</h3><h3>Why use Celery, Redis?</h3><blockquote><em>Celery distributes time-consuming AI-related tasks to each worker and processes them asynchronously so that the next request can be received without delay.</em></blockquote><blockquote>We used Redis as the store for Celery processing output. → Because it is a memory DB, it was possible to quickly search the AI processing results. In addition, it was possible to reduce the read load of Postgre. RabbitMQ acts as a buffer by loading data into a queue when there is a lot of traffic.</blockquote><h3>Why use Django, django Restframework?</h3><blockquote>1. You can easily evolve your Python project. It is easy to develop a Python project on a web-based basis. You can actively use the Python library in the field of artificial intelligence using web crawling for web development.</blockquote><blockquote>2. It lowers the barrier to entry for beginners in web development.You can run the server with one Python command without installing a web server, and without installing an additional database, you can handle the database sufficiently with Python code.</blockquote><blockquote>3. The admin page is provided by default.Through the admin page, the database structure of the website under development can be easily understood, and the contents can be modified and deleted.</blockquote><blockquote>4. Provides basic security functions. Web development is done according to the Django security guide, so you don’t make security mistakes.</blockquote><blockquote>5. When you use DRF, you use something called a serializer between the view and the model. If you import and use the Serializer from the View, you can receive the data extracted from the Model in the form of json, not in the form of Queryset.</blockquote><h3>DB</h3><h3>why use PostgreSQL?</h3><blockquote>1. Standard SQL ComplianceIt aims to implement closer to the standard than SQLite or MySQL. It supports 160 of the 179 functions required by the full core SQL:2011 specification, and also supports a long list of optional functions.</blockquote><blockquote>2. It is an open source and community-led database. As a fully open source project, the source code for PostgreSQL has been developed by a large dedicated community. Maintains and contributes to official documentation, locations, and numerous resources that describe how to work with a DBMS.</blockquote><blockquote>3. Excellent scalability.Users can programmatically extend PostgreSQL on-the-fly through the use of catalog-based operations and dynamic loads. You can specify an object code file such as a shared library and load it as needed.</blockquote><h3>Execution method</h3><p>Step 1. Install yarn module</p><pre>git clone --recursive &lt;https://github.com/Meet-the-past/docker.git&gt;</pre><pre>cd docker/frontend<br>yarn</pre><p>Step 2. Install AI module (<a href="https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life">https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life</a>)</p><pre>cd ../backend<br>mkdir ai<br>cd ai</pre><pre>cd Face_Enhancement/models/networks/<br>git clone &lt;https://github.com/vacancy/Synchronized-BatchNorm-PyTorch&gt;<br>cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .<br>cd ../../../<br>cd Global/detection_models<br>git clone &lt;https://github.com/vacancy/Synchronized-BatchNorm-PyTorch&gt;<br>cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .<br>cd ../../<br>Download the landmark detection pretrained model</pre><pre>cd Face_Detection/<br>wget &lt;http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2&gt;<br>bzip2 -d shape_predictor_68_face_landmarks.dat.bz2<br>cd ../<br>Download the pretrained model, put the file Face_Enhancement/checkpoints.zip under ./Face_Enhancement, and put the file Global/checkpoints.zip under ./Global. Then unzip them respectively.</pre><pre>cd Face_Enhancement/<br>wget &lt;https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip&gt;<br>unzip face_checkpoints.zip<br>cd ../<br>cd Global/<br>wget &lt;https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip&gt;<br>unzip global_checkpoints.zip<br>cd ../../../../</pre><p>Step 3. Run docker</p><pre>docker-compose -f docker-compose.prod.yml up -d --build</pre><h3>Monitoring Description</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Kw9S2O-VcP0TTRcC.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*yKEfFQ4HyqnWXVTy.png" /></figure><p><strong>Our efforts</strong></p><blockquote>We spent a lot of time trying to implement it in a short period of five weeks. The difficulty level was quite high, so we tried harder.</blockquote><blockquote>This is my first time using Docker, Nginx, Gunicorn, React, and Django, so there were many errors and failures in coding.</blockquote><blockquote>However, We were able to produce the desired result after constantly trying to find out what we learned by googling, asking mentors, and ripping through the code countless times.</blockquote><p><strong>What we learned</strong></p><blockquote><em>While doing this project, I realized how the web and server work. It was a good time to learn how data communication and connection that I heard only in class took place by looking at the process of making code, connecting, and looking at the code of other partners.</em></blockquote><blockquote>When I actually used team collaborative tools like Git, Github, Notion, and Slack and created a project, I realized why I used them while seeing the advantages of them.</blockquote><blockquote>Among them, git was convenient to change only the modified files, and it became an opportunity to study more because it was used in real work.</blockquote><h3>Team members</h3><p><a href="https://github.com/teawon">정태원</a> <a href="https://github.com/hyeokinen">김건혁</a> <a href="https://github.com/chloe1129">이채</a>현 <a href="https://github.com/SeongbinPark">박성빈</a> <a href="https://github.com/PARK-Su-yeon">박수연</a> <a href="https://github.com/aristo0922">장아령</a></p><p><strong>Github link</strong></p><p><a href="https://github.com/Meet-the-past/">https://github.com/Meet-the-past/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f3df63c4217" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>