본문 바로가기

React란 React란 웹의 View를 위한 라이브러리로써, 웹의 DOM을 가상화 하여 DOM 랜더링을 최대한 줄여 자원 낭비를 최소화 한다. https://reactjs.org React – A JavaScript library for building user interfaces A JavaScript library for building user interfaces reactjs.org React 설치 React는 npm을 통해 설치하게 된다. npm install -g create-react-app 첫번째 React 앱 만들기 React 앱은 다음 명령어를 통해 만들 수 있다. npx create-react-app {앱 이름(디렉토리 이름)} 기본 설정이 끝난 후 해당 디렉토리로 들어가 아래 명령어를 통해 r.. 더보기
Node-RED 노드 만들기 1. 간단한 노드 만들기 이 포스팅에서는 docker 기반 nodered에서 간단한 노드를 직접 만들어 사용하는것을 목표로 한다. Creating Nodes : Node-RED Creating Nodes The main way Node-RED can be extended is to add new nodes into its palette. Nodes can be published as npm modules to the public npm repository and added to the Node-RED Flow Library to make them available to the community. Since Node-RED 1.3 nodered.org 커스텀 노드를 만드는데 사용되는 파일은 크게 3가지다. js파일, html파일,.. 더보기
Node-RED란 Node-Red에 대해 간단히 알아보고, 설치(docker) 및 간단한 실습에 대한 포스팅이다. Node-RED Built on Node.js The light-weight runtime is built on Node.js, taking full advantage of its event-driven, non-blocking model. This makes it ideal to run at the edge of the network on low-cost hardware such as the Raspberry Pi as well as in the cloud. With nodered.org 노드레드란 웹을 이용하여 잘 코딩된 모듈들(내가 직접 만들거나 남이 만든걸 사용하거나)을 통해 내가 원하는 플로우(파이프.. 더보기
Mariadb Master-Slave 구축 서비스를 운영하다 보면 당연히 Post에 비해 Get 요청이 많은것을 알 수 있을것이다. 모든 요청이 하나의 데이터 베이스로 들어갈 경우 해당 데이터 베이스에 높은 부하를 만들 수 있게 된다. 때문에 서비스가 커지게 될 경우 데이터 베이스의 분산처리는 필수불가결 하게 된다. 이번 포스팅에서는 Mariadb의 Master-Slave 데이터베이스 구축에 대해 다룬다. Docker 기반 mariadb:10.5 이미지를 사용하여 진행을 한다. 기본적으로 Mariadb에는 바이너리 로그라는 로그파일이 존재한다. Master-Slave의 원리는 이 Binary 로그가 변경되는 이벤트가 생기게 되면, Master -> Slave로 이 로그를 보내주게 되고, Slave에서 이 로그를 해석하여 자신의 데이터 베이스에 적.. 더보기
Python Logging logging 모듈 사용법 logging — Logging facility for Python — Python 3.10.5 documentation logging — Logging facility for Python Source code: Lib/logging/__init__.py This module defines functions and classes which implement a flexible event logging system for applications and libraries. The key benefit of having the logging API provided by a s docs.python.org logging 기본 사용법 Example #logging_example1.py .. 더보기
Python Flask flask란 flask는 파이썬의 가벼운 웹 프레임 워크로써, 주로 간단한 API를 만드는데 사용한다. 사용 방법 아래 예제 소스는 로컬 api 서버를 열어 “hello world!”를 리턴하는 예제다. from flask import Flask app = Flask(__name__) @app.route('/test') def test(): return "hello world!" app.run() flask 객체를 생성하여, @route 어노테이션을 사용하여 request를 받을 url(/test)을 설정하고 request를 받아 “hello world!”를 response해주는 예제로 실행 결과는 다음과 같다. 가장 간단한 사용법이다. template 자주 사용하는 HTTP GET, POST 요청 예시.. 더보기
Python Argparse argparse 라이브러리 사용법 argparse — Parser for command-line options, arguments and sub-commands — Python 3.10.5 documentation argparse — Parser for command-line options, arguments and sub-commands Source code: Lib/argparse.py The argparse module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and argparse will figure docs.python.org 명령행 옵션 .. 더보기
나의 git 프로젝트 관리 지금까진 개발을 할때 코딩에 들어가는 시간이 8할, 나머지 작업(설계 및 관리)에 들어가는 시간이 2할 정도였던것 같다. 하지만 이제와서 보니 오히려 반대가 되어야 하는게 아닌가... 하는 생각이 든다. 그동안 프로젝트들을 진행하다 보면 시간에 쫓겨 로그들을 제대로 남기지 않고 진행하는 경우가 많았다. 그렇게 어찌저찌 프로젝트를 진행하다 가끔 과거의 기록들이 필요한 경우들이 생기게 되고, 아래와 같은 커밋 로그를 확인할때마다 정말 답이 안나온다.. 이렇게 개발된 코드들은 나중 관리 측면에서도 너무 안좋았다. 특히 이전 버전으로 롤백해야 하는 경우 어디로 포인트를 잡아야 할지 찾을수가 없다. 이젠 프로젝트 관리 규칙을 만들어 최대한 그 규칙을 따르며, 개발을 하고자 하는 마음에 이렇게 한번 정리를 한다. .. 더보기
Git Flow https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow Gitflow Workflow | Atlassian Git Tutorial A deep dive into the Gitflow Workflow. Learn if this Git workflow is right for you and your team with this comprehensive tutorial. www.atlassian.com 1. branch 종류 설명 여기서 말한 브랜치들은 특정 브랜치 하나를 의미하는게 아닌 브랜치들의 라이프 사이클을 의미합니다. master브랜치와, develop브랜치는 하나로 고정이지만 release, hotfix, feature .. 더보기
Git PR 관리 PR이란? Pull Request란 내가 변경한 내용을 다른 브랜치로 머지하고자 할때, “내 변경을 받아주세요” 와 같은 요청이다. PR 생성 PR은 github Pull Request 탭에서 생성할 수 있으며, 생성시 ID가 붙게 된다. PR Merge 생성된 PR은 타겟 브랜치로 머지할 수 있게 되는데, 이때 변경된 내용에 따라 다음과 같은 상황이 일어나게 된다. 1. 자동 Merge 첫번째 시나리오로써 내가 변경한 내용과, Merge 하려는 타겟 브랜치와 충돌이 없거나, 자동으로 해결 가능한 충돌일때는 자동으로 merge가 된다. 이때는 PR에서 바로 Merge할 수 있는 버튼이 나타나게 된다. 이때는 Merge Pull Request를 눌러 Target Branch로 머지가 가능하다. 2. 수동 .. 더보기