<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Pheak Pheasa</title>
    <description>The latest articles on Forem by Pheak Pheasa (@pheak_pheasa).</description>
    <link>https://forem.com/pheak_pheasa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1347881%2F3139a5e1-fac3-4472-bf8e-3db3ce8bec20.jpg</url>
      <title>Forem: Pheak Pheasa</title>
      <link>https://forem.com/pheak_pheasa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pheak_pheasa"/>
    <language>en</language>
    <item>
      <title>git create branch from main</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Thu, 21 Aug 2025 02:11:16 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/git-create-branch-from-main-3f98</link>
      <guid>https://forem.com/pheak_pheasa/git-create-branch-from-main-3f98</guid>
      <description>&lt;p&gt;Method 1: Create branch from main, then switch&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch &amp;lt;new-branch-name&amp;gt; main
git checkout &amp;lt;new-branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Method 2: Create and switch in one command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b &amp;lt;new-branch-name&amp;gt; main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Method 3: Using newer git switch command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git switch -c &amp;lt;new-branch-name&amp;gt; main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create a new feature branch from main
git checkout -b feature-user-authentication main

# Create a bug fix branch from main
git switch -c fix-login-issue main

# Create a hotfix branch from main
git checkout -b hotfix-critical-bug main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After created new brach you can't push/pull your code let's try here first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push --set-upstream origin &amp;lt;branch-name-you-created&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>gitcommand</category>
      <category>github</category>
      <category>gitlab</category>
    </item>
    <item>
      <title>Git: How to Add Missing Files to Your Previous Commit</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Tue, 05 Aug 2025 01:56:08 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/git-how-to-add-missing-files-to-your-previous-commit-572m</link>
      <guid>https://forem.com/pheak_pheasa/git-how-to-add-missing-files-to-your-previous-commit-572m</guid>
      <description>&lt;p&gt;1.&lt;strong&gt;First Way&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go back to previous commit (keep changes in working directory)&lt;br&gt;
&lt;code&gt;git reset --soft HEAD~1&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add your missing files&lt;br&gt;
&lt;code&gt;git add missing-file.txt&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Commit again with all files&lt;br&gt;
&lt;code&gt;git commit -m "Your original commit message"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Force push to update remote branch&lt;br&gt;
&lt;code&gt;git push --force-with-lease&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.&lt;strong&gt;Second Way&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alternative: Amend the last commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;git add missing-file.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit --amend --no-edit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push --force-with-lease&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3.&lt;strong&gt;Third Way&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you already pushed and want to be safer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;git add missing-file.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Add missing files"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push&lt;/code&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitlab</category>
      <category>gitcommand</category>
    </item>
    <item>
      <title>MVVM Directory Structure for Point of Sale (POS) System</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Wed, 07 May 2025 03:17:41 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/mvvm-directory-structure-for-point-of-sale-pos-system-552</link>
      <guid>https://forem.com/pheak_pheasa/mvvm-directory-structure-for-point-of-sale-pos-system-552</guid>
      <description>&lt;p&gt;Here’s a standard and scalable directory structure for a Point of Sale (POS) system using MVVM architecture in Swift, with clean separation of concerns and real-world modularity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POSApp/
│
├── App/
│   ├── AppDelegate.swift
│   ├── SceneDelegate.swift
│   └── Environment/
│       └── AppEnvironment.swift
│
├── Coordinators/
│   ├── AppCoordinator.swift
│   └── Modules/
│       ├── AuthCoordinator.swift
│       ├── ProductCoordinator.swift
│       ├── CartCoordinator.swift
│       └── CheckoutCoordinator.swift
│
├── Modules/
│   ├── Auth/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   ├── Product/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   ├── Cart/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   ├── Checkout/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   └── Dashboard/  ← For reporting/sales summary
│       ├── View/
│       ├── ViewModel/
│       ├── Model/
│       └── Service/
│
├── Services/
│   ├── API/
│   │   ├── APIClient.swift
│   │   └── Endpoints.swift
│   ├── Persistence/
│   │   ├── CoreDataStack.swift
│   │   └── LocalStorage.swift
│   └── Payment/
│       └── QRPaymentService.swift
│
├── Helpers/
│   ├── FormatterHelper.swift
│   ├── Validator.swift
│   └── ImagePickerHelper.swift
│
├── Components/
│   ├── Common/
│   │   ├── POSButton.swift
│   │   └── POSLabel.swift
│   └── ReusableViews/
│       └── ProductCardView.swift
│
├── Resources/
│   ├── Assets.xcassets
│   ├── Localizable.strings
│   └── Fonts/
│
├── Extensions/
│   ├── UIView+Ext.swift
│   ├── String+Ext.swift
│   └── UIColor+Ext.swift
│
├── Bindings/
│   └── ReactiveBinder.swift (for RxSwift, Combine, or custom bindings)
│
├── Middlewares/
│   └── AuthMiddleware.swift
│
├── Protocols/
│   └── Coordinatable.swift
│
├── Utils/
│   └── Logger.swift
│
└── Tests/
    ├── Unit/
    └── UI/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Principles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modularized per feature: Each Module/ has its own MVC elements.&lt;/li&gt;
