<?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 ThreeLight on Medium]]></title>
        <description><![CDATA[Stories by ThreeLight on Medium]]></description>
        <link>https://medium.com/@threelight?source=rss-557ec95f73b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Iw6p12Dv8DtSnU-4tRIkOQ.png</url>
            <title>Stories by ThreeLight on Medium</title>
            <link>https://medium.com/@threelight?source=rss-557ec95f73b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:53:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@threelight/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[Building a WebGPU Movie Editor: Why I Rejected the Composite Pattern]]></title>
            <link>https://medium.com/@threelight/building-a-webgpu-movie-editor-why-i-rejected-the-composite-pattern-fd524f096bf8?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd524f096bf8</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[video-editing]]></category>
            <category><![CDATA[webgpu]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 10:16:59 GMT</pubDate>
            <atom:updated>2026-04-24T10:16:59.093Z</atom:updated>
            <content:encoded><![CDATA[<h3>Previous story</h3><p><a href="https://medium.com/@threelight/rendium-architecting-an-ai-driven-desktop-movie-editor-036aa9a5ac79">Rendium: Architecting an AI-Driven Desktop Movie Editor</a></p><h3>Intro</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mnnEvvAYJ5oRhFG1g59gSA.png" /><figcaption>Thumbnail of this article</figcaption></figure><p>Most editors naturally invite a tree structure.</p><p>Rendium almost followed that path too. A movie editor has tracks, groups, nested clips, and composition boundaries, so the composite pattern feels like the obvious choice.</p><p>But once I started <strong>designing Rendium as a WebGPU-based engine</strong>, I realized the tree was solving the wrong problem.</p><p>The real question was not whether hierarchy should exist. It was how to represent that hierarchy so the editor could stay simple, stable, and fast enough to render.</p><p>In the end, I chose a flat 1D layer array instead of a composite tree.</p><p>That decision shaped the entire engine.</p><h3>What Rendium Is Trying to Solve</h3><p>Rendium is a movie editor engine built on WebGPU.</p><p>That means it has to handle more than just visual layers. <br>It needs to manage:</p><ul><li><strong>layer order</strong></li><li><strong>grouping</strong></li><li><strong>timeline-based editing</strong></li><li><strong>undo and redo</strong></li><li><strong>predictable UI updates</strong></li><li><strong>GPU-friendly rendering</strong></li></ul><p>Those requirements sound related, but they do not all want the same data structure.</p><p>A tree is great for expressing meaning. A <strong>flat 1D layer array</strong> is great for executing work.</p><p>Rendium needed both.</p><h3>Why the Composite Pattern Looked Right</h3><p>The composite pattern is a very reasonable first choice.</p><p>If you are building an editor, a tree makes sense because it mirrors how people think about structure:</p><ul><li><strong>a project contains groups</strong></li><li><strong>groups contain clips</strong></li><li><strong>clips can contain nested parts</strong></li><li><strong>children inherit from parents</strong></li></ul><p>It is clean, familiar, and easy to explain.</p><p>For many editors, that is enough.</p><p>But when I looked at the engine from the perspective of WebGPU, I realized <strong>the tree would not be the final shape of the data anyway</strong>. It would only be an intermediate shape.</p><p>That is where the tension began.</p><h3>WebGPU changed how I thought about the problem.</h3><p>WebGPU does not care about the editor’s conceptual hierarchy. It cares about the data the engine prepares for rendering.</p><p>On the CPU side, the editor still needs to know:</p><ul><li><strong>which layer belongs inside which group</strong></li><li><strong>what transform is inherited</strong></li><li><strong>what opacity is active</strong></li><li><strong>what the current time context is</strong></li></ul><p>But before drawing, all of that has to be resolved into a linear execution path.</p><p>That means the renderer wants:</p><ul><li><strong>a predictable sequence</strong></li><li><strong>resolved transforms</strong></li><li><strong>resolved opacity</strong></li><li><strong>minimal branching</strong></li><li><strong>minimal recursive traversal</strong></li></ul><p>The more tree-shaped the data is, the more work the engine has to do before rendering.<br>That is where the composite pattern started to feel less attractive for Rendium.</p><h3>The Two Structures</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JYV2Wa-JxWWqU7WmTmUKzA.png" /><figcaption>Diagram. Composite tree vs flat 1D array</figcaption></figure><p>I ended up comparing two options.</p><h4>A. Composite tree</h4><p>This is the intuitive model.</p><pre>Project<br>├─ Group A<br>│ ├─ Clip 1<br>│ ├─ Clip 2<br>│ └─ Group B<br>│ ├─ Clip 3<br>│ └─ Clip 4</pre><p>This is easy to understand conceptually.</p><p>But it creates a few problems:</p><ul><li><strong>state updates become nested and harder to normalize</strong></li><li><strong>undo and redo can touch many branches</strong></li><li><strong>UI state and render state can drift apart</strong></li><li><strong>rendering still has to walk the tree and flatten it later</strong></li></ul><h4>B. Flat 1D layer array</h4><p>This is the model Rendium uses.</p><pre>[Project Start]<br>[Layer 1]<br>[Layer 2]<br>[Scope Start]<br>[Layer 3]<br>[Layer 4]<br>[Scope End]</pre><p>This looks less natural at first, but it is much easier to process.</p><p>The key idea is simple:</p><ul><li><strong>store the sequence linearly</strong></li><li><strong>store each layer’s data separately</strong></li><li><strong>encode hierarchy with markers instead of nesting objects</strong></li></ul><p>That gave me a model that matched both editor behavior and GPU execution much better.</p><h3>Why the Flat 1D layer array model Won</h3><p>The biggest reason was transformation cost.</p><p>I wanted to reduce the number of times the engine had to translate between:</p><ul><li><strong>project data</strong></li><li><strong>UI state</strong></li><li><strong>rendering data</strong></li></ul><p>With a tree structure, those layers often become separate shapes:</p><ul><li><strong>the UI wants one structure</strong></li><li><strong>the state store wants another</strong></li><li><strong>the renderer wants a flattened result</strong></li></ul><p>That means the system spends a lot of time converting the same information between different representations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kV1fpJxE_CKsQZCurzHLYg.png" /><figcaption>Diagram. Normalized manifest structure</figcaption></figure><p>With a <strong>flat 1D layer array</strong>, the same sequence can support all of those needs more directly.</p><p>In Rendium, the manifest is normalized into:</p><ul><li><strong><em>layers</em></strong>: a record keyed by ID</li><li><strong><em>layerOrder</em></strong>: a linear array of IDs</li></ul><p>That gives two important benefits:</p><ul><li><strong>O(1) access to layer data</strong></li><li><strong>stable ordering for editing and rendering</strong></li></ul><p>It also makes history easier to manage. Small changes stay small. Undo and redo do not need to track a deeply nested tree; <br>they only need to track the changed entries and the order array.</p><h3>How Rendium Keeps Hierarchy Without a Tree</h3><p>This is the part I like most about the design.</p><p>Rendium does not remove hierarchy. It just encodes hierarchy in a linear way.</p><p>Instead of storing nested groups as nested objects, the engine uses scope markers inside the <strong>flat 1D layer array</strong>. In the codebase, those are represented as <strong><em>scope:start</em></strong> and <strong><em>scope:end</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jnHjaxlJ5kJTN4QTjaTuQA.png" /><figcaption>Diagram. Scope markers and stack evaluation</figcaption></figure><p>They are stored like layers, but they behave more like structural boundaries than content layers.</p><p>That means a group is not a node with children. <br>It is a bracketed region inside a sequence.</p><p>So the data stays flat, but the meaning stays hierarchical.</p><p>That distinction is what makes the architecture work.</p><h3>How the Engine Evaluates the Sequence</h3><p>Once the structure is flat, the engine needs a way to recover the nested meaning at runtime.</p><p>That is where the stack comes in.</p><p>Rendium scans the array from left to right. When it encounters a scope start marker, it pushes the current state onto a stack. When it encounters a scope end marker, it pops the stack.</p><p>The stack carries inherited state such as:</p><ul><li><strong>transform</strong></li><li><strong>opacity</strong></li><li><strong>time offset</strong></li><li><strong>scope context</strong></li></ul><p>So even though the stored model is linear, the runtime evaluation still understands nesting.</p><p>This is the important part:</p><ul><li><strong>storage stays flat</strong></li><li><strong>execution becomes hierarchical only when needed</strong></li></ul><p>That gives me the best of both worlds.</p><h3>Why Stack-Based Evaluation Fits Better</h3><p>A recursive tree walk is elegant in theory, but it adds complexity that I did not want in the core engine.</p><p>A stack-based linear scan gives me:</p><ul><li><strong>predictable O(n) traversal</strong></li><li><strong>no recursive call overhead</strong></li><li><strong>easier debugging</strong></li><li><strong>explicit state transitions</strong></li><li><strong>less risk from deep nesting</strong></li></ul><p>It also fits the way I want Rendium to behave internally.</p><p>The CPU resolves the hierarchy first, then passes the renderer a clean, flattened result.</p><p>That makes the WebGPU path much simpler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2j7P7OIPZy4EXaIBJ6nimA.png" /><figcaption>Diagram 4. CPU-side resolution to WebGPU render flow</figcaption></figure><h3>How WebGPU Benefits From This</h3><p>This is where the decision really pays off.</p><p>Because the CPU side has already resolved the structure, WebGPU gets data that is much closer to what it needs:</p><ul><li><strong>final transforms</strong></li><li><strong>final opacity values</strong></li><li><strong>predictable ordering</strong></li><li><strong>draw-ready state</strong></li></ul><p>That means the renderer does not need to re-interpret a tree at draw time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TtjU-HfxWo-L-EKK1ZaDDA.png" /><figcaption>Image that explaning WebGPU Render Flow</figcaption></figure><p>Instead of rendering nested structures recursively, Rendium can work from a linear sequence of resolved commands.</p><p>That is a better fit for performance, and it is also easier to maintain.</p><h3>The Real Problem With the Composite Pattern Here</h3><p>To be clear, I am not saying the composite pattern is bad.</p><p>It is useful, general, and widely used in editors.</p><p>The issue is more specific: for Rendium, it would have introduced a permanent structural model that still had to be flattened later.</p><p>So the engine would have spent time translating:</p><ul><li><strong>tree state into linear order</strong></li><li><strong>nested meaning into stack state</strong></li><li><strong>hierarchical UI concepts into GPU-friendly execution</strong></li></ul><p>That translation cost is exactly what I wanted to avoid.</p><p>The <strong>flat 1D layer array</strong> lets me represent hierarchy once, not repeatedly.</p><h3>What the Codebase Evolved Toward</h3><p>This choice was not made in isolation. The codebase gradually converged on it.</p><p>A few decisions pushed the architecture in the same direction:</p><ul><li><strong>the manifest became a normalized single source of truth</strong></li><li><strong><em>layers</em> and <em>layerOrder</em> became the core structure</strong></li><li><strong>project-level settings were separated from timeline content</strong></li><li><strong>scope markers were treated as structural boundaries</strong></li><li><strong>non-visual control layers became lighter and more explicit</strong></li></ul><p>Over time, the engine stopped feeling like a tree that had been flattened.</p><p>It started feeling like a system that was designed to be linear from the beginning.</p><h3>What Rendium Gains From This Architecture</h3><p>Choosing a <strong>flat 1D layer array</strong> gave Rendium several advantages.</p><ul><li><strong>Simpler state management</strong></li><li><strong>Cleaner undo and redo</strong></li><li><strong>Stable ordering</strong></li><li><strong>Easier UI synchronization</strong></li><li><strong>Better fit for WebGPU execution</strong></li><li><strong>Hierarchy without recursive storage</strong></li></ul><p>That last point matters the most.</p><p>I did not want to remove hierarchy. I wanted to represent hierarchy in a way that was easier to edit and easier to render.</p><h3>Conclusion</h3><p>I rejected the composite pattern not because it is a bad design, but because Rendium needed a structure that matched the real job of the engine.</p><p>A tree is a great conceptual model. <br>A <strong>flat 1D array</strong> is a better operational model for this editor.</p><p>It lets Rendium keep hierarchy, but only where hierarchy is actually useful:</p><ul><li><strong>in editing</strong></li><li><strong>in grouping</strong></li><li><strong>in runtime state evaluation</strong></li></ul><p>For everything else, the engine stays linear.</p><p>And for a WebGPU-based movie editor, that linearity turned out to be the right shape.</p><h3>Outro</h3><p>I rejected the composite pattern not because it is a bad design, but because Rendium needed a structure that matched the real job of the engine.</p><p>A tree is a great conceptual model. A <strong>flat 1D array</strong> is a better operational model for this editor.</p><p>It keeps hierarchy where hierarchy is useful:</p><ul><li><strong>in editing</strong></li><li><strong>in grouping</strong></li><li><strong>in runtime state evaluation</strong></li></ul><p>For everything else, the engine stays linear.</p><p>And for a WebGPU-based movie editor, that linearity turned out to be the right shape.</p><p>If you found this architecture interesting, I’d love to hear your thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd524f096bf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rendium: Architecting an AI-Driven Desktop Movie Editor]]></title>
            <link>https://medium.com/@threelight/rendium-architecting-an-ai-driven-desktop-movie-editor-036aa9a5ac79?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/036aa9a5ac79</guid>
            <category><![CDATA[webgpu]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[electron]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 07:50:04 GMT</pubDate>
            <atom:updated>2026-04-24T10:18:47.231Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6hI9G3UdlMUhiI3y0rWqw.png" /></figure><h3>Intro: Catalyst for a Custom Engine</h3><p>The recent surge in generative AI has made high-quality music production more accessible than ever. As I began producing tracks using models like <strong>Suno</strong> and <strong>Mureka</strong> for my streaming channel, I encountered a recurring bottleneck: generating the accompanying music videos.</p><p>Industry-standard software like <strong>Premiere Pro</strong> and <strong>CapCut</strong> is powerful, but it still requires too much manual work for repetitive tasks. Things like synchronizing progress bars, transitioning between images, looping video segments, and aligning visuals to audio should be handled by code wherever possible.</p><p>As a frontend engineer who builds web editors and object-oriented systems in TypeScript, building my own video rendering engine sounded like a fun and rewarding challenge. Adding AI agents on top of that, to parse user requests and divide tasks automatically, could turn a standard editor into an intelligent workflow system.</p><p>That realization led to the creation of <strong>Rendium</strong>. The goal was simple: build a fast, lightweight video editor designed from the ground up for <strong>AI agents</strong> and <strong>clean architecture</strong>. This article documents the technology stack evaluations and architectural decisions I made during the first 50 days of development.</p><h3>Architecture of Rendium desktop-studio</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-z1fF-tFNd1u9lhH6IVTBA.png" /><figcaption>The Architecture of Rendium desktop-studio</figcaption></figure><h3><strong>Why I Selected WebGPU: Single-Pass Execution and Memory Discipline</strong></h3><p>Developing a custom web-based <strong>Non-Linear Editor (NLE)</strong> requires a rendering pipeline that goes beyond the default capabilities of standard APIs like <strong>Canvas 2D</strong> or <strong>WebGL</strong>. The architectural decision to adopt <strong>WebGPU</strong> for the engine layer was driven by three specific engineering forces.</p><p>WebGPU was selected because it provides the low-level primitives needed to build a scalable, predictable, and flat graphics engine. It supports <strong>single-pass state accumulation</strong>, efficient video texture uploads, and strict memory buffer discipline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/0*umKdMiYIJs0vmayB.png" /></figure><h4><strong>Single-Pass State Accumulation</strong></h4><p>Managing hierarchical visual state, such as nested transforms or inherited opacity, usually requires complex tree traversals and expensive offscreen compositing. Rendium avoids that by using a <strong>flat 1D layer array</strong>.</p><p>Logical boundary markers, acting as <strong>start</strong> and <strong>end tokens</strong>, push and pop state onto a CPU-side stack during a linear scan. WebGPU then executes the entire frame within a <strong>single render pass</strong>. Each layer is drawn sequentially using the currently accumulated stack state, avoiding the overhead of multi-pass GPU lifecycles for structural grouping.</p><h4><strong>Efficient Video Frame Processing</strong></h4><p>A video editor must process video files as continuous, renderable streams rather than isolated media elements. WebGPU gives the engine a path toward efficient texture-based frame handling, which is important for frame-accurate seeking and synchronization with the audio pipeline.</p><h4><strong>Strict Uniform Buffer Discipline</strong></h4><p>WebGPU enforces strict hardware-level memory layout rules. During the proof-of-concept phase, the uniform-buffer layout had to be standardized to satisfy alignment constraints and avoid shader validation errors. As the system expanded to accommodate properties like shadows and outlines, the buffer boundaries could be scaled in a predictable way.</p><p>That strict memory model forced a clean separation between <strong>hardware-dependent GPU resources</strong> and <strong>serializable timeline state</strong>.</p><p>Ultimately, <strong>WebGPU</strong> was chosen not just for general performance, but because its low-level control and memory constraints provide a strong foundation for a <strong>flat, high-performance video editing environment</strong>.</p><h3><strong>Why I Selected Electron (Over Tauri) for the Product Layer</strong></h3><p>Once the WebGPU engine architecture was established, the next major decision was selecting the desktop application framework for the Product layer. I evaluated the two leading options: <strong>Electron</strong> and <strong>Tauri</strong>.</p><p>While Tauri is highly praised for its lightweight Rust backend and smaller binary sizes, I ultimately selected Electron. For an application whose core value relies on bleeding-edge GPU APIs and heavy multimedia processing, Electron provides a level of <strong>runtime consistency</strong> that is difficult to ignore.</p><p>Here are the trade-offs that led to that decision:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OogGKy8EYh_y7Vzqp14XaA.png" /></figure><h4><strong>Runtime Consistency and WebGPU Support</strong></h4><p>Electron bundles a specific version of <strong>Chromium</strong> with the app. That means if WebGPU works during development, it is much more likely to behave consistently on users’ machines across Windows, macOS, and Linux.</p><p>Tauri, on the other hand, depends on the host operating system’s native webview, such as <strong>WebView2</strong> on Windows and <strong>WKWebView</strong> on macOS. WebGPU support in those native webviews can vary depending on platform version and system updates. For a rendering engine, that variability is a risk.</p><p>An NLE engine like Rendium cannot afford a rendering failure simply because a user is on an older webview stack.</p><h4><strong>Managing Multimedia Bottlenecks</strong></h4><p>The main performance bottleneck in Rendium is transforming and synchronizing audio, images, and video buffers.</p><p>Electron allows smooth <strong>IPC communication</strong> between the Node.js main process and the Chromium renderer. Because both sides live inside the same JavaScript ecosystem, it becomes easier to coordinate file-system operations, media metadata, and rendering tasks without introducing an additional language boundary.</p><h4><strong>Architectural Alignment</strong></h4><p>Rendium’s codebase is built around <strong>object-oriented TypeScript</strong>. Keeping the Product layer and the underlying file-system logic in the same language ecosystem reduces cognitive overhead.</p><p>Tauri’s Rust backend is impressive, but for this project it would introduce an additional serialization boundary between the Rust core and the TypeScript frontend. For a multimedia editor with complex state, that extra layer would add architectural friction.</p><p>In short, while Tauri is an excellent choice for many web-to-desktop applications, a WebGPU-accelerated video editor benefits from the environment control that only a bundled Chromium runtime like Electron can provide.</p><h3><strong>The Engine Layer: Why I Selected a 1-Depth Layer Structure</strong></h3><p>Traditional visual editors often rely on a composite tree structure, with nested layers inside folders or groups, to manage the timeline. But applying a deeply nested tree to a web-based state management system introduces severe bottlenecks. To keep UI state stable and mutation logic predictable, I rejected the composite tree model in favor of a <strong>flat, 1-depth layer structure</strong>.</p><p>The 1-depth architecture separates layer data from structural hierarchy, which helps avoid patch instability during state reconciliation. In a frontend application, timeline state needs to be serializable, usually as JSON, so that undo/redo history can be stored reliably. Deeply nested tree structures cause massive index shifting when a single node is moved, which makes state diffs expensive and brittle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1Ddr7-0aZSJTYwNDh2-KQ.png" /><figcaption>Thanks to Nano banana</figcaption></figure><h4><strong>The Problem with Composite Trees</strong></h4><p>If a user drags a video clip out of a nested folder, the entire JSON tree may need to be recalculated. That makes computing state patches for undo/redo workflows much harder and more error-prone.</p><h4><strong>The 1-Depth Dictionary + Array Model</strong></h4><p>Rendium stores layers in a <strong>flat dictionary map</strong> containing the raw layer data, combined with a simple <strong>1D array of layer IDs</strong> that represents sequence order.</p><p>Moving a layer no longer requires rebuilding a nested tree. It only requires updating the position of that ID in the array.</p><p>If you want more about this decision history, visit this following article.</p><p><a href="https://medium.com/@threelight/building-a-webgpu-movie-editor-why-i-rejected-the-composite-pattern-fd524f096bf8">Building a WebGPU Movie Editor: Why I Rejected the Composite Pattern</a></p><h4><strong>Simulating Depth with Markers</strong></h4><p>To preserve the visual grouping that a composite tree normally provides, the engine injects logical grouping tokens into the flat array. During a linear scan, those tokens tell the CPU-side state stack how to group subsequent layers without actually nesting the underlying data model.</p><p>This means the editor gets the benefits of grouping and hierarchy without paying the cost of deep structural mutations.</p><p>By keeping the state architecture <strong>1-depth</strong>, Rendium achieves <strong>patch reconciliation by ID</strong>. That keeps the UI responsive, the undo/redo system stable, and the rendering pipeline efficient.</p><h3><strong>Conclusion and Future Scope: Toward an AI-Driven Generation Pipeline</strong></h3><p>Building a custom <strong>Non-Linear Editor</strong> from the ground up means navigating strict deterministic constraints, managing volatile hardware memory, and keeping audio synchronization exact across the rendering loop.</p><p>At the moment, the Rendium engine already supports foundational rendering primitives: <strong>text</strong>, <strong>static images</strong>, <strong>audio tracks</strong>, and <strong>reactive audio spectrum visualizers</strong>. That validates the core architecture. But moving from a working engine to a production-ready editor requires solving two immediate milestones.</p><h4><strong>Serialization and State Optimization</strong></h4><p>The current priority is reducing the size of the project manifest. By refining how external assets such as audio and image buffers are referenced and serialized, project files can remain compact and state persistence can stay efficient.</p><h4><strong>The Export Pipeline</strong></h4><p>The engine must bridge the gap between real-time canvas rendering and static file generation. That means implementing a robust encoding pipeline, likely using <strong>WebCodecs</strong> or <strong>FFmpeg</strong> through Electron IPC, to capture rendered frames and encode synchronized audio into standard video formats.</p><h3>The Ultimate Vision: An AI-Driven Editor</h3><p>Once the deterministic rendering pipeline is stable, the long-term goal is to integrate intelligent orchestration.</p><p>Because Rendium cleanly separates the <strong>Product layer</strong> from the <strong>Engine layer</strong>, AI agents can be introduced into the frontend without destabilizing the rendering core. Instead of relying entirely on manual timeline manipulation, an AI agent can parse a natural-language request, break it into editing tasks, and dispatch the exact state mutations needed to assemble the video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bi8mnC9Z2NgwTiaxRf46rg.png" /><figcaption>My Rendium Editor! Testing with my local model</figcaption></figure><p>In this architecture, the timeline becomes a <strong>programmatic interface</strong>. That is what will allow Rendium to evolve into a truly <strong>AI-native movie generation pipeline</strong>.</p><h3>Outro</h3><p>If you are interested in the architectural challenges of building <strong>AI-native rendering engines</strong>, or if you are working on similar <strong>WebGPU</strong> and <strong>Electron</strong> projects, I would love to hear your feedback. Please leave a comment, subscribe for future updates on Rendium’s development, and let’s connect to discuss these technical challenges together!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=036aa9a5ac79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[왜 includes()는 느릴까?” O(n)의 덫에서 O(1)의 Set과 Map까지: 한 개발자의 탐구 일지]]></title>
            <link>https://medium.com/@threelight/%EC%99%9C-includes-%EB%8A%94-%EB%8A%90%EB%A6%B4%EA%B9%8C-o-n-%EC%9D%98-%EB%8D%AB%EC%97%90%EC%84%9C-o-1-%EC%9D%98-set%EA%B3%BC-map%EA%B9%8C%EC%A7%80-%ED%95%9C-%EA%B0%9C%EB%B0%9C%EC%9E%90%EC%9D%98-%ED%83%90%EA%B5%AC-%EC%9D%BC%EC%A7%80-9bebc5ef32a7?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bebc5ef32a7</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Sun, 09 Nov 2025 12:16:15 GMT</pubDate>
            <atom:updated>2025-11-09T12:16:15.894Z</atom:updated>
            <content:encoded><![CDATA[<h4>JavaScript 성능 최적화, 배열 탐색의 함정과 해시 테이블의 마법</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rwYpVu_My5KYwvN0qn9eLg.png" /></figure><h3>서막: 이게 왜 O(n)이죠?</h3><p>개발자라면 누구나 한 번쯤 Array.prototype.includes()를 사용해 배열 안에 특정 값이 있는지 확인해 본 경험이 있을 겁니다.</p><p>저 역시 그랬습니다. 코드는 직관적이고 깔끔했습니다.</p><pre>if (myArray.includes(someValue)) { <br>  // 로직 실행 <br>}</pre><p>그러던 어느 날, 문득 궁금증이 생겼습니다.</p><blockquote><strong>includes()</strong>는 어떤 원리로 작동하길래 시간 복잡도가 <strong>O(n)</strong>일까?</blockquote><p>이 간단한 질문은 자바스크립트의 깊은 내부 원리를 향한 기나긴 탐구의 시작이었습니다.</p><h3>1장: O(n)의 정체</h3><h4><strong>includes()</strong>의 정직하지만 순진한 방법</h4><p><strong>includes()</strong>의 시간 복잡도가 O(n)인 이유는 놀라울 정도로 단순했습니다. <br>바로 <strong>선형 탐색(Linear Search)</strong> 때문입니다.</p><p><strong>includes()</strong>는 우리가 찾고자 하는 값을 들고 배열의 0번 인덱스부터 마지막 인덱스까지, 하나씩, 순차적으로 대조합니다. <br><strong>* 최상의 경우 (Best Case):</strong> 찾고자 하는 값이 0번 인덱스에 있다면? 한 번의 비교로 true를 반환합니다. <strong>(= O(1)) </strong><br><strong>* 최악의 경우 (Worst Case):</strong> 값이 배열의 맨 끝에 있거나, 아예 배열에 존재하지 않는다면? 배열의 길이(n)만큼, 즉 n번의 비교를 모두 마쳐야 false를 반환할 수 있습니다. <strong>(= O(n))</strong></p><p><strong>시간 복잡도는 최악의 경우를 기준</strong>으로 하므로, <strong>includes()</strong>는 <strong>O(n)</strong>의 운명을 타고난 것입니다. <strong>100만 개의 요소</strong>가 담긴 배열에서 값이 없다는 것을 확인하려면, <strong>100만 번의 연산</strong>이 필요하다는 뜻이죠.</p><blockquote><strong>한 줄 요약:</strong> <strong>includes()</strong>는 배열의 모든 요소를 하나하나 확인하는 <strong>O(n)</strong> 방식이다.</blockquote><h3>2장: O(1)의 마법, Set.has()와 해시 테이블의 등장</h3><h4>느리다는 건 알겠는데, 그럼 더 빠른 방법은 없을까?</h4><p>이 질문은 저를 <strong>Set 객체</strong>에 관심을 가지도록 이끌었습니다. <br><strong>Set</strong>은 <strong>has()</strong>라는 메서드를 제공하는데, 이 메서드의 시간 복잡도는 놀랍게도 O(1), 즉 상수 시간이었습니다.<br>배열의 크기가 10개이든 1000만 개이든, <strong>요소를 찾는 데 걸리는 시간은 거의 일정하다</strong>는 의미입니다. <br>이게 어떻게 가능할까요?비밀은 <strong>해시 테이블(Hash Table)</strong>에 있었습니다.</p><p><strong>Set</strong>은 데이터를 저장할 때, 각 요소를 <strong>해시 함수(Hash Function)</strong>에 넣어 고유한 주소 값(해시 코드)을 계산합니다. <br>그리고 이 주소에 해당하는 버킷(Bucket)에 값을 저장합니다. <br><strong>* Set.has(value)를 호출합니다. </strong><br><strong>* value를 해시 함수에 넣어 즉시 주소를 계산합니다. <br>* 계산된 주소의 버킷으로 즉시 이동하여 값이 있는지 확인합니다.</strong></p><p>배열처럼 0번부터 순차적으로 탐색할 필요 없이, 저장 위치를 단번에 계산해내기 때문에 <strong>O(1)</strong>이 가능한 것입니다.</p><p>물론, 서로 다른 값이 같은 주소를 가리키는 <strong>충돌(Collision)</strong>이 발생할 수 있고, 최악의 경우 모든 값이 충돌하면 <strong>O(n)</strong>이 될 수도 있습니다.</p><p>하지만 자바스크립트 엔진은 좋은 해시 함수를 사용하여 충돌을 최소화하므로, <strong>평균 시간 복잡도는 O(1)</strong>에 수렴합니다.</p><blockquote><strong>한 줄 요약: Set.has()</strong>는 해시 테이블을 사용해 <strong>O(1)</strong>의 속도를 낸다.</blockquote><h3>3장: “이제 Set만 쓰면 될까?”</h3><h4>객체 배열의 함정</h4><p>저는 유레카를 외쳤습니다. <strong>“앞으로 includes() 대신 무조건 Set을 써야겠다!”<br></strong>하지만 이 깨달음은 객체 배열이라는 거대한 벽 앞에서 무너졌습니다.</p><p>다음과 같은 코드를 보시죠.</p><pre>const userA = { id: 1, name: &#39;Alice&#39; };<br>const userB = { id: 2, name: &#39;Bob&#39; };<br>const userArray = [userA, userB]; <br>// 1. Array.includes()<br>console.log(userArray.includes(userA)); // true (참조가 같음)<br>console.log(userArray.includes({ id: 1, name: &#39;Alice&#39; })); // 😱 false <br>// 2. Set.has()<br>const userSet = new Set(userArray);<br>console.log(userSet.has(userA)); <br>// true (참조가 같음)<br>console.log(userSet.has({ id: 1, name: &#39;Alice&#39; })); // 😱 false</pre><p><strong>includes()</strong>와 <strong>Set.has()</strong> 모두 <strong>false</strong>를 반환했습니다. 왜일까요?</p><p><strong>includes()</strong>와 <strong>Set</strong> 모두 객체를 비교할 때, 객체의 <strong>내용(Content)</strong>이 같은지가 아니라 <strong>메모리 주소(Reference)</strong>가 같은지를 비교하기 때문입니다.</p><p><strong>{ id: 1, name: ‘Alice’ }</strong>는 내용이 같아 보여도, 메모리상에 새로 생성된 <strong>‘다른 집’</strong>인 것입니다.<br><strong>O(1)</strong>의 속도는 얻었지만, 제가 원했던 <strong>‘내용 기반’</strong>의 검색은 불가능했습니다.</p><h4>그럼에도 객체 검색에서 Set.has를 활용하려면?</h4><p><strong>includes()</strong>와 <strong>Set.has()</strong> 모두 <strong>참조(Reference)</strong> 기준으로 객체를 비교하므로, 새 객체 리터럴을 사용하면 <strong>false</strong>가 나오지만, 하나의 객체를 변수에 지정해서 배열이나 Set에 담았다면, 해당 변수를 기준으로 탐색하면 true가 나온다는 점도 알아두면 좋습니다.</p><pre>const userA = { id: 1, name: &#39;Alice&#39; };<br>const userArray = [userA];<br>console.log(userArray.includes(userA)); // true → 같은 메모리 참조!<br>console.log(userArray.includes({ id: 1, name: &#39;Alice&#39; })); // false → 다른 참조!</pre><p>즉, 객체 비교에서 <strong>true</strong>를 얻으려면 객체를 미리 변수에 저장해 놓고, 같은 변수를 탐색 기준으로 삼아야 한다는 특징이 있습니다. <br>참조 비교의 한계와 장점을 정확히 이해하면, 데이터 구조 선택에서도 더 합리적인 결정을 내릴 수 있습니다.</p><h3>4장: 진정한 해결책, O(1) Map을 활용한 키 기반 검색</h3><p>그렇다면 우리가 정말 원하는 <strong>“이 ID를 가진 유저가 배열에 있나?”</strong>라는 질문을 <strong>O(1)</strong>로 해결할 방법은 없을까요?<br>여기에 마지막 퍼즐 조각, <strong>Map</strong>이 있었습니다. <strong>Map</strong> 역시 <strong>Set</strong>처럼 해시 테이블을 기반으로 하며 <strong>O(1)</strong>의 검색 속도를 가집니다. <br>결정적인 차이는 <strong>Map</strong>이 <strong>키(Key)와 값(Value)</strong>을 짝지어 저장한다는 점입니다.</p><p>여기서 아이디어를 얻었습니다. 객체의 고유한 식별자(예: id)를 <strong>키(Key)</strong>로 사용하는 것입니다.</p><pre>const userArray = [ { id: 101, name: &#39;Alice&#39; }, { id: 102, name: &#39;Bob&#39; }]; <br>// 1. O(n)의 비용으로 Map을 생성합니다.<br>// (배열의 모든 요소를 순회하며 [id, user] 쌍을 만듭니다)<br>const userMap = new Map(userArray.map(user =&gt; [user.id, user])); <br>// 2. 검색은 O(1)입니다!const searchId = 101; <br>console.log(userMap.has(searchId)); // true<br>console.log(userMap.get(searchId)); // { id: 101, name: &#39;Alice&#39; }</pre><p>초기 변환에 <strong>O(n)</strong>의 비용이 들지만, 일단 <strong>Map</strong>이 생성되면 그 후의 모든 검색은 <strong>O(1)</strong>로 수행됩니다.<br>데이터를 한 번 변환한 후, 수백, 수천 번의 검색이 필요한 로직이라면 <strong>includes()</strong>를 반복 사용하는 <strong>O(n*m)</strong>의 재앙 대신, <strong>O(n) + O(m)</strong>의 압도적인 성능 향상을 이룰 수 있습니다.</p><h3>종착역: 탐구를 마치며</h3><p>단순한 궁금증에서 시작된 탐구는 자바스크립트 자료구조의 핵심 원리를 관통하는 여정이 되었습니다. <br><strong>* Array.includes()</strong>는 간단하지만, O(n) 선형 탐색의 한계를 가집니다. (데이터가 적거나 한두 번만 검색할 때 유용) <br><strong>* Set.has()</strong>는 해시 테이블 덕분에 O(1)의 빠른 속도를 제공합니다. (원시 값(숫자, 문자열)의 중복 제거 및 존재 확인에 최적) <br><strong>* Map.has()</strong>는 객체 배열에서 ‘내용 기반’ 검색을 O(1)로 수행할 수 있는 가장 실용적이고 강력한 해결책입니다. (고유 ID를 키로 활용)</p><p>성능 최적화는 <strong>‘어떤 게 더 빠르지?’</strong>에서 멈추는 것이 아니라, <strong>“내 데이터가 어떤 구조일 때 가장 효율적일까?”</strong>를 고민하는 과정임을 다시 한번 깨닫게 되었습니다.</p><p>여러분은 배열 검색을 위해 어떤 방법을 사용하고 계신가요? <br>Set이나 Map을 활용해 성능을 개선한 경험이 있다면 댓글로 공유해 주세요!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bebc5ef32a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Lone Wolf to AI Collaborator — Why Communication Is Every Developer’s Superpower]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@threelight/from-lone-wolf-to-ai-collaborator-why-communication-is-every-developers-superpower-06eaccfb9db4?source=rss-557ec95f73b3------2"><img src="https://cdn-images-1.medium.com/max/1536/1*d-0kBl6b-WjBQC--x3X1zQ.png" width="1536"></a></p><p class="medium-feed-snippet">Note: Alex is a fictional character whose journey represents the experiences of many developers adapting to the age of AI.</p><p class="medium-feed-link"><a href="https://medium.com/@threelight/from-lone-wolf-to-ai-collaborator-why-communication-is-every-developers-superpower-06eaccfb9db4?source=rss-557ec95f73b3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@threelight/from-lone-wolf-to-ai-collaborator-why-communication-is-every-developers-superpower-06eaccfb9db4?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/06eaccfb9db4</guid>
            <category><![CDATA[storytelling]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[communication]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 14:39:55 GMT</pubDate>
            <atom:updated>2025-06-22T23:52:12.872Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Stop Making These Naming Mistakes: Practical Tips for Team Projects]]></title>
            <link>https://medium.com/@threelight/stop-making-these-naming-mistakes-practical-tips-for-team-projects-f94c1b3c1cea?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f94c1b3c1cea</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 12:54:58 GMT</pubDate>
            <atom:updated>2025-06-15T12:55:26.974Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>We’ve all been there: staring at a variable named <strong>data</strong> or a function called <strong>handleStuff()</strong>, and spending precious minutes trying to figure out what it actually does.</p><p>These small naming mistakes seem harmless, but they add up. They create confusion, slow down your team, and make your codebase harder to maintain. In today’s collaborative environment, your code isn’t just for you — it’s for everyone who will read, review, and build upon it.</p><p>And now, with AI assistants becoming a part of our daily workflow, these unclear names are more than just an inconvenience. Bad naming confuses not only your human teammates but also the very tools designed to help you.</p><p>The good news? These are common mistakes, and they are easy to fix. In this article, we’ll uncover the naming mistakes you might be making without even realizing it. More importantly, we’ll provide practical, easy-to-follow tips to help you write code that your team (and your AI) will love.</p><p>Now, let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DsciOGJQVx4XDeRrmKphZQ.png" /></figure><h3>Mistake #1: Your Names Are Too Vague</h3><p>Let’s talk about the usual suspects: <strong>‘data’, ‘item’, ‘value’, ‘temp’, ‘obj’</strong>, or the infamous <strong>‘handleStuff()’</strong>.<br> When you see these names, what do they tell you? Almost nothing. These generic names actively hide the code’s true intent.<br> This forces your teammates to channel their inner <strong>Sherlock Holmes</strong>. Instead of building features, they’re now dusting for fingerprints across different files, piecing together clues, all just to solve the great mystery of what <strong>‘data’</strong> was supposed to mean.<br> So, what does this <strong>“mystery code”</strong> look like in practice? Let’s look at the evidence.</p><h4>The Problem in Code (The Bad Case)</h4><p>Imagine you stumble upon this piece of code written by a teammate:</p><pre>// ❌ BAD<br><br>// &#39;data&#39; could be anything. A user profile? A list of products? We don&#39;t know.<br>const data = fetchData();<br><br>// &#39;process&#39; what? What kind of &#39;val&#39; is this? A number? An object?<br>function process(val) {<br>  // ... a lot of complex logic happens here<br>}</pre><p>This code forces every developer who reads it to play detective. They have to find the <strong>‘fetchData’</strong> definition or read the entire <strong>‘process’</strong> function just to understand its basic purpose. This is a huge waste of your team’s time and mental energy.</p><h4>The Solution (The Good Case)</h4><p>Now, let’s solve the mystery with clear, descriptive names.</p><pre>// ✅ GOOD<br><br>// Ah, it&#39;s a user&#39;s profile! No guesswork needed.<br>const userProfile = fetchUserProfile();<br><br>// The name clearly states what the function does.<br>function validateAndSaveUser(user) {<br>  // ... the logic inside is now much easier to follow<br>}</pre><p>See the difference? The second example requires zero guesswork. It’s instantly understandable, not just for you, but for every current and future member of your team. This is the kind of code that enables real collaboration, <strong>not a mystery novel</strong>.</p><h3>Mistake #2: “It Makes Sense to Me!” — Using Names Only You Understand</h3><p>Code is a shared language, not a secret diary. Yet, we sometimes create names that feel like inside jokes or cryptic puzzles only we can solve. These are personal abbreviations, temporary terms that never got updated, or clever-but-confusing names that make perfect sense to you… and no one else.<br> This isn’t just a bad habit; it’s a <strong>barrier to collaboration</strong>. It tells your teammates, <strong>“This part of the code isn’t for you.”</strong></p><h4>The Problem in Code (The Bad Case)</h4><p>A new team member opens a file and is greeted by this:</p><pre>// ❌ BAD<br><br>// What is a &#39;usrMgr&#39;? User Manager? User Migration?<br>// A new dev has to guess or ask.<br>const usrMgr = new UserManager();<br><br>// Is &#39;vld8&#39; a typo? Oh, it&#39;s &#39;validate&#39;. This is a puzzle, not a name.<br>function pNumVld8(pNum) {<br>  // ...<br>}<br><br>// The most mysterious of them all. What &quot;thing&quot; are we doing?!<br>doTheThing();</pre><p>Every one of these names forces a conversation that shouldn’t have to happen. It slows down onboarding for new hires and makes code handovers a nightmare. It breaks the consistency that teams rely on to move fast.</p><h4>The Solution (The Good Case)</h4><p>Good collaboration means prioritizing shared understanding over personal cleverness. Stick to the team’s established vocabulary.</p><pre>// ✅ GOOD<br><br>// Clear, unabbreviated, and predictable.<br>const userManager = new UserManager();<br><br>// Spelled out and easy to search for.<br>function validatePhoneNumber(phoneNumber) {<br>  // ...<br>}<br><br>// Be specific about the &quot;thing&quot;!<br>updateUserPermissions();</pre><blockquote><strong>Practical Tip:</strong> Always follow your team’s existing naming conventions. If the codebase uses <strong>‘getUser’,</strong> don’t create <strong>‘fetchUser’</strong>. Consistency is king. Before inventing a new term, check if one already exists. If not, discuss it with your team.</blockquote><blockquote><strong>Team Tip:</strong> During code reviews, ask a simple question: <strong>“If a brand new developer joined today, would they understand this name without asking?”</strong></blockquote><h3>Mistake #3: Choosing the Road Less Traveled (and Confusing Your Team)</h3><p>Sometimes, in an attempt to be precise or sound sophisticated, we pick an unusual word when a simple, common one would do. This is like using <strong>“eradicate”</strong> instead of <strong>“delete,”</strong> or <strong>“commence”</strong> instead of <strong>“start.”</strong><br> While technically correct, it violates the <strong>“Principle of Least Surprise.”</strong> Your teammates expect common patterns. When you deviate, you force them to stop and think, <strong>“Wait, is ‘eradicate’ different from ‘delete’? Does it do something special?”</strong></p><h4>The Problem in Code (The Bad Case)</h4><p>This code works, but it creates unnecessary cognitive load for the reader.</p><pre>// ❌ BAD<br><br>// Is this more permanent than delete? Does it wipe logs too? Creates doubt.<br>function eradicateUser(userId) { /* ... */ }<br><br>// &quot;Commence&quot; is just a fancy word for &quot;start.&quot;<br>function commenceUpload(file) { /* ... */ }<br><br>// &quot;Obtain&quot; is less common than &quot;get&quot; in programming.<br>const config = obtainConfiguration();</pre><p>This kind of naming introduces friction and uncertainty into the development process, slowing everyone down.</p><h4>The Solution (The Good Case)</h4><p>Stick to the boring, predictable, and universally understood words. Your team will thank you for it.</p><pre>// ✅ GOOD<br><br>// Simple, direct, and meets expectations.<br>function deleteUser(userId) { /* ... */ }<br><br>// Everyone knows what &quot;start&quot; means.<br>function startUpload(file) { /* ... */ }<br><br>// &quot;get&quot; is the standard verb for retrieval.<br>const config = getConfiguration();</pre><blockquote><strong>Practical Tip:</strong> Embrace convention. In JavaScript, common action verbs include <strong>‘get’, ‘set’, ‘create’, ‘update’, ‘delete’, ‘start’,</strong> <strong>‘stop’</strong>, <strong>‘is’</strong>, <strong>‘has’</strong>, and <strong>‘handle’.</strong> When in doubt, choose the simplest, most common word.</blockquote><blockquote><strong>AI Prompt Tip:</strong> “Is <strong>‘retrieveItems’</strong> a common way to name a function that fetches a list of products in JavaScript? What are more conventional alternatives?”</blockquote><h3>Conclusion: Better Names, Better Teamwork</h3><p>We’ve looked at some of the most common naming mistakes: names that are too vague, too personal, or too fancy. We’ve also seen that the “right” name depends on its context.<br> Ultimately, good naming isn’t about memorizing rules. It’s an act of empathy — for your future self, for your human teammates, and even for your AI assistants. Clear names lead to clearer thinking, smoother code reviews, and faster development.<br> So, in your next project or code review, don’t just check if the code works. Ask if it communicates. Start the conversation with your team. <strong>It’s one of the most impactful investments you can make in your team’s long-term success!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f94c1b3c1cea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[프론트엔드에 적절한 폴더구조는 없다.]]></title>
            <link>https://blog.techeer.net/%ED%94%84%EB%A1%A0%ED%8A%B8%EC%97%94%EB%93%9C%EC%97%90-%EC%A0%81%EC%A0%88%ED%95%9C-%ED%8F%B4%EB%8D%94%EA%B5%AC%EC%A1%B0%EB%8A%94-%EC%97%86%EB%8B%A4-ba3a47e91508?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba3a47e91508</guid>
            <category><![CDATA[folder-structure]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 10:40:08 GMT</pubDate>
            <atom:updated>2024-02-24T11:49:31.899Z</atom:updated>
            <content:encoded><![CDATA[<h3>프론트엔드에 적절한 폴더구조는 없다</h3><h3>들어가며</h3><p>프론트엔드의 세계에 들어온지도 1년이 넘은 상황, 여기서 개발 경험을 쌓아가며 한 가지 궁금증이 생겼습니다.</p><blockquote><strong>프론트엔드에 정답이 있기는 한 걸까?</strong></blockquote><p>말 그대로입니다. 프론트엔드 개발을 하면 할 수록, 특히 설계를 할 때 무엇이 가장 좋은 지 알 수 없었다는 점이었습니다.</p><p>아직 경험을 쌓는 과정이라서 그런 지 모르겠지만 그걸 감안하더라도 겪었던 구조는 정말 많았습니다. React에 <strong>MVC</strong>를 적용시키는 것부터 시작해서, <strong>페이지 따로 컴포넌트 따로</strong> 가는 사람이 있다던가, 아니면 <strong>페이지 단위로 묶어서 </strong>그 안에 모든 분리된 파일들을 관리하는 방법 등등…</p><p>이 글에서는 저의 개발경험 중 겪었던 <strong>4가지 폴더구조</strong>를 다룹니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UbUk9H2cxVY34R3t.png" /></figure><h3>정답이 없다는 양날의 검을 쥔 프론트엔드</h3><p>말 그대로 프론트엔드는 <strong>양날의 검</strong>입니다. <br>정답이 없어 원하는 대로 할 수 있지만, 원하는 대로 <strong>해야“만”하기에</strong> 혼란스럽죠.</p><p>분명 개발 초기에는 <strong>“와, 이건 진짜 혁신이다! 솔직히 이보다 더 나은 구조가 없을거야”</strong> 라고 확신에 찬 말을 하곤 합니다. 하지만 요구조건이 바뀌고, 프로젝트 규모가 커지고, 복잡해지면서 <strong>“어..? 이거 뭔가 이상한데”</strong> 라는 기분을 느끼며 더 나은 구조를 찾아나서곤 하죠.</p><p>결국은 리팩터링으로 이어지고 개선이 되어도 시간이 지나면서 다시 개선할 필요성을 느끼게 됩니다.</p><p>무한 반복입니다. 여기서 정답이 없다는 느낌을 많이 느꼈습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*HSbEHZgmkVLvQZddzO2NMw.png" /></figure><h3>예를 들어볼까요?</h3><p>지금까지 보고 겪어왔던 폴더구조들은 다음과 같았습니다. 아마 여러분들께 친숙한 구조들이 보일 것이라고 봅니다.</p><h3>1. pages, components로 나뉘어서 관리되는 폴더구조</h3><pre>src/<br>|-- components/<br>|   |-- Button/<br>|   |   |-- index.js<br>|   |   |-- Button.css<br>|   |-- Navbar/<br>|       |-- index.js<br>|       |-- Navbar.css<br>|-- pages/<br>|   |-- Home/<br>|   |   |-- index.js<br>|   |   |-- Home.css<br>|   |-- About/<br>|       |-- index.js<br>|       |-- About.css</pre><p>주로 <strong>React 프로젝트</strong>에서 사용하는 폴더구조입니다.</p><h4><strong>장점</strong></h4><ol><li>확실히 <strong>이건 페이지다, 컴포넌트다</strong> 라는 것을 빠르게 식별할 수 있다는 장점을 지닙니다.</li><li><strong>components 폴더</strong> 안에 있는 컴포넌트들을 빠르게 가져다가 사용할 수 있기에 코드 중복이 줄어들고 일관성이 유지됩니다.</li><li>잘 알려진 <strong>컴포넌트 기반의 개발</strong>이기에 유지보수성이 좋습니다.</li></ol><p>가장 근본이라고 봐도 좋을 만큼 괜찮은 폴더구조입니다. <br>하지만 여기에는 다음과 같은 단점이 있죠.</p><h4>단점</h4><ol><li><strong>폴더 깊이가 증가</strong>하고, 컴포넌트가 분리되면 분리될 수록 <strong>찾아가기가 더 어렵습니다.</strong></li><li><strong>페이지에 특화된 컴포넌트</strong>를 다른 페이지에서 재사용할 때, 제대로 모듈화되어있지 않았다면 <strong>관리가 어려워집니다.</strong></li></ol><p>처음에는 위와 같은 폴더 구조를 사용하여 개발을 하였지만, 페이지에서 작업하다가 연결된 컴포넌트를 타고 들어가는 것에 복잡함을 느껴 다른 구조를 찾아보기도 하였습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*bhQl9pXUQVLVuWSNfnN6ew.png" /><figcaption>그래서 누가 버튼이라고?</figcaption></figure><h3>2. pages 없이 컴포넌트 디렉터리로만 이루어진 폴더구조</h3><pre>src/<br>| - components/<br>| | - Button/<br>| | | - index.js<br>| | | - Button.css<br>| | - Navbar/<br>| | | - index.js<br>| | | - Navbar.css<br>| | - Home/<br>| | | - index.js<br>| | | - Home.css<br>| | - About/<br>| | - index.js<br>| | - About.css</pre><p>이 구조는 <strong>React Native로</strong> 개발을 할 때 레거시 코드로 접했던 구조였습니다. 다음과 같은 장점이 있다고 볼 수 있었습니다.</p><h4>장점</h4><ol><li><strong>모든 것이 컴포넌트</strong>로 구성되어 있어 구조가 단순하고 이해하기 쉽습니다.</li><li><strong>모든 요소가 컴포넌트</strong>이므로 재사용성과 확장성이 높습니다.</li></ol><p>모든 것을 컴포넌트로 만들어서 관리를 한다? <br>이거 꽤 괜찮은 방법이겠다 싶었습니다.</p><p>하지만 개발을 하면서 느꼈던 한계가 분명히 있었고, 다음과 같았습니다.</p><h4>단점</h4><ol><li><strong>페이지를 명확히 구분하지 않</strong>기 때문에, 어떤 컴포넌트가 특정 페이지에 속하는지 식별하는 데 어려움을 겪었습니다. 특히 규모가 커질 수록 이는 심해졌습니다.</li><li><strong>모든 것이 컴포넌트</strong>로 구성되어 있기에 라우팅을 관리할 때 무엇이 메인인 지 따로 적어두고 관리해야하는 불편함이 있었습니다.</li></ol><p>컴포넌트라서 좋았지만, 구분없는 컴포넌트라서 아쉬웠습니다. 은근 라우팅 편한 것이 개발할 때 중요하더군요.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*7zkhLcP69yJkZa3UjytzKQ.png" /><figcaption>라우팅이 제일 쉬웠어요 ^^</figcaption></figure><h3>3. pages 내부에는 라우팅만을 하고 components, utils 등에서 관리가 되는 구조</h3><pre>src/<br>| - components/<br>| | - Button/<br>| | - index.js<br>| | - Button.css<br>| - pages/<br>| | - HomePage.js<br>| | - AboutPage.js<br>| - utils/<br>| | - api.js<br>| | - helper.js<br>| - App.js<br>| - routes.js</pre><p><strong>Next.js</strong>를 사용한 프로젝트를 했을 때의 폴더구조였습니다. 폴더구조 기반의 라우팅을 지원하는 프레임워크였기에 pages, app 을 통해 페이지의 라우팅만을 관리하고 컴포넌트로 나머지를 구현하였습니다.</p><h4>장점</h4><p>1. <strong>라우팅과 UI 로직이 분리</strong>되어 있어, 2번 폴더구조에서 발생했던 라우팅 관련 복잡성은 감소했습니다.<br>2. <strong>1번 폴더구조의 장점을 채용</strong>하면서 코드의 재사용성과 모듈화가 증가합니다.</p><p>라우팅되는 것을 파일을 통하지 않고 디렉터리만으로 볼 수 있다는 점이 가장 좋았습니다.</p><h4>단점</h4><ol><li><strong>1번 폴더구조의 단점</strong>을 그대로 가져옵니다.</li><li>규모가 커짐에 따라 pages와 components, utils 간의 의존성이 복잡해질 수 있습니다.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*63qlH-yTZ4OYAU6Jbie4DQ.png" /><figcaption>정말 화목한 마을이에요</figcaption></figure><h4>4. 공통 컴포넌트를 제외하고 재사용되지 않는 컴포넌트와 로직을 모두 pages의 페이지 이름으로 되어있는 폴더에서 관리되는 구조</h4><pre>src/<br>| - components/<br>| | - Button/<br>| | - index.js<br>| | - Button.css<br>| - pages/<br>| | - Home/<br>| | | - components/<br>| | | | - WelcomeMessage.js<br>| | | - Home.js<br>| | | - Home.css<br>| | - About/<br>| | - components/<br>| | | - TeamInfo.js<br>| | - About.js<br>| | - About.css</pre><p>최근에 찾은 가장 유용하다고 보고 있는 폴더구조입니다. 현재는 이런 형태의 구조를 선호하고 있죠.</p><h4>장점</h4><ol><li><strong>페이지별로 컴포넌트와 로직이 고립</strong>되어 있다는 특징으로 인해, 해당 페이지의 기능 수정 시 <strong>다른 페이지에 영향을 미치지 않습니다.</strong></li><li><strong>폴더와 파일 구조가 페이지 구조와 일치</strong>하여, <strong>프로젝트의 구조를 이해하는 데 더 적은 시간</strong>이 듭니다.</li></ol><p>특히 이 직관성과 연결되어있는 장점이 협업을 할 때 많은 시간을 줄일 수 있게 도왔습니다.<br>하지만 이 폴더구조에도 한계가 존재했습니다.</p><h4>단점</h4><ol><li>페이지별로 컴포넌트와 로직이 분리되어 있어, 유사한 기능을 가진 컴포넌트의 <strong>재사용성이 저하됩니다</strong>. 이해를 높이고 재사용성을 버린 케이스입니다.</li><li>이를 해결하기 위해 공통 기능으로 잘 나눠두었다 해고 공통 기능의 변경이 필요할 때, <strong>여러 페이지에서 확인</strong>해 보아야 한다는 특징이 있습니다. <strong>테스트의 중요성이 더욱 강조</strong>되는 경우입니다.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*ZvLOPkbLihWYuQdQ0wy74g.png" /><figcaption>보급된 정수기를 교체해야한다고 생각해볼까요?</figcaption></figure><h3>마치며 — 그래서 저는 이렇게 생각합니다.</h3><p>저는 이 프론트엔드를 개발하는 것에 정답이라고 불리는 폴더구조는 없다고 생각합니다.</p><p>대신 그저 특정 상황에서 사용하기 괜찮은 폴더구조만이 존재하죠.</p><p>요즘과 같이 <strong>Next.js</strong>와 같은 지정된 폴더 구조를 가지고 있는 프레임워크가 점유율을 높여가고 있는 시장상황에서도 상세한 폴더구조는 제각기 다른 모습을 지니고 있습니다.</p><p>어쩌면 여기도 백엔드처럼 변화의 흐름이 더져지고 정체된다면 MVC와 같은 정형화된 패턴이 생기진 않을까 기대되기도 하지만, 그게 언제가 될 지는 잘 모르겠네요.</p><blockquote><strong>여러분들은 어떻게 생각하시나요? 프론트엔드에 정답은 존재할까요?</strong></blockquote><p>글을 마칩니다. 가장 빠르고 편안한 클라이언트 환경을 만드는 그날까지 모두 파이팅!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba3a47e91508" width="1" height="1" alt=""><hr><p><a href="https://blog.techeer.net/%ED%94%84%EB%A1%A0%ED%8A%B8%EC%97%94%EB%93%9C%EC%97%90-%EC%A0%81%EC%A0%88%ED%95%9C-%ED%8F%B4%EB%8D%94%EA%B5%AC%EC%A1%B0%EB%8A%94-%EC%97%86%EB%8B%A4-ba3a47e91508">프론트엔드에 적절한 폴더구조는 없다.</a> was originally published in <a href="https://blog.techeer.net/">Techeer Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[ComputerScience] 비전공자의 시선으로 바라본 TCP와 UDP, 이쯤되면 다시 한번 복습해 봐야겠죠?]]></title>
            <link>https://blog.techeer.net/computerscience-%EB%B9%84%EC%A0%84%EA%B3%B5%EC%9E%90%EC%9D%98-%EC%8B%9C%EC%84%A0%EC%9C%BC%EB%A1%9C-%EB%B0%94%EB%9D%BC%EB%B3%B8-tcp%EC%99%80-udp-%EC%9D%B4%EC%AF%A4%EB%90%98%EB%A9%B4-%EB%8B%A4%EC%8B%9C-%ED%95%9C%EB%B2%88-%EB%B3%B5%EC%8A%B5%ED%95%B4-%EB%B4%90%EC%95%BC%EA%B2%A0%EC%A3%A0-1a89d799b6bc?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a89d799b6bc</guid>
            <category><![CDATA[handshake]]></category>
            <category><![CDATA[udp]]></category>
            <category><![CDATA[tcp]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 13:21:55 GMT</pubDate>
            <atom:updated>2024-01-09T16:01:11.805Z</atom:updated>
            <content:encoded><![CDATA[<p>개발자를 꿈꾸는 수많은 사람들은 대부분 컴퓨터 공학과를 나왔습니다.<br>그렇기에 거의 대부분의 사람들은 컴퓨터 네트워크 과목을 배웠거나 배우는 중일 것입니다.</p><p>그러다보면 문득 궁금증이 생깁니다. “그래서 이게 뭔데?”</p><p>비전공자인 저에게는 이런 근본적인 내용이 쉽게 이해되지는 않았습니다. 그렇기 때문에 이런 제가 작정하고 정리해본다면 어떤 글을 작성할 수 있을까 궁금했습니다.</p><p>컴퓨터 네트워크의 근본이라 불리는 TCP와 UDP, 지금 시작합니다!</p><p>(그리고 마지막엔 TCP의 특징의 원리인 handshake도 다루고 있데요!)</p><h3>TCP, 안전하게 데이터를 보내야 해요</h3><p>가장 먼저 등장하는 개념인 TCP는 근본적으로 중요합니다.<br>앞으로 배우게 될 수많은 개념들에서 중간중간에 계속 나올 것이기 때문이죠.</p><p><strong>TCP(Transmission Control Protocol), 혹은 전송 제어 프로토콜(전송조종규약)</strong>이라고 불리는 이 개념은 우리가 <strong>IP</strong>라고 부르는 인터넷 프로토콜 스위트의 핵심 프로토콜 중 하나 입니다.</p><p>방금 말한 <strong>IP</strong>와 함께 <strong>TCP/IP</strong>라는 명칭으로도 널리 불리고 있으며 <strong>OSI 모델의 제 4계층</strong>에 해당하는 프로토콜로, 인터넷 프로토콜과 함께 구성되어 있습니다.</p><blockquote><strong>가장 널리 사용 되는 정보 전달을 해주는 연결형 프로토콜</strong></blockquote><p>쉽게 말하자면 위와 같이 설명 가능하며, 주로 다음과 같은 역할을 수행합니다.</p><ol><li>근거리 통신망, 인트라넷, 인터넷에 연결된 컴퓨터에서</li><li>실행되는 프로그램 간의 일련의 <strong>옥텟(1)</strong>을</li><li>안정적으로, 순서대로, 에러 없이 교환할 수 있도록 하는 역할</li></ol><p>그리고 이런 역할은 일련의 과정을 통해 수행되는데, 그 과정은 다음과 같습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/0*juQzwQ5WGcV7kLpj.png" /><figcaption>TCP 작동과정</figcaption></figure><ol><li>TCP는 <strong>데이터스트림(2)</strong>에서 데이터를 받아들입니다.</li><li>받아들인 데이터를 <strong>청크 단위(3)</strong>로 분할합니다.</li><li>분할 이후 <strong>TCP헤더(4)</strong>를 덧붙여 <strong>TCP 세그먼트(5)</strong>를 생성합니다.</li><li><strong>TCP 세그먼트</strong>는<strong> IP 데이터그램(6)</strong>에 <strong>패킷화(7)</strong>되어 상대방과 주고받게 됩니다.</li><li>그렇게 한 컴퓨터에서 다른 컴퓨터로 전송되는 모든 데이터가 오류나 결함 없이 올바른 순서로 성공적으로 수신되도록 합니다.</li></ol><h3>설명 잘 되었어요, 좋아요. 그런데…</h3><p>그림과 함께 무언가 이해가 된 것 같지만, 여기서 이야기 하는 많은 용어들에 대해 아직 제대로 알지 못해 무언가가 부족한 것 같습니다.</p><p>그래서 위에 강조해둔 단어들을 잠시 정리하고 가보려고 합니다.</p><blockquote>개념정리</blockquote><p><strong>(1) 옥텟</strong></p><ul><li>8비트, 즉, 1 바이트를 의미합니다.</li><li>컴퓨터 네트워킹에서 표준 데이터 단위로 사용됩니다.</li><li>TCP에서 데이터 전송의 기본 단위로 사용됩니다.</li></ul><p><strong>(2) 데이터스트림</strong></p><ul><li>연속적인 데이터의 흐름을 의미합니다(Data + Stream).</li><li>일반적으로 파일, 데이터베이스 또는 네트워크로부터 읽거나 쓰는 데이터를 말합니다.</li><li>TPC는 이 데이터스트림을 효율적으로 전송하기 위해 사용됩니다.</li></ul><p><strong>(3) 청크</strong> <strong>단위</strong>로 분할된 데이터는 어떻게 보일까?</p><ul><li>청크 단위로 분할된 데이터는 작은 데이터 블록으로 나뉩니다.</li><li>각 청크는 독립적으로 전송되고, 목적지에서 다시 조립됩니다.</li><li>이는 데이터를 더 관리하기 쉽고, 효율적으로 전송하기 위한 방법입니다.</li></ul><p><strong>(4) TCP헤더</strong></p><ul><li>TCP 헤더는 TCP의 세그먼트의 시작 부분에 위치하며, 송신자 및 수신자의 여러 정보들을 포함합니다.</li><li>이 정보들은 데이터 전송을 제어하고, 에러를 나타내는 데 중요한 역할을 합니다.</li></ul><p><strong>(5) TCP 세그먼트</strong></p><ul><li>TCP 헤더와 데이터 부분으로 구성된 패킷입니다.</li><li>네트워크를 통해 전송되며, 목적지에서 TCP 헤더를 사용하여 다시 올바르게 조립합니다.</li></ul><p><strong>(6) IP 데이터그램</strong></p><ul><li>IP 데이터그램은 인터넷 프로토콜(IP)을 통해 전송되는 패킷의 기본 단위입니다.</li><li>각 데이터그램은 헤더와 데이터 부분을 포함하며, 네트워크를 통해 독립적으로 라우팅됩니다.</li></ul><p><strong>(7) 패킷화</strong></p><ul><li>큰 데이터를 작은 패킷으로 나누는 과정을 말합니다.</li><li>작은 패킷들은 네트워크를 통해 별도로 전송되며, 목적지에서 다시 조립되어 완전한 데이터로 복원됩니다.</li><li>데이터 전송의 효율성을 높이고 네트워크의 혼잡함을 줄일 수 있으며, 데이터가 손상되거나 유실되었을 때 특정 부분만 재 전송할 수 있도록 해줍니다.</li></ul><h3>원리는 알겠어요. 그럼 TCP는 언제 사용되나요?</h3><p>TCP는 우리가 온라인으로 활용하는 정말 친숙한 많은 것들에서 사용됩니다.</p><ol><li>웹 브라우징</li><li>이메일, 파일 전송</li><li>온라인 게임(데이터 지연이 상대적으로 덜 중요한 게임)</li><li>원격 접속</li></ol><p>특히 신뢰성이 중요한 프로그램들에서 사용된다고 볼 수 있어요.</p><p>컴퓨터로 무언가를 하는데 데이터가 안전하게 전송되어야 된다? “그렇다면 이건 높은 확률로 TCP다!” 라고 생각하면 됩니다.</p><h3>UDP, 빠르게 데이터를 전송해야해요</h3><p><strong>UDP(User Datagram Protocol), 사용자 데이터그램 프로토콜</strong>이라 불리는 이 개념은 간단하게 말하자면 다음과 같은 특징을 가집니다.</p><blockquote>“빠르다&quot;</blockquote><p>복잡하게 말하자면 다음과 같은 특징을 가지죠.</p><blockquote>“전달을 확인하고 순차 보장 기능이 없는 대신 오버헤드(1)가 작고 지연시간이 짧다”</blockquote><blockquote>개념 정리</blockquote><p>여기서도 다시 한 번 더 개념을 정리하고 가볼게요</p><p><strong>(1) 오버헤드</strong></p><ul><li><strong>오버헤드</strong>는 특정 작업을 수행하기 위해 필요한 추가적인 시간 또는 리소스를 의미합니다.</li><li>UDP의 경우, TCP에 비해 오버헤드가 작다고 하는데, 이 말은 데이터를 전송하는 데 필요한 추가적인 처리 시간과 리소스가 적다는 것을 의미합니다.</li><li>이는 UDP가 연결 설정, 상태 유지, 에러 복구 등 복잡한 메커니즘을 갖추지 않기 때문입니다.</li></ul><p><strong>(Plus) 데이터그램 도착 순서가 바뀌거나, 중복되거나, 심지어는 통보 없이 누락시키는 상황은 무엇이 있을까?</strong></p><ul><li>예시를 들어보자면 실시간 스트리밍 중 일부 프레임이 늦거나 도착하지 않는 경우가 있습니다.</li><li>네트워크 지연이나 혼잡으로 인해 발생할 수 있으며, UDP는 이러한 상황이 벌어져도 복구하는 매커니즘을 제공하지 않습니다.</li></ul><h3>그렇다면 UDP는 언제 사용되나요?</h3><p>TCP와 함께 <strong>데이터그램(1)</strong>으로 알려진 짧은 문장의 메세지를 교환하기 위해 사용됩니다.<br>주로 TCP의 안정성을 필요로 하지 않는 애플리케이션의 경우에 사용합니다. <strong>DNS(2)</strong>, <strong>IPTV(3)</strong>, <strong>음성 인터넷 프로토콜(VoIP)(4)</strong>, TFTP, <strong>IP 터널(5)</strong>, 그리고 많은 온라인 게임 등에서 사용됩니다.</p><p>오디오, 비디오 스트리밍 서비스, 온라인 게임과 같이 실시간 성능이 매우 중요하지만, 데이터 손실이 생겨도 괜찮은 서비스들에 사용됩니다.</p><blockquote>개념 정리</blockquote><p><strong>(1) 데이터그램</strong></p><ul><li>UDP는 짧은 메세지를 데이터그램 형식으로 전송합니다.</li><li>데이터그램은 독립적인 패킷으로, 각각의 패킷이 독립적인 경로로 전송될 수 있습니다.</li></ul><p><strong>(2) DNS</strong></p><ul><li>인터넷 도메인 이름을 IP 주소로 변환하는 시스템입니다.</li><li>빠른 조회가 필요하기에 UDP를 사용합니다.</li></ul><p><strong>(3) IPTV</strong></p><ul><li>인터넷 프로토콜을 사용하여 텔레비전 콘텐츠를 전송합니다.</li><li>실시간 전송에 적합하므로 빠른 전송을 위해 UDP가 사용됩니다.</li></ul><p><strong>(4) 음성 인터넷 프로토콜(VoIP)</strong></p><ul><li>인터넷을 통해 음성 통신을 가능하게 하는 기술입니다.</li><li>지연 시간을 최소화하기 위해 UDP를 사용합니다.</li></ul><p><strong>(5) IP 터널</strong></p><ul><li>한 네트워크를 다른 네트워크로 연결하는 데 사용되는 기술입니다.</li><li>데이터 패킷을 캡슐화하여 전송하는 데 UDP가 사용될 수 있습니다.</li></ul><h3>정리하자면, TCP는 신뢰를, UDP는 속도를 챙긴거군요?</h3><p>맞습니다! 잘 따라오고 계시네요</p><p>가장 큰 차이점은 <strong>데이터 신뢰성</strong>을 중시하는지, <strong>속도(실시간)</strong>를 중시하는지 라고 볼 수 있습니다.<br>TCP는 <strong>연결형 프로토콜</strong>이기에 데이터 신뢰성을 중시하는 반면에 <strong>비 연결형 프로토콜</strong>인 UDP의 경우에는 신뢰성보다는 속도를 더 중요시하는 특징을 가집니다.</p><p>TCP는 데이터 재전송을 염두에 두고 데이터를 교환하는 반면 UDP는 이를 염두에 두지 않아 TCP보다 빠른 전송 속도를 가지고 있습니다.</p><blockquote>예를들어 볼까요? 이렇게 이해해보도록 하죠!</blockquote><p>TCP는 전화 통화와 같습니다. 양측 모두가 서로 통신할 준비가 되어있어야만 정보를 전달할 수 있습니다.</p><p>반대로 UDP는 무전과 같습니다. 통신 준비를 확인하지 않기도 하며, 상대가 없을 경우 들을 준비가 된 상대가 없는데도 무전은 넘어가서 결국 데이터가 전송되지 않은 것과 같은 결과로 이어질 수도 있습니다.</p><h3>TCP는 신뢰성과 안전성이 특징이라고 했죠. 왜죠?</h3><p>문득 “왜?” 라는 질문이 떠오르는 때가 있고, 이 때 알아두면 정말 오래가죠. 그래서 저는 실제로 알아두기 위해 추가적으로 조사를 해보았습니다.</p><p>그리고 그 결과 아래와 같은 결론을 내릴 수 있었습니다.</p><blockquote>TCP는 클라이언트와 서버가 서로 <strong>악수</strong>를 하며 안전함을 보장한다.</blockquote><p>여기서 <strong>악수</strong>라는 키워드에 주목하셔야 합니다. 우리 사회에서도 어떤 협약이나 조약을 맺을 때 대표자들끼리 모여 악수를 하며 신뢰를 보이는 모습을 본 적 있으시죠?</p><p>바로 그것처럼 TCP도 클라이언트와 서버가 서로 악수를 하며 데이터를 안전하게 주고받기 위한 과정을 거칩니다.</p><p><strong>그리고 우린 그것을 handshake라고 부릅니다. </strong>그리고 3-way handshake와 4-way handshake 두 종류로 나뉘어집니다.</p><h3>3-way handshake, 데이터 전송해도 될까요?</h3><p>3-way handshake란 TCP/IP 프로토콜을 이용해 통신을 하는 응용프로그램이 데이터를 전송하기 전에 먼저 정확한 전송을 보장하기 위해 상대방 컴퓨터의 세션을 사전에 먼저 수립하는 과정입니다.</p><p>양쪽 모두 데이터를 전송할 준비가 되어있다는 것을 보장하고, 실제로 데이터 전달이 시작하기 전에 다른 쪽에서 준비되었다는 것을 알 수 있도록 해줍니다.</p><p><strong>1. 클라이언트가 서버에게 연결 요청(SYN)</strong><br>클라이언트는 SYN 패킷을 보내고, <strong>SYN_SENT</strong> 상태가 됨</p><p><strong>2. 서버는 클라이언트의 요청을 수신(SYN/ACK)</strong><br>연결을 수락한다는 ACK(ACKnowledgment)와 함께 자신의 SYN 패킷을 보냄<br>서버는 <strong>SYN_RECEIVED</strong> 상태가 됨</p><p><strong>3. 클라이언트는 서버의 SYN/ACK에 대해 ACK를 보냄</strong><br>이후부터는 양쪽 모두 데이터를 주고받을 수 있는 <strong>ESTABLISHED</strong> 상태가 됨</p><p>위와 같은 세 과정을 통해 진행되며 TCP 접속을 성립하기 위해 반드시 필요한 과정이라고 볼 수 있습니다.</p><h3>4-way handshake, 데이터 다 보냈어요. 이제 끝내도 될까요?</h3><p><strong>3-way handshake</strong>가 데이터를 전송하기 위해 세션을 수집하는 과정이었다면 <strong>4-way handshake</strong>는 반대로 세션을 종료하기 위해 수행되는 절차입니다.</p><p>그리고 아래와 같은 과정을 통해 이루어집니다.</p><p><strong>1. 클라이언트의 연결 종료 요청 FIN 플래그를 사용하여 서버에 알림</strong></p><p><strong>2. 서버는 클라이언트에서 보낸 FIN 요청을 받고 ACK를 보내 클라이언트의 요청을 확인<br></strong>서버 자체의 모든 데이터가 전송되기 전까지 기다리며 TIME_WAIT 상태가 됨</p><p><strong>3. 서버의 모든 데이터 전송이 완료되면 서버에서 클라이언트에게 FIN 플래그를 보냄<br>4. 클라이언트는 서버의 FIN에 대해 ACK를 보내고 완전하게 연결이 종료된다.</strong></p><h3>왜 두 방법은 서로 단계에서 차이가 나는건가요?</h3><p>가장 큰 차이는 두 과정의 시점에 있습니다.</p><p>3-way handshake는 전송을 시작하기 위한 연결 시작 과정이고, 양쪽이 준비되었다는 것을 두 단계만으로 확인할 수 있다는 특징을 가지고 있습니다.</p><p>반면 4-way handshake는 서버와 클라이언트 모두에서 전송할 데이터가 없어야 한다는 것을 확인하는 과정이 들어가야 하는 연결을 종료하는 과정입니다.<br>여기서 <strong>“더 이상 전송할 데이터가 없어야 한다”</strong>를 만족시키기 위해 접속을 종료하기 전 한 단계가 더 들어간다는 것을 볼 수 있습니다.</p><p>그렇게 추가적인 단계를 수행하면서 TCP의 특징 중 하나인 <strong>“신뢰성 있는 데이터 전송”</strong>을 보장받게 됩니다.</p><p>이렇게 TCP, UDP에 대한 비전공자의 시선이었습니다.</p><p>마무리 정리 한 번 해보고 글을 마치도록 하죠!</p><ol><li>TCP는 안전성이 중요한 서비스에 적합한 개념의 데이터 교환 방식이며, 서로 3번, 4번의 악수를 하면서 안전하게 데이터를 교환해요. 물론 이런 과정들로 인해 시간은 더 오래 걸리기도 하지만 안전하게 데이터를 주고받을 수 있어요. 현재 가장 많이 사용되고 있는 HTTP 버전인 1.1, 2.0에서 사용되고 있답니다!</li><li>UDP는 실시간 서비스에 적합한 개념의 데이터 교환 방식이며, 굉장히 빠른 속도를 가지고 있어요. 물론 안전성은 떨어지지만 안전성이 떨어져도 괜찮은 서비스들에서는 용이하게 사용되고 있답니다!</li></ol><p>…</p><blockquote>??? 그런데, HTTP 3.0은 UDP 기반 아닌가요?</blockquote><blockquote>References</blockquote><p><a href="https://ko.wikipedia.org/wiki/%EC%A0%84%EC%86%A1_%EC%A0%9C%EC%96%B4_%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C">https://ko.wikipedia.org/wiki/%EC%A0%84%EC%86%A1_%EC%A0%9C%EC%96%B4_%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C</a><br><a href="https://m.blog.naver.com/ki630808/221859634986">https://m.blog.naver.com/ki630808/221859634986</a><br><a href="https://terms.tta.or.kr/dictionary/dictionaryView.do?subject=%EC%A0%84%EC%86%A1+%EC%A0%9C%EC%96%B4+%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C">https://terms.tta.or.kr/dictionary/dictionaryView.do?subject=%EC%A0%84%EC%86%A1+%EC%A0%9C%EC%96%B4+%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C</a><br><a href="https://massive.io/ko/file-transfer/what-is-transmission-control-protocol-tcp/">https://massive.io/ko/file-transfer/what-is-transmission-control-protocol-tcp/</a><br><a href="https://ko.wikipedia.org/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90_%EB%8D%B0%EC%9D%B4%ED%84%B0%EA%B7%B8%EB%9E%A8_%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C">https://ko.wikipedia.org/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90_%EB%8D%B0%EC%9D%B4%ED%84%B0%EA%B7%B8%EB%9E%A8_%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C</a><br><a href="https://prinha.tistory.com/entry/Network-TCP%EC%99%80-UDP%EB%A5%BC-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-%EC%9C%84%ED%95%9C-%EC%A0%81%EC%A0%88%ED%95%9C-%ED%99%98%EA%B2%BD">https://prinha.tistory.com/entry/Network-TCP%EC%99%80-UDP%EB%A5%BC-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-%EC%9C%84%ED%95%9C-%EC%A0%81%EC%A0%88%ED%95%9C-%ED%99%98%EA%B2%BD</a><br><a href="https://blog.koriel.kr/udp-tcp-tongsin-yeje/">https://blog.koriel.kr/udp-tcp-tongsin-yeje/</a><br><a href="https://studycapitalism.com/tcp-udp%EC%A0%84%EC%86%A1%EA%B3%84%EC%B8%B5-%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C-%EA%B0%9C%EB%85%90%EA%B3%BC-%EC%B0%A8%EC%9D%B4%EC%A0%90/">https://studycapitalism.com/tcp-udp%EC%A0%84%EC%86%A1%EA%B3%84%EC%B8%B5-%ED%94%84%EB%A1%9C%ED%86%A0%EC%BD%9C-%EA%B0%9C%EB%85%90%EA%B3%BC-%EC%B0%A8%EC%9D%B4%EC%A0%90/</a><br><a href="https://swalloow.tistory.com/77">https://swalloow.tistory.com/77</a><br><a href="https://mindnet.tistory.com/entry/%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%81%AC-%EC%89%BD%EA%B2%8C-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0-22%ED%8E%B8-TCP-3-WayHandshake-4-WayHandshake">https://mindnet.tistory.com/entry/%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%81%AC-%EC%89%BD%EA%B2%8C-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0-22%ED%8E%B8-TCP-3-WayHandshake-4-WayHandshake</a><br><a href="https://jeongkyun-it.tistory.com/180">https://jeongkyun-it.tistory.com/180</a><br><a href="https://velog.io/@averycode/%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%81%AC-TCPUDP%EC%99%80-3-Way-Handshake4-Way-Handshake">https://velog.io/@averycode/%EB%84%A4%ED%8A%B8%EC%9B%8C%ED%81%AC-TCPUDP%EC%99%80-3-Way-Handshake4-Way-Handshake</a><br><a href="https://resilient-923.tistory.com/392">https://resilient-923.tistory.com/392</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a89d799b6bc" width="1" height="1" alt=""><hr><p><a href="https://blog.techeer.net/computerscience-%EB%B9%84%EC%A0%84%EA%B3%B5%EC%9E%90%EC%9D%98-%EC%8B%9C%EC%84%A0%EC%9C%BC%EB%A1%9C-%EB%B0%94%EB%9D%BC%EB%B3%B8-tcp%EC%99%80-udp-%EC%9D%B4%EC%AF%A4%EB%90%98%EB%A9%B4-%EB%8B%A4%EC%8B%9C-%ED%95%9C%EB%B2%88-%EB%B3%B5%EC%8A%B5%ED%95%B4-%EB%B4%90%EC%95%BC%EA%B2%A0%EC%A3%A0-1a89d799b6bc">[ComputerScience] 비전공자의 시선으로 바라본 TCP와 UDP, 이쯤되면 다시 한번 복습해 봐야겠죠?</a> was originally published in <a href="https://blog.techeer.net/">Techeer Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[SiliconValley Winter Bootcamp] Remember Plus(Korean)]]></title>
            <link>https://medium.com/@threelight/siliconvalley-winter-bootcamp-remember-plus-korean-803311e5fa9c?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/803311e5fa9c</guid>
            <category><![CDATA[projects]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Tue, 15 Aug 2023 19:36:56 GMT</pubDate>
            <atom:updated>2023-08-15T19:36:56.917Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>명함을 등록하면 자동으로 관계도를 생성해 주는 서비스</strong></p><p>GitHub: <a href="https://github.com/SV-Summer-BootCamp-Team-F">https://github.com/SV-Summer-BootCamp-Team-F</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/0*KaTJ3ntBj23WGNbe.gif" /></figure><h3>Demo Video💡</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FOrf4dlkqGfo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOrf4dlkqGfo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOrf4dlkqGfo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b10db2043eba1493915a7072c3f78946/href">https://medium.com/media/b10db2043eba1493915a7072c3f78946/href</a></iframe><h3>Introduction</h3><p>리멤버 플러스(Remember Plus)는 의미 있는 관계들을 별자리로 시각적으로 나타내어 한눈에 쉽게 볼 수 있는 서비스입니다.</p><p>우리는 일상 생활 속에서 다양한 사람들을 만나고 관계를 형성합니다. 그러나 시간이 흐르며 더 많은 관계들이 발생하면, 그 중 일부는 잊혀지거나 소홀해질 수 있습니다.</p><p>“이 소중한 관계들을 하나도 빠뜨리지 않고 하나씩 보여줄 수 없을까?” 라는 생각에서 출발하여 리멤버 플러스라는 서비스를 만들게 되었습니다.</p><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Z7vOmbwLax3Uw9VU.png" /></figure><p>파이썬의 장점을 활용하기 위해 ‘장고(Django)’ 프레임워크를 사용했습니다.<br>기본 아키텍처 위에, 다양한 컴포넌트를 통합하고 기본 환경을 설정하기 위해 도커(Docker)를 사용했습니다.<br>API를 효과적으로 작성하기 위해 장고와 장고 레스트 프레임워크(Django Rest Framework)를 사용했으며, RESTful API 사양을 체계적으로 정의하고 자동으로 문서화하기 위해 스웨거(Swagger)를 활용했습니다. <br>이로써 API 개발 과정의 일관성과 효율성이 향상되었습니다. <br>비동기 작업을 가능하게 하기 위해 구니콘(Gunicorn)을 사용하여 웹 서버와 장고 애플리케이션 간의 통신을 효과적으로 관리했습니다. <br>또한 백엔드 로직과 프론트엔드 인터페이스를 하나의 웹 애플리케이션으로 통합하기 위해 엔진엑스(Nginx) 웹 서버를 사용했습니다.<br>데이터베이스로는 MySQL보다 관계 데이터베이스를 구축하기에 더 적합한 네오4j(neo4j)를 선택했습니다.<br>프로메테우스(Prometheus)를 통해 서비스의 CPU와 메모리 사용량에 대한 메트릭을 생성하고, 요청 및 응답 정보를 수집했습니다. <br>이를 그라파나(Grafana)를 사용하여 모니터링했습니다.</p><h3>Frontend</h3><h3>Three.js</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Maau8OYsdCZUNepj.gif" /></figure><p>서비스를 시작하면 볼 수 있는 첫 번째 페이지입니다.<br>서비스의 핵심 키워드가 별자리라는 점을 감안하여, 사용자들에게 우주로 들어가는 느낌을 주고자 했습니다.<br>그래서 이 페이지에서는 Three.js를 활용했습니다.<br>카메라의 시점과 시야각에 따라 변하는 생동감 있는 움직임을 만들었습니다.</p><h3>D3.js</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y8NcpVE7zl9gO26f.gif" /></figure><p>그리고 이것이 사용자 관계를 별자리로 진짜로 시각화하는 서비스의 부분입니다.<br>우리 팀은 사용자 관계 그래프라는 복잡한 그래프를 구현해야 했습니다.<br>페이지를 디자인할 때 복잡한 관계를 시각화하고 구현하며, 그 위에 추가 기능도 제공해야 했습니다.<br>그래서 이러한 요구 사항을 충족하기 위해, SVG 기술을 기반으로 한 순수 자바스크립트 차트 라이브러리인 D3를 사용하여 구현하기로 했습니다.<br>D3를 적용하기 전에 페이지를 다음과 같이 디자인했습니다:<br>전체 화면 영역에 관계를 표시해야 하므로, 다음과 같이 계층을 분리하는 방법을 채택했습니다.<br>이렇게 하면 우리 팀은 의도한 대로 화면을 자유롭게 탐색할 수 있으며, 관계에 있는 사용자의 정보도 이렇게 로드할 수 있습니다.</p><h3>Highcharts</h3><p>사용자 페이지의 주요 목적은 사용자 활동의 통계 분석을 제공하는 것입니다. D3와 달리, 다양한 차트를 빠르게 구현할 수 있는 하이차트(highcharts)를 사용했습니다.<br>하이차트는 데모를 제공하므로, 자바스크립트와 HTML만 알고 있다면 복잡한 차트도 쉽게 수정하고 사용할 수 있습니다. 제공되는 차트는 거의 모든 브라우저에서 볼 수 있습니다.</p><h3>Backend</h3><p>네오4j는 관계 데이터를 저장하고 관리하기 위해 사용되는 그래프 데이터베이스 중 하나입니다.<br>다음 두 가지 이유로 이를 선택했습니다:<br>1. 노드와 링크의 형태로 나타낼 수 있는 데이터를 저장하는 데 특화되어 있습니다.<br>2. RDB(관계형 데이터베이스)는 관계를 쿼리할 때 많은 조인이 발생하는 반면, 네오4j와 같은 GDB(그래프 데이터베이스)는 관계가 직접 연결되어 있어 즉시 쿼리할 수 있습니다. 이로 인해 관계를 쿼리하는 것이 훨씬 빨라집니다.</p><p>다음은 RDB와 GDB를 위해 우리가 설계한 ERD(엔터티 관계 다이어그램)입니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*tr4ORSpnJi4rZ892.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*0-8v3pQz8WEQRgrB.jpg" /></figure><p>실제 예제 쿼리문을 비교해보겠습니다.</p><pre># 2촌 관계를 가져옴<br>MATCH (user:User {uid: $user_uid})-[:RELATION]-&gt;(mate:User)-[:RELATION]-&gt;(target:User)<br>WHERE NOT (user)-[:RELATION]-&gt;(target)<br>RETURN mate.uid, target.uid, target.name, target.photo</pre><pre>**SELECT m.uid AS mate_uid, t.uid AS target_uid, t.name AS target_name, t.photo AS target_photo<br>FROM User AS u<br>JOIN RELATION AS r1 ON u.uid = r1.user_uid<br>JOIN User AS m ON r1.mate_uid = m.uid<br>JOIN RELATION AS r2 ON m.uid = r2.user_uid<br>JOIN User AS t ON r2.mate_uid = t.uid<br>LEFT JOIN RELATION AS r3 ON u.uid = r3.user_uid AND t.uid = r3.mate_uid<br>WHERE r3.user_uid IS NULL;**</pre><p>네오4j에서의 쿼리가 더 간단함을 알 수 있습니다.<br>네오4j에서 관리되는 노드와 엣지 데이터는 서비스에서 D3를 통해 조직적으로 표시됩니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1fu7wP5hu7FNc88w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*g_8PiPrUNmcqjuYY.jpeg" /></figure><p>파이썬 WSGI(Web Server Gateway Interface)는 HTTP 서버 역할을 하여 엔진엑스(Nginx)로부터 서버 측 요청을 받고, 그 요청을 WSGI를 통해 장고(Django)로 처리합니다. <br>웹 애플리케이션의 확장성과 유연성을 높이는 역할을 합니다. <br>구니콘(Gunicorn)은 웹 서버와 애플리케이션 사이의 중재자 역할을 하며, 동시에 많은 사용자가 있는 환경에서도 안정적인 서비스 운영을 지원합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/0*6nIZd4PIJ_8Q4X9U.png" /></figure><p>클라이언트로부터 요청이 수신되었을 때 적절한 정적 파일로 응답하기 위해 HTTP 웹 서버를 활용했습니다. <br>또한 리버스 프록시 서버로도 활용하여 웹 애플리케이션 서버(WAS)에 대한 부하를 줄이기 위해 로드 밸런서를 사용했습니다.</p><h3>Deployment?</h3><h3>Deploy after private domain connection (with GABIA)</h3><ul><li><a href="https://developer-ping9.tistory.com/320">https://developer-ping9.tistory.com/320</a></li></ul><h3>How was it deployed?</h3><ul><li>EC2 생성<br>- 보안 그룹 설정 (포트 열기, SSH, 8080 등)<br>- 탄력적 IP를 생성하고 EC2 인스턴스에 매핑<br>- 성공적으로 배포되면 이 탄력적 IP를 통해 접근할 수 있음<br>- 이 IP에 특정 도메인을 매핑하면서 프론트엔드 코드 변경<br>- 과도한 요금 부과를 방지하기 위해 Docker 캐시를 지속적으로 삭제</li><li>EC2 관리<br>- docker system prune -a<br>- 단기 프로젝트나 비용 관리가 필요한 프로젝트에서는 이 명령을 지속적으로 입력하는 것이 좋습니다.<br>- EC2를 다시 시작하고 실행하기 전에 한 번 입력하는 것이 좋습니다.</li><li>EC2 용량 부족 오류가 발생하면?<br>- EC2 스토리지로 이동하여 볼륨 크기를 30GiB로 변경 (30까지 무료 티어)<br>- 기본 8GB는 매우 부족하다고 여겨질 수 있습니다.</li><li>스왑 메모리 설정</li><li>보안 그룹 설정</li><li>이러한 단계들을 따르면 EC2를 생성하고 관리하는 과정에서 필요한 설정들을 적용하고 문제를 해결할 수 있습니다.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CATwbq-TBQSDLTZm.png" /></figure><ul><li>다음과 같이 설정한 다음, HTTPS가 생성되고 연결되면 나중에 HTTPS를 연결하세요.</li><li>EC2 내부에서:<br>- Docker, Docker Compose 등 초기 설정을 설치하세요.<br>- 프로젝트를 클론하세요.<br>- 클론한 프로젝트 디렉터리로 이동하세요.<br>- 서브모듈을 클론했다면 서브모듈을 초기화하세요 (그렇지 않으면 compose가 불가능합니다.)<br>- Docker Compose를 빌드하세요. (docker-compose up -d — build)<br>- 공용 IPv4 주소 또는 연결된 도메인을 통해 접근하세요.</li></ul><p>이제 개발자들을 괴롭히세요.</p><h3>Monitoring</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*_w5YbghsKyLoFvie.png" /></figure><p>Prometheus는 실시간 성능 모니터링에 사용되며, 여러 소스로부터 데이터를 수집하고 저장할 수 있습니다. <br>Django와 Prometheus를 함께 사용하여 성능 지표를 모니터링하고 이를 통해 수집된 지표들은 Grafana 대시보드를 통해 시각화되어, 운영 팀이 시스템의 성능과 상태를 실시간으로 확인하고 분석할 수 있게 하였습니다.</p><h3>Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dFHE8vjSVH3LYyA4.gif" /></figure><p>화면 첫 페이지는 주요 디자인인 명함과 명함 간의 관계를 별자리 표현 관계를 더욱 살리기 위해 은하수를 공간의 배경으로 삼아 구현하였습니다. <br>마우스를 움직일 때마다 변하는 화면으로 사용자에게 입체적인 은하수 보여드리기 위해 주의를 기울였습니다 <br>‘start’ 버튼을 클릭하면, 사용자는 온보딩 페이지로 즉시 전환됩니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Il7EfIyrEVLGwnFR.gif" /></figure><p>온보딩 페이지는 사용자에게 사이트의 주요 기능을 소개하며, 이를 통해 사이트가 제공하는 서비스의 핵심을 이해할 수 있는 기회를 제공합니다. <br>스크롤을 통한 구조적인 정보 제공과 ‘시작하기’ 버튼을 클릭하여 로그인 페이지로 이동합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4SoEz6XVNwfw-qvw.gif" /></figure><p>회원가입을 하고 로그인하면 명함 등록 페이지로 이동합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aT4iHP_m7-zVOMwV.gif" /></figure><p>사용자의 명함을 등록하는 페이지입니다. <br>이 페이지를 통해 사용자 상대방의 이름, 전화번호, 이메일 등 필수 정보를 정확하게 입력하고 등록할 수 있습니다. <br>이 과정에서 입력된 정보의 확인 기능을 통해 오류를 최소화하며, 이를 통해 데이터의 정확도와 신뢰성을 높이는 것을 목표로 하였습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZpeTKVa6MJGemrbz.gif" /></figure><p>상대방의 명함을 등록하는 페이지입니다. <br>이 페이지를 통해 사용자는 상대방의 이름, 전화번호, 관계, 이메일 등 필수 정보를 정확하게 입력하고 등록할 수 있습니다. <br>특히, 입력한 ‘관계’ 정보는 관계 페이지에서 두 사용자 간의 연결성을 시각적으로 나타내는 데 사용되며, 개인 간의 연결망을 효과적으로 관리하기 편리하다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SQjBRrGa_v0qwqku.gif" /></figure><p>카드 인트로 페이지는 사용자의 개인정보를 변경할 수 있는 페이지입니다. <br>해당 페이지에서는 사용자의 프로필 및 이메일, 비밀번호 변경이 가능하고 이와 더불어 명함의 기본 정보 역시 수정이 가능합니다. <br>또한 하이차트를 활용한 데이터 분석을 통해 사용자는 자신만의 관계 데이터를 효과적으로 관리할 수 있게 만들었습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7dm6NOTQ0KKOKCbu.gif" /></figure><p>명함과 명함과의 관계 페이지입니다. <br>이 페이지는 확대 과정에서 점점 어두워지는 시각 효과를 적용하여 은하수 내 별자리의 느낌을 재현하였으며, 노드 주변의 빛나는 효과를 추가해 입체감을 강조하였습니다. <br>사용자는 자신을 중심으로 연결된 관계를 보여줍니다. <br>자신의 정보를 클릭하면 상세 정보와 명함의 이미지를 열람할 수 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SMr0Zf2CObau4Xqx.gif" /></figure><p>사용자는 자신과 연결되어 있는 다른 사람을 클릭함으로써 해당 사람의 정보와 명함을 상세히 확인할 수 있습니다. <br>이는 단순히 정보를 제공하는 것이 아니라, 개인 간의 연결망을 더욱 명확하고 직관적으로 파악할 수 있게 하는 기능으로서 구현되었습니다.</p><h3>Meet our team</h3><p>백동열: <a href="https://github.com/TMInstaller">https://github.com/TMInstaller</a></p><p>김민지: <a href="https://github.com/alswl020208">https://github.com/alswl020208</a></p><p>곽소정: <a href="https://github.com/ssojungg">https://github.com/ssojungg</a></p><p>백유진: <a href="https://github.com/rachel4w2">https://github.com/rachel4w2</a></p><p>임아정: <a href="https://github.com/ajaj0123">https://github.com/ajaj0123</a></p><p>정진원: <a href="https://github.com/zinwonzung">https://github.com/zinwonzung</a></p><p>하재민: <a href="https://github.com/penloo">https://github.com/penloo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=803311e5fa9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[SiliconValley Winter Bootcamp] Remember Plus]]></title>
            <link>https://medium.com/@threelight/siliconvalley-winter-bootcamp-remember-plus-3e1c5c8f3dcd?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e1c5c8f3dcd</guid>
            <category><![CDATA[projects]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Tue, 15 Aug 2023 19:01:57 GMT</pubDate>
            <atom:updated>2023-08-15T19:20:30.335Z</atom:updated>
            <content:encoded><![CDATA[<p>A service that automatically creates a relationship map when you register a business card</p><p><strong>명함을 등록하면 자동으로 관계도를 생성해 주는 서비스</strong></p><p>GitHub: <a href="https://github.com/SV-Summer-BootCamp-Team-F">https://github.com/SV-Summer-BootCamp-Team-F</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*F5uRUQgk6ogX-JV7lm3zjw.gif" /></figure><h3>Demo Video💡</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FOrf4dlkqGfo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOrf4dlkqGfo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOrf4dlkqGfo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/153ab02f8ce873557240b99483e7cb4c/href">https://medium.com/media/153ab02f8ce873557240b99483e7cb4c/href</a></iframe><h3>Introduction</h3><p>Remember Plus is a service that visually represents our meaningful relationships as constellations, making them easy to see at a glance.</p><p>We encounter various people and form relationships as we go through life.</p><p>However, as more relationships develop over time, some of them can be forgotten or neglected.</p><p>Starting from the idea of “Can we show these precious relationships one by one without missing any?” we came up with the service called Remember Plus.</p><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BFOl_hNMW9pvpHZTuj__g.png" /></figure><p>I utilized the ‘Django’ framework to leverage the advantages of Python.</p><p>On top of the basic architecture, I used Docker to integrate and manage various components and set up the basic environment.</p><p>I employed Django and Django Rest Framework to effectively write APIs, and utilized Swagger to systematically define and automatically document RESTful API specifications, thereby enhancing the consistency and efficiency of the API development process. I employed Gunicorn to enable asynchronous tasks, efficiently managing communication between the web server and the Django application, and used the Nginx web server to integrate backend logic and frontend interfaces into a single web application.</p><p>For the database, I chose neo4j, which is more suitable for constructing relationship databases than MySQL.</p><p>I used Django’s static files for data storage.</p><p>Through Prometheus, I generated metrics on the service’s CPU and memory usage, and collected request and response information. I monitored this using Grafana.</p><h3>Frontend</h3><h3>Three.js</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k_cbguUJoyuhS7Cb.gif" /></figure><p>Here’s the first page you’ll see when you start our service.</p><p>Given that the core keyword of our service is the zodiac, we wanted to give users the feeling of entering the universe.</p><p>So on this page, we utilized Three.js.</p><p>We have created lively movements that change depending on the direction of the camera’s perspective and the angle of view.</p><h3>D3.js</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jZ_JOSQBw08_wA7vQxCbLQ.gif" /></figure><p>And here is the part of the service that truly visualizes the zodiac, the user relationships.</p><p>Our team had to implement a complex graph called a user relationship graph.</p><p>When designing the page, we needed to visualize, implement complex relationships, and allow for additional features on top of that.</p><p>So, to meet these requirements, we chose to implement it using D3, a pure javascript chart library based on SVG technology.</p><p>Before applying D3, we designed the page as follows:</p><p>Since we had to display the relationships across the entire screen area, we adopted a method of separating the layers as follows,</p><p>Our team was able to freely navigate the screen as intended and still load information of the users who were in a relationship like this.</p><h3>Highcharts</h3><p>The main purpose of the user page is to provide statistical analysis of user activity. Unlike D3, we used highcharts, which allows for quick implementation of various charts.</p><p>Highcharts provides demos, so even if you only know JavaScript and HTML, you can easily modify and use complex charts. The charts provided can be viewed on almost all browsers.</p><h3>Backend</h3><p>Neo4j is one of the Graph Databases used to store and manage relational data.</p><p>We chose it for the following two reasons:</p><ol><li><strong>It is specialized in storing data that can be represented in the form of nodes and edges.</strong></li><li>While RDBs have many joins occurring when querying relationships, GDBs like Neo4j have relationships that are directly connected, enabling immediate querying. This makes querying relationships much faster.</li></ol><p>Here are the ERDs we designed for both the RDB and GDB, respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DCqJs-w3GwcYnv9O.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ulAxYbPKb3Hl42TI.jpg" /></figure><p>Let’s compare the actual example query statements.</p><pre># 2촌 관계를 가져옴<br>MATCH (user:User {uid: $user_uid})-[:RELATION]-&gt;(mate:User)-[:RELATION]-&gt;(target:User)<br>WHERE NOT (user)-[:RELATION]-&gt;(target)<br>RETURN mate.uid, target.uid, target.name, target.photo</pre><pre>**SELECT m.uid AS mate_uid, t.uid AS target_uid, t.name AS target_name, t.photo AS target_photo<br>FROM User AS u<br>JOIN RELATION AS r1 ON u.uid = r1.user_uid<br>JOIN User AS m ON r1.mate_uid = m.uid<br>JOIN RELATION AS r2 ON m.uid = r2.user_uid<br>JOIN User AS t ON r2.mate_uid = t.uid<br>LEFT JOIN RELATION AS r3 ON u.uid = r3.user_uid AND t.uid = r3.mate_uid<br>WHERE r3.user_uid IS NULL;**</pre><p>You can see that the query in Neo4j is simpler.</p><p>The node and edge data managed by Neo4j is displayed in an organized form in the service through D3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-cXHpHtEW48iqAZJwoqsjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*lIeyNGbZfBkOGJhGE09Hmg.jpeg" /></figure><p>Python WSGI acts as an HTTP server, receiving server-side requests from Nginx and then handling the Request through WSGI to Django. It plays a role in enhancing the scalability and flexibility of web applications. Gunicorn acts as a mediator between the web server and the application, supporting stable service operations even in environments with many concurrent users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*8W9OCphzlWKH4GB8b1aM2g.png" /></figure><p>We utilized an HTTP Web Server to respond with the appropriate static files when a request is received from a client. We also employed it as a Reverse Proxy Server, using a load balancer to reduce the load on the Web Application Server (WAS).</p><h3>Deployment?</h3><h3>Deploy after private domain connection (with GABIA)</h3><ul><li><a href="https://developer-ping9.tistory.com/320">https://developer-ping9.tistory.com/320</a></li></ul><h3>How was it deployed?</h3><ul><li>EC2 Creation</li><li>Setting security groups (opening ports, SSH, 8080, etc.)</li><li>Create an elastic IP and map it to the EC2 instance</li><li>Once deployed successfully, you can access it via this elastic IP</li><li>Change the front-end code while mapping a specific domain to this IP</li><li>Continuously delete Docker cache to prevent excessive charges</li><li>EC2 Management</li><li>docker system prune -a</li><li>Continuously enter this command for short-term projects or projects that need cost management</li><li>It’s good to enter it once before starting and running EC2 again</li><li>If an insufficient EC2 capacity error occurs?</li><li>Move to EC2 storage and change the volume size to 30GiB (up to 30 is free tier)</li><li>The basic 8gb can be considered very insufficient</li><li>Set up swap memory</li><li>Setting up security groups</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wX14clS6DHq9QSN5.png" /></figure><ul><li>Set it up like this, and later connect https when https is created and connected.</li><li>Inside the EC2</li><li>Install initial settings like docker, docker-compose, etc.</li><li>Clone the project</li><li>Move to the cloned project directory</li><li>If you cloned a submodule, initialize the submodule (otherwise, compose is not possible)</li><li>Build Docker Compose docker-compose up -d —build</li><li>Access via public IPv4 address or connected domain</li><li>Now, let’s torment the developers.</li></ul><h3>Monitoring</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YybTp3XdWaLyI1MQ.png" /></figure><p>Prometheus is used for real-time performance monitoring and can collect and store data from various sources. By using Django and Prometheus together, we monitor performance metrics. The collected metrics are visualized through the Grafana dashboard, allowing the operations team to check and analyze the system’s performance and status in real-time.</p><h3>Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U7YAgE9SRZnLlsXx.gif" /></figure><p>The main design of the first page features business cards, and in order to enhance the representation of the relationship between the cards, we used the Milky Way as the background of the space. We have paid attention to presenting users with a three-dimensional view of the Milky Way that changes as the mouse moves. By clicking the ‘start’ button, users are immediately taken to the onboarding page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qAaOh98u4VLfrzRM.gif" /></figure><p>The onboarding page introduces users to the main features of the site, offering them an opportunity to understand the core of the services provided by the site. Information is presented in a structured manner through scrolling, and by clicking the ‘Start’ button, users are directed to the login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oa1bbh-TTLuJkXN2.gif" /></figure><p>After signing up and logging in, users are directed to the business card registration page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sjd3tg-ytdy71CRP.gif" /></figure><p>This is a page for registering a user’s business card. Through this page, users can accurately enter and register essential information such as the recipient’s name, phone number, and email. We have aimed to minimize errors by including a verification feature for the entered information, thereby enhancing the accuracy and reliability of the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IsNwPDzmfg_RzPAW.gif" /></figure><p>This is a page for registering another person’s business card. Through this page, users can accurately enter and register essential information such as the other party’s name, phone number, relationship, and email. Notably, the entered ‘relationship’ information is used to visually represent the connection between the two users on the relationship page, making it convenient to effectively manage personal networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9FSKsUIxu7safVHk.gif" /></figure><p>The Card Intro page is where users can modify their personal information. On this page, users can change their profile, email, and password. In addition, they can also edit the basic information of their business card. Furthermore, by utilizing Highcharts for data analysis, users are enabled to effectively manage their own relationship data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Pvt8jjpLU5smqRFH.gif" /></figure><p>This is the page depicting the relationship between business cards. We’ve replicated the feel of constellations within the Milky Way by applying a visual effect that gradually darkens during the zooming process. We also added a luminous effect around the nodes to emphasize the three-dimensionality. The page displays relationships centered around the user. When users click on their information, they can view detailed information and the image of the business card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RMPer0JHXrZ2vUpL.gif" /></figure><p>Users can click on someone connected to them to view that person’s detailed information and business card. This feature is not just about providing information, but is implemented to help users more clearly and intuitively understand personal networks.</p><h3>Meet our team</h3><p>백동열: <a href="https://github.com/TMInstaller">https://github.com/TMInstaller</a></p><p>김민지: <a href="https://github.com/alswl020208">https://github.com/alswl020208</a></p><p>곽소정: <a href="https://github.com/ssojungg">https://github.com/ssojungg</a></p><p>백유진: <a href="https://github.com/rachel4w2">https://github.com/rachel4w2</a></p><p>임아정: <a href="https://github.com/ajaj0123">https://github.com/ajaj0123</a></p><p>정진원: <a href="https://github.com/zinwonzung">https://github.com/zinwonzung</a></p><p>하재민: <a href="https://github.com/penloo">https://github.com/penloo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e1c5c8f3dcd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boosting Code Quality with ESLint, Husky, and Prettier]]></title>
            <link>https://medium.com/@threelight/boosting-code-quality-with-eslint-husky-and-prettier-d729a1dc2913?source=rss-557ec95f73b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d729a1dc2913</guid>
            <category><![CDATA[eslint]]></category>
            <category><![CDATA[prettier]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[husky]]></category>
            <category><![CDATA[quality]]></category>
            <dc:creator><![CDATA[ThreeLight]]></dc:creator>
            <pubDate>Sun, 14 May 2023 16:48:34 GMT</pubDate>
            <atom:updated>2023-05-14T16:48:34.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*PyiIF7h4_vatwvId.png" /></figure><p>In the world of software development, maintaining code quality and consistency has become crucial.</p><p>The tools that aid in this process include ESLint, Husky, and Prettier.</p><h3>Why is Code Quality and Consistency Important?</h3><ol><li><strong>Enhances readability:</strong> Consistent coding style and high code quality make it easier to read and understand the code. It helps developers identify and solve problems faster.</li><li><strong>Facilitates maintenance:</strong> High code quality and consistency make it easier to modify or expand the code, saving time and cost.</li><li><strong>Improves team collaboration:</strong> High-quality and consistent code smoothens collaboration among team members. It simplifies the process of understanding each other’s code and makes the code review and feedback process more efficient.</li><li><strong>Reduces errors and bugs:</strong> High code quality helps reduce the occurrence of errors and bugs. This saves development time and provides more stable software to users.</li><li><strong>Improves code review efficiency:</strong> The fewer style-related issues in code reviews, the more developers can focus on logic and architecture to improve overall code quality.</li><li><strong>Boosts project productivity:</strong> Maintaining code quality and consistency increases the overall productivity of the project.</li></ol><p>Now, let’s delve into each tool.</p><h3>ESLint</h3><p>ESLint is a static analysis tool for maintaining code quality and consistency in JavaScript.</p><p>It allows enforcing consistent coding styles by setting up rules in the project, such as using semicolons or the way variables are declared.</p><h3>Husky</h3><p>Husky is a tool that makes setting up Git hooks easy.</p><p>Git hooks are scripts that run during specific Git events like commit or push.</p><p>With Husky, you can add Git hooks to your project easily and, for example, run ESLint and Prettier before committing to inspect and tidy up the code.</p><h3>Prettier</h3><p>Prettier is a code formatter used to maintain a consistent code style.</p><p>Prettier automatically modifies the code according to the rules set, enhancing readability, and ensuring a uniform code style across the project.</p><h3>Why Do We Need to Set Up These Tools?</h3><ol><li><strong>Improve project quality and readability:</strong> It enhances development efficiency.</li><li><strong>Reduce confusion among team members:</strong> It minimizes the stylistic differences in code among team members.</li><li><strong>Focus more on logic during code review:</strong> It reduces style-related issues, allowing more focus on logic and architecture.</li><li><strong>Reduce errors and maintain code quality:</strong> By using Git hooks for automated code checks and formatting, you can reduce mistakes and consistently maintain high code quality.</li></ol><h4><strong>Here’s how to set up ESLint, Husky, and Prettier:</strong></h4><p><strong>ESLint Setup Example — .eslintrc.js</strong></p><pre>module.exports = {<br>  parser: &#39;babel-eslint&#39;,<br>  extends: [&#39;airbnb&#39;, &#39;prettier&#39;],<br>  globals: {<br>    window: true,<br>    document: true,<br>  },<br>  rules: {<br>    semi: [&#39;error&#39;, &#39;always&#39;],<br>    &#39;no-console&#39;: &#39;off&#39;,<br>  },<br>};</pre><p><strong>Husky Setup Example — package.json</strong></p><pre>{<br>  &quot;husky&quot;: {<br>    &quot;hooks&quot;: {<br>      &quot;pre-commit&quot;: &quot;lint-staged&quot;<br>    }<br>  },<br>  &quot;lint-staged&quot;: {<br>    &quot;*.js&quot;: [<br>      &quot;eslint --fix&quot;,<br>      &quot;prettier --write&quot;,<br>      &quot;git add&quot;<br>    ]<br>  }<br>}</pre><p><strong>Prettier Setup Example — .prettierrc</strong></p><pre>{<br>  // Define the character to use for line breaks (e.g., LF or CRLF).<br>  &quot;endOfLine&quot;: &quot;lf&quot;,<br>  // Define whether to use semicolons.<br>  &quot;semi&quot;: true,<br>  // Define the type of quotes to use in strings (e.g., single or double).<br>  &quot;singleQuote&quot;: true,<br>  // Define the number of spaces to use for indentation.<br>  &quot;tabWidth&quot;: 2,<br>  // Define whether to add a newline character at the end of the file.<br>  &quot;trailingComma&quot;: &quot;all&quot;<br>}</pre><p>In conclusion, maintaining code quality and consistency plays a significant role in the overall success of software development projects. Tools like ESLint, Husky, and Prettier help to enforce these aspects, enhancing productivity, collaboration, and code maintainability in the process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d729a1dc2913" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>