<?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 Paul on Medium]]></title>
        <description><![CDATA[Stories by Paul on Medium]]></description>
        <link>https://medium.com/@pmventura?source=rss-32286bcd6e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YkS5YyoWGXPjzjJx.jpg</url>
            <title>Stories by Paul on Medium</title>
            <link>https://medium.com/@pmventura?source=rss-32286bcd6e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 13:20:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pmventura/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[How Mortgage Pre-Approval Works (From a Software Engineer Learning the System)]]></title>
            <link>https://medium.com/@pmventura/how-mortgage-pre-approval-works-from-a-software-engineer-learning-the-system-4ff4e849f88c?source=rss-32286bcd6e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ff4e849f88c</guid>
            <category><![CDATA[personal-finance]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[mortgage]]></category>
            <category><![CDATA[real-estate]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Paul]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 14:19:45 GMT</pubDate>
            <atom:updated>2026-04-06T14:19:45.833Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*pSECUFSIDEAoWpNCsCBbYQ.png" /><figcaption>Credit: Zoe Hansen / Investopedia</figcaption></figure><h3>Introduction</h3><p>When I started working on mortgage-related systems, I assumed pre-approval was a simple step: submit some documents, get a number, and start house hunting:</p><p>But as I dug deeper, I realized:</p><p><strong>Pre-approve is essentially a risk evaluation pipeline</strong></p><p>It’s not just a form but it’s a structured system combining<br>- income normalization<br>- debt modeling<br>- regulatory rules<br>- and pricing eligibility</p><p>In this post, I’ll break down how pre-approval actually works from a system design perspective, based on what I’ve learned while working with mortgage workflows</p><h3>Pre-Approval as a System</h3><p>At a high level, pre-approval answers one question:</p><blockquote>What is the maximum loan amoun this borrower can safely take?</blockquote><p>Behind that question is a pipeline:</p><pre>Borrower Data<br>   ↓<br>Income Normalization<br>   ↓<br>Debt Aggregation<br>   ↓<br>DTI Calculation<br>   ↓<br>Eligibility + Pricing</pre><h3>Core Input: What the System Evaluates?</h3><p><strong>1. Credit</strong></p><p>Credit score acts as a risk multiplier</p><p>Typical thresholds:</p><ul><li>&lt;620 — limited eligibility, higher cost</li><li>620+ — standard qualification</li><li>700+ — optimal pricing</li></ul><p>From a system perspective:</p><pre>Credit Score → Pricing Adjustment + Eligibility Gate</pre><p><strong>2. Income (the most complex component)</strong></p><p>Income is not just a number, it’s <strong>derived data.</strong></p><p>Example transformation logic:</p><pre>Raw Income Inputs<br>   ↓<br>Normalize by Type<br>   ↓<br>Apply Historical Rules<br>   ↓<br>Convert to Monthly Qualifying Income</pre><p><strong>Different income handling strategies:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*rAHJwC2adk0lmCfqojHtRQ.png" /><figcaption><strong>Different income handling strategies</strong></figcaption></figure><p><strong>3. Debt is simpler but critical</strong></p><p><strong>Included:</strong><br> • Car loans<br> • Credit cards<br> • Student loans<br> • Child support</p><p><strong>Not included:</strong><br> • Utilities<br> • Groceries<br> • Phone bills</p><h3>The Core Metric: DTI</h3><p>Debt-to-Income ratio</p><pre>DTI = Monthly Debt / Gross Monthly Income</pre><p>Example:</p><pre>Income: $6,000<br>Debt: $2,400<br><br>DTI = 40%</pre><p>Why DTI Matters</p><p>From a system perspective:</p><pre>DTI → Eligibility Gate → Pricing Trigger</pre><p><strong>If DTI exceeds threshold:</strong><br> • No pricing returned<br> • Loan cannot proceed</p><h3>Cost Model: What the Borrower Needs</h3><p><strong>1. Down Payment</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*ubtfUdEoqxgg-Hszcc1SOA.png" /><figcaption>Down Payment needed per loan type</figcaption></figure><p><strong>2. Closing Costs</strong></p><pre>~2%–4% of property value</pre><p>Includes:</p><ul><li>Title Fees</li><li>Taxes</li><li>Insurance</li></ul><p><strong>3 Assistance Layer</strong></p><p>Programs like DPA introduce:</p><pre>External Funding Layer → Reduces Borrower Cash Requirement</pre><p>But do not remove:</p><ul><li>DTI constraints</li><li>Risk evaluation</li></ul><h3>Data Requirements (Input Layer)</h3><ol><li>W2 Borrowers</li></ol><pre>Paystub (30 days)<br>W2 (2 years)<br>Bank statements (2 months)<br>ID</pre><p>2. Self-Employed</p><pre>Tax returns (2 years)<br>Bank statements</pre><h3>Pre-Approval Timeline as a System Flow</h3><pre>T - 6 months:<br>   → Initial consultation<br>   → Identify gaps<br><br>T - 3 months:<br>   → Begin pre-approval<br><br>T - 0:<br>   → Submit documents<br>   → Run evaluation pipeline<br>   → Output: Pre-approval<br><br>Processing Time:<br>   ~24–48 hours</pre><h3>Mapping all this to real system context</h3><p>In our ecosystem:</p><pre>Documents (Paystub, W2, VOE)<br>   ↓<br>Document Processing (AI extraction + structuring)<br>   ↓<br>Income Calculator (rule engine)<br>   ↓<br>DTI Calculation<br>   ↓<br>Pricing Engine (Relcu)<br>   ↓<br>Loan Options / Eligibility</pre><h3>Key Realization</h3><p>Pre-approval is not a single step</p><p>It is:</p><blockquote>A chain of dependent systems</blockquote><p><strong>Where each layer must be correct:</strong></p><ul><li>Incorrect extraction -&gt; wrong income<br>- Wrong income -&gt; wrong DTI<br>- Wrong DTI -&gt; incorrect pricing or rejection</li></ul><p>Why this matters (from an engineering POV)</p><p>From outside, pre-approval looks simple.</p><p>From inside, it’s:</p><blockquote>A deterministic decision engine with financial consequences</blockquote><p>Even small errors in:</p><ul><li>income leveraging</li><li>document interpretation</li><li>debt inclusion</li></ul><p>Can lead to:</p><ul><li>incorrect loan approval</li><li>pricing inconsistencies</li><li>or repurchase risk downstream</li></ul><h3>Final Takeaway</h3><p>If I were to summarize everything into one idea, it would be this:</p><p>Pre-approval is a structured risk evaluation pipeline powered by data, rules, and financial thresholds.</p><p>Understanding that pipeline makes the entire mortgage process, from underwriting to pricing, much easier to reason about.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ff4e849f88c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Fix 403 Error on CloudFront for React SPA Paths using Terraform]]></title>
            <link>https://medium.com/@pmventura/how-to-fix-403-error-on-cloudfront-for-react-spa-paths-using-terraform-6ce08a26cead?source=rss-32286bcd6e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ce08a26cead</guid>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[s3-static-site]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws-cloudfront]]></category>
            <dc:creator><![CDATA[Paul]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 16:55:56 GMT</pubDate>
            <atom:updated>2024-10-02T16:57:46.590Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L_zoQiL0jyyky7iqzq--xg.png" /></figure><h3>Background</h3><p>In a recent project, I encountered a recurring issue while setting up a custom domain for my CloudFront distribution. I was using AWS services, particularly an S3 bucket to host my React app and CloudFront distribution to distribute the content. I managed the entire infrastructure using Terraform.</p><p>The setup seemed fine at first, and I was able to access the root URL successfully. However, when I tried to directly access any path under the domain, like /members, I kept getting the following error</p><pre>&lt;Error&gt;<br>  &lt;Code&gt;AccessDenied&lt;/Code&gt;<br>  &lt;Message&gt;Access Denied&lt;/Message&gt;<br>  &lt;RequestId&gt;W1ECHDCC72D7599231214&lt;/RequestId&gt;<br>  &lt;HostId&gt;+35/dOLkUStSC0J1e4+I3hvmlfWWFZzS3bz4G0Tv/P6jB18xIEh+GzJrqpdhHR7RsqxM81Qaajs3231=&lt;/HostId&gt;<br>&lt;/Error&gt;</pre><p>This was puzzling since the root path worked without issue, and all the necessary permissions seemed in place.</p><h3>Problem</h3><p>When accessing my S3 bucket through CloudFront, paths like /members returned an “Access Denied” error (403). The behavior was strange because the paths worked perfectly when accessing the S3 bucket URL directly. This meant the problem was likely the CloudFront configuration, not the S3 permissions.</p><p>After extensive troubleshooting, the root cause turned out to be missing custom error response for 403 error in CloudFront. Additionally, there were several potential culprits along the way, such as S3 bucket permissions, policies, and public access configuration that needed to be carefully checked.</p><h3>Initial Troubleshooting</h3><p>Before we dive into the final solution, there are several key configurations to verify to avoid common 403 issue when using CloudFront with S3:</p><ol><li><strong>S3 Bucket Public Access Settings</strong>: Ensure that your S3 bucket has the correct public access configuration. If public access is restricted, CloudFront won’t be able to serve the content.</li></ol><ul><li>Go to your S3 bucket settings, and make sure Block Public Access is disabled (if your content is intended for public)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSvNSRXevilqLimluFeZug.png" /><figcaption>S3 Permissions — Disable Block Public Access</figcaption></figure><ul><li>If you need to enforce private access via CloudFront, ensure that the correct <strong>Origin Access Identity (OAI)</strong> is properly configured.</li></ul><p>2. <strong>S3 Bucket Policy:</strong></p><ul><li>Confirm that your S3 bucket policy allows access from CloudFront’s OAI. The bucket policy should include a statement allowing s3:GetObject for the OAI.</li><li>Example policy (replace placeholders with actual values)</li></ul><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;AllowCloudFrontAccess&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;AWS&quot;: &quot;arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity YOUR_OAI_ID&quot;<br>      },<br>      &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>      &quot;Resource&quot;: &quot;arn:aws:s3:::your-s3-bucket-name/*&quot;<br>    }<br>  ]<br>}</pre><p>3. <strong>Permissions:</strong> Double-check that the correct IAM roles and policies are attached to your CloudFront distribution, and that the S3 bucket policy grants the necessary permissions for CloudFront to access the files.</p><p>4. <strong>CloudFront Distribution:</strong> Make sure the CloudFront distribution is properly configured, and that its origin is pointing to the correct S3 bucket.</p><p>Even after these configurations, if you still encounter the 403 error, the problem may be related to handling custom paths or routing in a single-page application (SPA).</p><h3>Solution</h3><p>After all the initial troubleshooting, the final fix involved adding <strong>custom error response </strong>in CloudFront. By redirecting 403 (Access Denied) error to the root index.html file, we ensured that the application could handle any path or route, which is essential for SPAs like React.</p><p>Here are the steps and corresponding Terraform changes that solved the issue:</p><pre># CloudFront Distribution Resource<br>resource &quot;aws_cloudfront_distribution&quot; &quot;&lt;s3_bucket_distro&gt;&quot; {<br>  <br>  ...<br><br>  default_cache_behavior {<br>    allowed_methods  = [&quot;GET&quot;, &quot;HEAD&quot;, &quot;OPTIONS&quot;]<br>    cached_methods   = [&quot;GET&quot;, &quot;HEAD&quot;]<br>    target_origin_id = &quot;S3-&lt;bucket_name&gt;&quot;<br><br>    viewer_protocol_policy = &quot;redirect-to-https&quot;<br><br>    forwarded_values {<br>      query_string = false<br>      cookies {<br>        forward = &quot;none&quot;<br>      }<br>    }<br><br>    min_ttl  = 0<br>    default_ttl = 3600<br>    max_ttl  = 86400<br>  }<br><br>  custom_error_response {<br>    error_code           = 403<br>    response_page_path   = &quot;/index.html&quot;<br>    response_code        = 200<br>    error_caching_min_ttl = 300<br>  }<br><br>  ...<br>}<br></pre><h3>Explanation</h3><ol><li><strong>Custom Error Response</strong>:</li></ol><ul><li>We added custom_error_response block for 403 error code.</li><li>This configuration ensures that any route accessed on the domain that doesn’t directly exist in the S3 bucket gets routed back to index.html. This is crucial for SPAs where paths are handled by the frontend. and refreshing page should not break navigation.</li></ul><p><strong>2. Access Denied Issue:</strong></p><ul><li>By redirecting the 403 response to the root index, we ensured that CloudFront would serve the correct content even when accessing non-root paths.</li></ul><p><strong>3. S3 Permissions</strong>:</p><ul><li>If your S3 bucket is private, ensure that the Origin Access Identity (OAI) is properly configured to allow CloudFront to access the content in the bucket.</li></ul><h3>Conclusion</h3><p>This setup help me resolved the issue, and I could now access any subpath under the custom domain without getting the dreaded “Access Denied” error. If you are managing a static site hosted on S3 with CloudFront and run into 403 issue on custom paths, this configuration should for you too.</p><p>If you encounter similar issues, feel free to use the above solution to fix them, and if you have any questions or suggestions, please leave comment below!</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ce08a26cead" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Up with JavaScript: Our React App’s Journey to TypeScript]]></title>
            <link>https://medium.com/@pmventura/breaking-up-with-javascript-our-react-apps-journey-to-typescript-5d39d5d4d00f?source=rss-32286bcd6e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d39d5d4d00f</guid>
            <dc:creator><![CDATA[Paul]]></dc:creator>
            <pubDate>Mon, 25 Mar 2024 13:11:21 GMT</pubDate>
            <atom:updated>2024-03-25T13:11:21.461Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey folks! Starting off, our project was all set up with ReactJS and Vite. We chose Vanilla JS initially because it was simple and something we all knew like the back of our hands. It worked great at the beginning, helping us quickly get our features up and running and laying down the foundation of our app.</p><p>However, as our project grew in size and complexity, we started noticing some challenges. The same flexibility of JavaScript that we initially loved began to introduce some unpredictability, especially with type safety and maintaining a clean codebase. As our team expanded and our project scaled, it became increasingly tough to ensure our code stayed manageable.</p><p>That’s when we turned to TypeScript. It seemed like the perfect solution to help us maintain code quality, offering static typing that could tighten up our development process. So, we decided to migrate our app to TypeScript, and let me tell you, it‘s not that hard.</p><h3>Why TypeScript with Vite?</h3><p>Vite, known for its incredibly fast build times, offers out-of-the-box support for TypeScript. This seamless integration means that incorporating TypeScript into our Vite-powered project was a straightforward process, requiring minimal setup. The synergy between TypeScript and Vite is a match made in developer heaven. Vite takes advantage of TypeScript’s features to enhance its module reloading and build optimization capabilities. By pre-compiling TypeScript files, Vite ensures that our development environment remains as responsive as possible, allowing us to enjoy the benefits of TypeScript without sacrificing speed.</p><p>So enough talking, let’s dive into the how. It’s time to roll up our sleeves and get into the meaty part of our journey — migrating our React project to TypeScript.</p><h3>Step 1: Install TypeScript and Dependencies</h3><p>First things first, you need to add TypeScript to your project. Run the following command in your project directory:</p><pre>npm install --save-dev typescript @types/react @types/react-dom</pre><p>This command installs TypeScript along with the type definitions for React and ReactDOM, which are essential for TypeScript to understand React’s specific types</p><h3>Step 2: Configure TypeScript</h3><p>Next, create a tsconfig.json file in the root of your project. This file is crucial as it tells TypeScript how to compile your code. Here’s a basic tsconfig.json that you can start with:</p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    &quot;target&quot;: &quot;ES2020&quot;,<br>    &quot;useDefineForClassFields&quot;: true,<br>    &quot;lib&quot;: [&quot;ES2020&quot;, &quot;DOM&quot;, &quot;DOM.Iterable&quot;],<br>    &quot;module&quot;: &quot;ESNext&quot;,<br>    &quot;skipLibCheck&quot;: true,<br><br>    /* Bundler mode */<br>    &quot;moduleResolution&quot;: &quot;bundler&quot;,<br>    &quot;allowImportingTsExtensions&quot;: true,<br>    &quot;resolveJsonModule&quot;: true,<br>    &quot;isolatedModules&quot;: true,<br>    &quot;noEmit&quot;: true,<br>    &quot;jsx&quot;: &quot;react-jsx&quot;,<br><br>    /* Linting */<br>    &quot;strict&quot;: true,<br>    &quot;noUnusedLocals&quot;: true,<br>    &quot;noUnusedParameters&quot;: true,<br>    &quot;noFallthroughCasesInSwitch&quot;: true,<br>  &quot;baseUrl&quot;: &quot;./src&quot;,<br>  &quot;paths&quot;: {<br>    &quot;@pages/*&quot;: [&quot;./pages/*&quot;],<br>    &quot;@components/*&quot;: [&quot;./components/*&quot;]<br>  }<br>  },<br>  &quot;include&quot;: [&quot;./src&quot;],<br>  &quot;references&quot;: [{ &quot;path&quot;: &quot;./tsconfig.node.json&quot; }]<br>}</pre><h3>Step 3: Rename Files to .tsx or .ts</h3><p>Begin converting your files from .js or .jsx to .ts or .tsx (for files containing JSX). Start with components that have the least dependencies to minimize initial errors and gradually work your way up to more complex components.</p><h3>Step 4: Type Your Components</h3><p>Once your files are renamed, start typing your components. For functional components, this involves typing props and state if you’re using hooks. Here’s a simple example:</p><pre>// Button.jsx<br>type ButtonProps = {<br>  text: string;<br>  variant: string;<br>};<br><br>export default function Button({ text, variant }: ButtonProps) {<br>  ...<br>}</pre><h3>Step 5: Handle External Libraries</h3><p>If you’re using external libraries, install their respective @types packages to provide TypeScript with their type definitions. For libraries without type definitions, you may need to declare your own types or use declare module &#39;library-name&#39;; as a temporary workaround.</p><h3>Step 6: Gradually Type the Rest of Your Project</h3><p>Continue converting and typing the rest of your project piece by piece. It’s okay to use the any type as a placeholder, but aim to replace these with specific types over time for better type safety.</p><h3>Step 7: Compile and Debug</h3><p>After you’ve typed your components, run the TypeScript compiler to check for errors. You’ll likely encounter some issues that weren’t apparent before. Use this as an opportunity to refine your types and fix bugs that TypeScript has uncovered.</p><h3>Until next time</h3><p>And that’s a wrap! Thanks so much for reading this post. Keep learning, and happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d39d5d4d00f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>