&lt;li&gt;MVVM: Clear separation of View, ViewModel, and Model.&lt;/li&gt;
&lt;li&gt;Coordinator Pattern: Clean navigation handling.&lt;/li&gt;
&lt;li&gt;Scalable: Easy to expand for inventory, employee management, reporting, etc.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mvvm</category>
      <category>swift</category>
      <category>ios</category>
    </item>
    <item>
      <title>MVVM Directory Structure for Point of Sale (POS) System</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Wed, 07 May 2025 03:17:41 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/mvvm-directory-structure-for-point-of-sale-pos-system-2e1</link>
      <guid>https://forem.com/pheak_pheasa/mvvm-directory-structure-for-point-of-sale-pos-system-2e1</guid>
      <description>&lt;p&gt;Here’s a standard and scalable directory structure for a Point of Sale (POS) system using MVVM architecture in Swift, with clean separation of concerns and real-world modularity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POSApp/
│
├── App/
│   ├── AppDelegate.swift
│   ├── SceneDelegate.swift
│   └── Environment/
│       └── AppEnvironment.swift
│
├── Coordinators/
│   ├── AppCoordinator.swift
│   └── Modules/
│       ├── AuthCoordinator.swift
│       ├── ProductCoordinator.swift
│       ├── CartCoordinator.swift
│       └── CheckoutCoordinator.swift
│
├── Modules/
│   ├── Auth/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   ├── Product/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   ├── Cart/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   ├── Checkout/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Service/
│   │
│   └── Dashboard/  ← For reporting/sales summary
│       ├── View/
│       ├── ViewModel/
│       ├── Model/
│       └── Service/
│
├── Services/
│   ├── API/
│   │   ├── APIClient.swift
│   │   └── Endpoints.swift
│   ├── Persistence/
│   │   ├── CoreDataStack.swift
│   │   └── LocalStorage.swift
│   └── Payment/
│       └── QRPaymentService.swift
│
├── Helpers/
│   ├── FormatterHelper.swift
│   ├── Validator.swift
│   └── ImagePickerHelper.swift
│
├── Components/
│   ├── Common/
│   │   ├── POSButton.swift
│   │   └── POSLabel.swift
│   └── ReusableViews/
│       └── ProductCardView.swift
│
├── Resources/
│   ├── Assets.xcassets
│   ├── Localizable.strings
│   └── Fonts/
│
├── Extensions/
│   ├── UIView+Ext.swift
│   ├── String+Ext.swift
│   └── UIColor+Ext.swift
│
├── Bindings/
│   └── ReactiveBinder.swift (for RxSwift, Combine, or custom bindings)
│
├── Middlewares/
│   └── AuthMiddleware.swift
│
├── Protocols/
│   └── Coordinatable.swift
│
├── Utils/
│   └── Logger.swift
│
└── Tests/
    ├── Unit/
    └── UI/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Principles:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modularized per feature: Each Module/ has its own MVC elements.&lt;/li&gt;
&lt;li&gt;MVVM: Clear separation of View, ViewModel, and Model.&lt;/li&gt;
&lt;li&gt;Coordinator Pattern: Clean navigation handling.&lt;/li&gt;
&lt;li&gt;Scalable: Easy to expand for inventory, employee management, reporting, etc.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mvvm</category>
      <category>swift</category>
      <category>ios</category>
    </item>
    <item>
      <title>Document to show and sing with client before you start coding.</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Mon, 28 Apr 2025 03:31:29 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/document-to-show-and-sing-with-client-before-you-start-coding-you-project-2p09</link>
      <guid>https://forem.com/pheak_pheasa/document-to-show-and-sing-with-client-before-you-start-coding-you-project-2p09</guid>
      <description>&lt;p&gt;When working with a client, it's essential to establish clear agreements and expectations upfront. This ensures both parties are aligned on the project scope, deliverables, timeline, and payment terms. Below is a list of &lt;strong&gt;key documents&lt;/strong&gt; you should prepare and sign with your client before starting the development process:&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Project Proposal&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Outline the project details, features, and technical requirements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Project overview (e.g., "Telegram Mini App for Selling Exercise Videos").&lt;/li&gt;
&lt;li&gt;Key features (e.g., Admin uploads exercises, QR code payments, receipt validation).&lt;/li&gt;
&lt;li&gt;Target audience (students in grades 1–12 in Cambodia).&lt;/li&gt;
&lt;li&gt;Technology stack (Python backend, Vue.js frontend).&lt;/li&gt;
&lt;li&gt;Timeline (1 month).&lt;/li&gt;
&lt;li&gt;Deliverables (e.g., wireframes, functional app, deployment).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Action&lt;/strong&gt;: Share this document with the client for approval.&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. Scope of Work (SOW)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Define the exact scope of the project to avoid scope creep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Detailed feature list (e.g., admin dashboard, exercise upload, QR code generation, receipt validation).&lt;/li&gt;
&lt;li&gt;Exclusions (e.g., third-party integrations, additional payment methods).&lt;/li&gt;
&lt;li&gt;Phases of development (e.g., planning, backend, frontend, testing, deployment).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Action&lt;/strong&gt;: Both parties should review and agree on the SOW.&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. Contract Agreement&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Legally bind both parties to the project terms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Project description.&lt;/li&gt;
&lt;li&gt;Payment terms (e.g., upfront payment, milestone-based payments).&lt;/li&gt;
&lt;li&gt;Intellectual property rights (e.g., who owns the code and design?).&lt;/li&gt;
&lt;li&gt;Confidentiality clause (if applicable).&lt;/li&gt;
&lt;li&gt;Termination clause (e.g., what happens if either party wants to cancel the agreement?).&lt;/li&gt;
&lt;li&gt;Signatures and dates.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Action&lt;/strong&gt;: Draft the contract, have the client review it, and sign it before starting work.&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Wireframes or Mockups&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Provide a visual representation of the app’s structure and design.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Screenshots or sketches of key screens (e.g., home screen, exercise detail, payment screen).&lt;/li&gt;
&lt;li&gt;Basic flow of the app (e.g., how users navigate from one screen to another).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Action&lt;/strong&gt;: Present these to the client for feedback and approval before moving to development.&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Payment Schedule&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Clearly outline when and how payments will be made.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Total project cost.&lt;/li&gt;
&lt;li&gt;Payment milestones (e.g., 30% upfront, 30% after backend completion, 40% after final delivery).&lt;/li&gt;
&lt;li&gt;Payment method (e.g., bank transfer, PayPal).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Action&lt;/strong&gt;: Include this in the contract or as a separate document for clarity.&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;6. Design Guidelines (Optional)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Ensure branding consistency if the client hasn’t provided specific guidelines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Color palette (e.g., blue, green, yellow).&lt;/li&gt;
&lt;li&gt;Logo ideas or examples.&lt;/li&gt;
&lt;li&gt;Typography (e.g., font styles and sizes).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Action&lt;/strong&gt;: Share this document with the client for approval if they need help with branding.&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;7. Non-Disclosure Agreement (NDA) (Optional)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Protect sensitive information shared during the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Definition of confidential information.&lt;/li&gt;
&lt;li&gt;Obligations of both parties to keep information private.&lt;/li&gt;
&lt;li&gt;Duration of the NDA (e.g., 1 year, indefinite).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Action&lt;/strong&gt;: Use this if the client shares proprietary data or if you’re building something confidential.&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Summary of Documents&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Document&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Required?&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Project Proposal&lt;/td&gt;
&lt;td&gt;Outlines project details and requirements.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scope of Work (SOW)&lt;/td&gt;
&lt;td&gt;Defines the project scope and deliverables.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Contract Agreement&lt;/td&gt;
&lt;td&gt;Legally binds both parties to the project terms.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wireframes/Mockups&lt;/td&gt;
&lt;td&gt;Provides a visual representation of the app.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment Schedule&lt;/td&gt;
&lt;td&gt;Clarifies payment terms and milestones.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Design Guidelines&lt;/td&gt;
&lt;td&gt;Ensures branding consistency (if needed).&lt;/td&gt;
&lt;td&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Non-Disclosure Agreement (NDA)&lt;/td&gt;
&lt;td&gt;Protects confidential information (if applicable).&lt;/td&gt;
&lt;td&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Next Steps&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Prepare the above documents based on your client’s requirements.&lt;/li&gt;
&lt;li&gt;Review each document with the client to ensure they understand and agree with the content.&lt;/li&gt;
&lt;li&gt;Once approved, sign all necessary documents (e.g., contract, SOW, payment schedule).&lt;/li&gt;
&lt;li&gt;Store signed copies securely for future reference.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By following this approach, you’ll minimize misunderstandings and set a strong foundation for a successful project.&lt;/p&gt;

</description>
      <category>projectbenatar</category>
      <category>freelance</category>
      <category>documentation</category>
    </item>
    <item>
      <title>MVVM + RxSwift + Coordinator directory structure for your large POS system</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Wed, 23 Apr 2025 03:12:40 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/mvvm-rxswift-coordinator-directory-structure-for-your-large-pos-system-39ca</link>
      <guid>https://forem.com/pheak_pheasa/mvvm-rxswift-coordinator-directory-structure-for-your-large-pos-system-39ca</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POSApp/
├── App/
│   ├── AppDelegate.swift
│   └── SceneDelegate.swift
├── Resources/
│   ├── Assets.xcassets
│   ├── LaunchScreen.storyboard
│   └── Localizable.strings
├── Helpers/
│   ├── NetworkManager.swift          // Handle API calls
│   ├── RxBinder.swift                // Custom Rx bindings
│   └── DateFormatterHelper.swift
├── Extensions/
│   ├── UIView+Extension.swift
│   └── Reactive+Extension.swift      // Rx extensions for UIKit
├── Base/
│   ├── BaseViewController.swift
│   └── BaseViewModel.swift
├── Coordinators/
│   ├── AppCoordinator.swift          // Entry point of navigation
│   ├── AuthCoordinator.swift
│   ├── ProductCoordinator.swift
│   └── CoordinatorProtocol.swift
├── Modules/
│   ├── Auth/
│   │   ├── View/
│   │   │   └── LoginViewController.swift
│   │   ├── ViewModel/
│   │   │   └── LoginViewModel.swift
│   │   ├── Model/
│   │   │   └── User.swift
│   │   └── Coordinator/
│   │       └── AuthFlow.swift
│   ├── Product/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Coordinator/
│   ├── Cart/
│   │   ├── View/
│   │   ├── ViewModel/
│   │   ├── Model/
│   │   └── Coordinator/
│   ├── Checkout/
│   ├── Stock/
│   └── Dashboard/
│       ├── View/
│       ├── ViewModel/
│       ├── Model/
│       └── Coordinator/
├── Services/
│   ├── APIService.swift              // Base networking service
│   ├── AuthService.swift
│   ├── ProductService.swift
│   └── CartService.swift
├── Router/
│   ├── Route.swift
│   └── RouteHandler.swift
├── Config/
│   └── AppConfig.swift               // API keys, base URLs, etc.
├── Components/
│   ├── Buttons/
│   │   └── PrimaryButton.swift
│   └── Cells/
│       └── ProductTableViewCell.swift
├── Bindings/
│   ├── UIView+Rx.swift
│   └── UIButton+Rx.swift
├── Protocols/
│   ├── ViewModelType.swift
│   └── ServiceType.swift
├── Error/
│   ├── AppError.swift
│   └── ErrorHandler.swift
├── Utils/
│   ├── CurrencyFormatter.swift
│   └── QRCodeGenerator.swift
├── Middlewares/
│   ├── AuthInterceptor.swift
│   └── LoggingInterceptor.swift
├── Persistence/
│   ├── CoreDataStack.swift
│   └── UserDefaultsService.swift
├── Notifications/
│   ├── NotificationManager.swift
│   └── NotificationNames.swift
├── Localization/
│   └── Strings/
│       ├── en.lproj/
│       └── km.lproj/
└── Tests/
    ├── LoginViewModelTests.swift
    └── ProductServiceTests.swift

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>softwaredevelopment</category>
      <category>mvvm</category>
      <category>architecture</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Sandbox: rsync.samba (13105) deny(1) file-write-create, Flutter failed to write to a file [closed]</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Tue, 22 Apr 2025 08:51:31 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/sandbox-rsyncsamba-13105-deny1-file-write-create-flutter-failed-to-write-to-a-file-closed-1i12</link>
      <guid>https://forem.com/pheak_pheasa/sandbox-rsyncsamba-13105-deny1-file-write-create-flutter-failed-to-write-to-a-file-closed-1i12</guid>
      <description>&lt;p&gt;In Xcode, go to your project's Build Settings menu. In the Build Options section, set the property ENABLE_USER_SCRIPT_SANDBOXING to 'No'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtmrtde4rw9quwu70hy8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtmrtde4rw9quwu70hy8.png" alt="Image description" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>mobile</category>
      <category>swift</category>
    </item>
    <item>
      <title>Easy way to make swift project to using only light mode.</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Tue, 22 Apr 2025 04:22:19 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/easy-way-to-make-swift-project-to-using-only-light-mode-2f4f</link>
      <guid>https://forem.com/pheak_pheasa/easy-way-to-make-swift-project-to-using-only-light-mode-2f4f</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
        guard let _ = (scene as? UIWindowScene) else { return }
        window?.overrideUserInterfaceStyle = .light
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;add only &lt;code&gt;window?.overrideUserInterfaceStyle = .light&lt;/code&gt; into function scene in SceneDelegate.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;select Product -&amp;gt; Clean Buil Folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now Just run you project again.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>swift</category>
      <category>ios</category>
      <category>mobile</category>
    </item>
    <item>
      <title>2 Ways to save your life when you confused push any code or file to your branch.</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Mon, 24 Mar 2025 04:10:10 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/step-to-save-your-life-when-you-confused-push-any-code-or-file-to-your-branch-4ehg</link>
      <guid>https://forem.com/pheak_pheasa/step-to-save-your-life-when-you-confused-push-any-code-or-file-to-your-branch-4ehg</guid>
      <description>&lt;h2&gt;
  
  
  Way 1
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Find your committed hash by :
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. After found your commit hash you need revert it by :
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git revert &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. choose one at bellow with responsibility:
&lt;/h3&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🟢 Uncommit last commit (keep files):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --soft HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Files stay staged, just remove commit.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🟡 Uncommit &amp;amp; Unstage (keep changes in working directory):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --mixed HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Files stay, but unstaged (not in commit).&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🔴 Uncommit &amp;amp; Remove changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --hard HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Files &amp;amp; commit both gone! Careful!&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🟣 Uncommit pushed commit (force push):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --soft HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push --force
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Removes commit on remote branch too.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;h2&gt;
  
  
  Way 2 in next post.
&lt;/h2&gt;

</description>
      <category>git</category>
      <category>gitcommand</category>
    </item>
    <item>
      <title>MVVM Directory Structure for a Large Banking Mobile App Project</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Wed, 15 Jan 2025 03:23:59 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/mvvm-directory-structure-for-larger-project-2hdb</link>
      <guid>https://forem.com/pheak_pheasa/mvvm-directory-structure-for-larger-project-2hdb</guid>
      <description>&lt;p&gt;For a large bank mobile app using MVVM with Storyboards, here's a well-organized directory structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BankApp/
├── Application/
│   ├── AppDelegate.swift
│   ├── SceneDelegate.swift
│   ├── Info.plist
│   └── Assets.xcassets/
├── Resources/
│   ├── Fonts/
│   ├── Localization/
│   │   ├── en.lproj/
│   │   │   └── Localizable.strings
│   │   └── es.lproj/
│   │       └── Localizable.strings
│   └── Constants.swift
├── Core/
│   ├── Network/
│   │   ├── NetworkManager.swift
│   │   ├── APIEndpoints.swift
│   │   ├── RequestBuilder.swift
│   │   └── NetworkError.swift
│   ├── Storage/
│   │   ├── KeychainManager.swift
│   │   ├── CoreDataManager.swift
│   │   └── UserDefaultsManager.swift
│   ├── Authentication/
│   │   ├── AuthenticationManager.swift
│   │   └── BiometricAuthManager.swift
│   └── Analytics/
│       └── AnalyticsManager.swift
├── Extensions/
│   ├── UIKit+Extensions.swift
│   ├── Foundation+Extensions.swift
│   └── Date+Extensions.swift
├── Utilities/
│   ├── ThemeManager.swift
│   ├── Logger.swift
│   └── CurrencyFormatter.swift
├── Models/
│   ├── Account.swift
│   ├── Transaction.swift
│   ├── Card.swift
│   ├── User.swift
│   └── InvestmentPortfolio.swift
├── Services/
│   ├── AccountService.swift
│   ├── TransactionService.swift
│   ├── CardService.swift
│   ├── NotificationService.swift
│   └── InvestmentService.swift
├── Modules/
│   ├── Login/
│   │   ├── View/
│   │   │   ├── LoginViewController.swift
│   │   │   └── Login.storyboard
│   │   ├── ViewModel/
│   │   │   └── LoginViewModel.swift
│   │   └── Model/
│   │       └── LoginResponse.swift
│   ├── Dashboard/
│   │   ├── View/
│   │   │   ├── DashboardViewController.swift
│   │   │   ├── Dashboard.storyboard
│   │   │   ├── Cells/
│   │   │   │   ├── AccountSummaryCell.swift
│   │   │   │   └── QuickActionCell.swift
│   │   │   └── Components/
│   │   │       └── BalanceSummaryView.swift
│   │   ├── ViewModel/
│   │   │   └── DashboardViewModel.swift
│   │   └── Model/
│   │       └── DashboardData.swift
│   ├── Accounts/
│   │   ├── View/
│   │   │   ├── AccountsViewController.swift
│   │   │   ├── AccountDetailViewController.swift
│   │   │   ├── Accounts.storyboard
│   │   │   └── Cells/
│   │   │       ├── AccountCell.swift
│   │   │       └── TransactionCell.swift
│   │   ├── ViewModel/
│   │   │   ├── AccountsListViewModel.swift
│   │   │   └── AccountDetailViewModel.swift
│   │   └── Model/
│   │       └── AccountDetails.swift
│   ├── Transfer/
│   │   ├── View/
│   │   │   ├── TransferViewController.swift
│   │   │   ├── TransferConfirmationViewController.swift
│   │   │   ├── Transfer.storyboard
│   │   │   └── Components/
│   │   │       └── RecipientSelectionView.swift
│   │   ├── ViewModel/
│   │   │   ├── TransferViewModel.swift
│   │   │   └── TransferConfirmationViewModel.swift
│   │   └── Model/
│   │       └── TransferRequest.swift
│   ├── Cards/
│   │   ├── View/
│   │   │   ├── CardsViewController.swift
│   │   │   ├── CardDetailViewController.swift
│   │   │   ├── Cards.storyboard
│   │   │   └── Components/
│   │   │       └── CardView.swift
│   │   ├── ViewModel/
│   │   │   ├── CardsListViewModel.swift
│   │   │   └── CardDetailViewModel.swift
│   │   └── Model/
│   │       └── CardDetails.swift
│   ├── Payments/
│   │   ├── View/
│   │   │   ├── PaymentsViewController.swift
│   │   │   ├── BillPaymentViewController.swift
│   │   │   ├── Payments.storyboard
│   │   │   └── Cells/
│   │   │       └── PayeeCell.swift
│   │   ├── ViewModel/
│   │   │   ├── PaymentsViewModel.swift
│   │   │   └── BillPaymentViewModel.swift
│   │   └── Model/
│   │       └── PaymentRequest.swift
│   ├── Investments/
│   │   ├── View/
│   │   │   ├── InvestmentsViewController.swift
│   │   │   ├── InvestmentDetailViewController.swift
│   │   │   ├── Investments.storyboard
│   │   │   └── Components/
│   │   │       └── PortfolioChartView.swift
│   │   ├── ViewModel/
│   │   │   ├── InvestmentsViewModel.swift
│   │   │   └── InvestmentDetailViewModel.swift
│   │   └── Model/
│   │       └── InvestmentData.swift
│   ├── Profile/
│   │   ├── View/
│   │   │   ├── ProfileViewController.swift
│   │   │   ├── SecuritySettingsViewController.swift
│   │   │   └── Profile.storyboard
│   │   ├── ViewModel/
│   │   │   ├── ProfileViewModel.swift
│   │   │   └── SecuritySettingsViewModel.swift
│   │   └── Model/
│   │       └── UserProfile.swift
│   └── Support/
│       ├── View/
│       │   ├── SupportViewController.swift
│       │   ├── ChatSupportViewController.swift
│       │   └── Support.storyboard
│       ├── ViewModel/
│       │   ├── SupportViewModel.swift
│       │   └── ChatSupportViewModel.swift
│       └── Model/
│           └── SupportTicket.swift
├── Common/
│   ├── Views/
│   │   ├── CustomButton.swift
│   │   ├── CustomTextField.swift
│   │   ├── AlertView.swift
│   │   └── LoadingView.swift
│   ├── Protocols/
│   │   ├── Reusable.swift
│   │   └── Coordinator.swift
│   └── Coordinators/
│       ├── AppCoordinator.swift
│       ├── LoginCoordinator.swift
│       └── MainCoordinator.swift
└── Configurations/
    ├── Debug.xcconfig
    ├── Release.xcconfig
    └── Staging.xcconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Aspects of This Structure:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MVVM Organization&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each module has View, ViewModel, and Model folders&lt;/li&gt;
&lt;li&gt;Clear separation of concerns with Storyboards in View folders&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Module-based Structure&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Banking features separated into distinct modules (Login, Dashboard, Accounts, etc.)&lt;/li&gt;
&lt;li&gt;Each module is self-contained with its own Storyboard and components&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Core Services&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network, Storage, Authentication layers separated from UI&lt;/li&gt;
&lt;li&gt;Reusable services for banking operations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Common Components&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shared UI elements and protocols in Common directory&lt;/li&gt;
&lt;li&gt;Coordinator pattern for navigation between modules&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Resources &amp;amp; Configuration&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Properly organized resources for localization, fonts, etc.&lt;/li&gt;
&lt;li&gt;Different configuration files for various build environments&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This structure supports scalability and maintainability while following MVVM principles and leveraging Storyboards for UI design in a large banking application.&lt;/p&gt;

</description>
      <category>swift</category>
      <category>architecture</category>
      <category>ios</category>
      <category>mobile</category>
    </item>
    <item>
      <title>how to get SSH Keys for gitlab for mac?</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Fri, 10 Jan 2025 13:50:06 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/how-to-get-ssh-keys-for-gitlab-for-mac-2h9c</link>
      <guid>https://forem.com/pheak_pheasa/how-to-get-ssh-keys-for-gitlab-for-mac-2h9c</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generate SSH Key&lt;/strong&gt;
Run this command in your terminal to generate a new SSH key:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-b&lt;/span&gt; 4096 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;Enter&lt;/code&gt; to save it in the default location.&lt;/li&gt;
&lt;li&gt;Set a passphrase or leave it empty for no passphrase.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start SSH Agent&lt;/strong&gt;
Start the SSH agent to manage your keys:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;ssh-agent &lt;span class="nt"&gt;-s&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add SSH Key&lt;/strong&gt;
Add your new key to the SSH agent:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ssh-add &lt;span class="nt"&gt;-K&lt;/span&gt; ~/.ssh/id_rsa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Copy SSH Key&lt;/strong&gt;
Copy your SSH public key to paste into GitLab:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   pbcopy &amp;lt; ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add Key to GitLab&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Go to GitLab &amp;gt; &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;SSH Keys&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste the copied key in the key field and add a title.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Done! Now you can clone or push to repositories securely.&lt;/p&gt;

</description>
      <category>gitcommand</category>
    </item>
    <item>
      <title>Directory structure for building a stock system using FastAPI</title>
      <dc:creator>Pheak Pheasa</dc:creator>
      <pubDate>Tue, 08 Oct 2024 16:54:51 +0000</pubDate>
      <link>https://forem.com/pheak_pheasa/directory-structure-for-building-a-stock-system-using-fastapi-202m</link>
      <guid>https://forem.com/pheak_pheasa/directory-structure-for-building-a-stock-system-using-fastapi-202m</guid>
      <description>&lt;p&gt;This structure separates concerns, making it easier to manage as the project scales.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stock-system/
│
├── app/
│   ├── __init__.py
│   ├── main.py                     # Entry point of the FastAPI app
│   ├── api/                        # API related code (routers)
│   │   ├── __init__.py
│   │   ├── products.py              # Routes related to products
│   │   ├── inventory.py             # Routes related to inventory management
│   │   ├── sales.py                 # Routes related to sales and orders
│   │   └── users.py                 # Routes related to user management
│   │
│   ├── core/                       # Core settings and configurations
│   │   ├── __init__.py
│   │   ├── config.py                # Configuration settings (DB, API keys, etc.)
│   │   └── security.py              # Authentication, Authorization, and Security utilities
│   │
│   ├── crud/                       # CRUD operations for database interactions
│   │   ├── __init__.py
│   │   ├── crud_product.py          # CRUD operations related to products
│   │   ├── crud_inventory.py        # CRUD operations related to inventory
│   │   ├── crud_sales.py            # CRUD operations related to sales
│   │   └── crud_user.py             # CRUD operations related to users
│   │
│   ├── db/                         # Database-related modules
│   │   ├── __init__.py
│   │   ├── base.py                  # SQLAlchemy base for models
│   │   ├── session.py               # Database session creation
│   │   └── models/                  # SQLAlchemy models
│   │       ├── __init__.py
│   │       ├── product.py           # Product model
│   │       ├── inventory.py         # Inventory model
│   │       ├── sales.py             # Sales/Orders model
│   │       └── user.py              # User model
│   │
│   ├── schemas/                    # Pydantic schemas for request/response models
│   │   ├── __init__.py
│   │   ├── product.py               # Product-related schemas
│   │   ├── inventory.py             # Inventory-related schemas
│   │   ├── sales.py                 # Sales-related schemas
│   │   └── user.py                  # User-related schemas
│   │
│   ├── services/                   # Additional business logic/services
│   │   ├── __init__.py
│   │   ├── product_service.py       # Logic related to products
│   │   ├── inventory_service.py     # Logic related to inventory
│   │   ├── sales_service.py         # Logic related to sales
│   │   └── user_service.py          # Logic related to users
│   │
│   └── utils/                      # Utility functions/helpers
│       ├── __init__.py
│       ├── dependencies.py          # Common dependencies for routes
│       └── helpers.py               # Miscellaneous helper functions
│
├── tests/                          # Test cases
│   ├── __init__.py
│   ├── test_products.py             # Tests related to products
│   ├── test_inventory.py            # Tests related to inventory
│   ├── test_sales.py                # Tests related to sales/orders
│   └── test_users.py                # Tests related to users
│
├── alembic/                        # Database migrations using Alembic (if needed)
│   ├── versions/                    # Directory for migration scripts
│   └── env.py                       # Alembic environment configuration
│
├── Dockerfile                      # Dockerfile for containerizing the application
├── .env                            # Environment variables file (for secrets and config)
├── .gitignore                      # Files and directories to ignore in git
├── pyproject.toml                   # Dependencies and project metadata (or requirements.txt)
├── README.md                       # Documentation of the project
└── uvicorn_config.py               # Configuration for running the FastAPI app with Uvicorn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Key Directories and Files:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;app/main.py&lt;/strong&gt;: The entry point for the FastAPI application. It initiates the app, includes routers, and other configurations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;api/&lt;/strong&gt;: Contains route definitions for various aspects of the stock system (products, inventory, sales, users).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;db/&lt;/strong&gt;: Includes SQLAlchemy models, the database session setup, and related files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;crud/&lt;/strong&gt;: Handles the interaction between the database and the API through CRUD operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;schemas/&lt;/strong&gt;: Defines Pydantic models used for validation and serialization of request and response data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;services/&lt;/strong&gt;: Contains the business logic for various features of the system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tests/&lt;/strong&gt;: Contains unit tests and integration tests to ensure functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;alembic/&lt;/strong&gt;: If you're using Alembic for database migrations, this is where the migration files will go.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure is flexible and scalable for a stock system, promoting separation of concerns, easier testing, and maintenance.&lt;/p&gt;

</description>
      <category>python</category>
      <category>fastapi</category>
    </item>
  </channel>
</rss>
