Index: database/drizzle/queries/builds.ts
===================================================================
--- database/drizzle/queries/builds.ts	(revision 8fe7f1a767c88b0e707d70ba86e48e5563ea908e)
+++ database/drizzle/queries/builds.ts	(revision ae5d054380355a32555383768cf7c4a780c9028d)
@@ -511,6 +511,10 @@
             description
         })
-        .where(eq(buildsTable.id, buildId))
-        .returning({ id: buildsTable.id });
+        .where(
+            eq(buildsTable.id, buildId)
+        )
+        .returning({
+            id: buildsTable.id
+        });
 
     return updated?.id ?? null;
Index: database/drizzle/queries/components.ts
===================================================================
--- database/drizzle/queries/components.ts	(revision 8fe7f1a767c88b0e707d70ba86e48e5563ea908e)
+++ database/drizzle/queries/components.ts	(revision ae5d054380355a32555383768cf7c4a780c9028d)
@@ -278,5 +278,5 @@
     switch (componentType) {
         case 'cpu':
-            compatibleComponents = await getCompatibleCPUs(db, existing, limit, sortCondition);
+            compatibleComponents = await getCompatibleCPUs(db, existing, existingTDP, limit, sortCondition);
             break;
         case 'motherboard':
@@ -287,5 +287,5 @@
             break;
         case 'gpu':
-            compatibleComponents = await getCompatibleGPUs(db, existing, pciExpressSlotsUsed, limit, sortCondition);
+            compatibleComponents = await getCompatibleGPUs(db, existing, existingTDP, pciExpressSlotsUsed, limit, sortCondition);
             break;
         case 'memory':
@@ -317,5 +317,5 @@
 
 // Helper functions for checking component-specific compatibility
-async function getCompatibleCPUs(db: Database, existing: any, limit?: number, sortCondition?: any) {
+async function getCompatibleCPUs(db: Database, existing: any, existingTDP?: number, limit?: number, sortCondition?: any) {
     const conditions = [eq(componentsTable.type, 'cpu')];
 
@@ -362,10 +362,28 @@
         .limit(limit || 100);
 
+    let filteredCPUs = cpus;
+
     if (existing.cooler?.details?.cpuSockets) {
         const coolerSockets = existing.cooler.details.cpuSockets.map((s: any) => s.socket);
-        return cpus.filter(cpu => coolerSockets.includes(cpu.socket));
-    }
-
-    return cpus;
+        filteredCPUs = filteredCPUs.filter(cpu => coolerSockets.includes(cpu.socket));
+    }
+
+    if(existing.psu?.details?.wattage && existingTDP) {
+        const psuWattage = Number(existing.psu.details.wattage) || 0;
+
+        if (psuWattage > 0) {
+            const budget = psuWattage / 1.2;
+
+            const currentCpuTdp = Number(existing.cpu?.details?.tdp) || 0;
+            const baseWithoutCpu = existingTDP - currentCpuTdp;
+
+            filteredCPUs = filteredCPUs.filter(cpu => {
+                const cpuTdp = Number(cpu.tdp) || 0;
+                return (baseWithoutCpu + cpuTdp) <= budget;
+            });
+        }
+    }
+
+    return filteredCPUs;
 }
 
@@ -517,5 +535,5 @@
 }
 
-async function getCompatibleGPUs(db: Database, existing: any, pciExpressSlotsUsed: number, limit?: number, sortCondition?: any) {
+async function getCompatibleGPUs(db: Database, existing: any, existingTDP: number, pciExpressSlotsUsed: number, limit?: number, sortCondition?: any) {
     const conditions = [eq(componentsTable.type, 'gpu')];
 
@@ -556,10 +574,28 @@
         .limit(limit || 100);
 
+    let filteredGPUs = gpus;
+
     if (existing.motherboard) {
         const availableSlots = Number(existing.motherboard.details.pciExpressSlots);
-        return gpus.filter(() => (pciExpressSlotsUsed + 1) <= availableSlots);
-    }
-
-    return gpus;
+        filteredGPUs = gpus.filter(() => (pciExpressSlotsUsed + 1) <= availableSlots);
+    }
+
+    if(existing.psu?.details?.wattage && existingTDP) {
+        const psuWattage = Number(existing.psu.details.wattage) || 0;
+
+        if (psuWattage > 0) {
+            const budget = psuWattage / 1.2;
+
+            const currentGpuTdp = Number(existing.cpu?.details?.tdp) || 0;
+            const baseWithoutGpu = existingTDP - currentGpuTdp;
+
+            filteredGPUs = filteredGPUs.filter(cpu => {
+                const gpuTdp = Number(cpu.tdp) || 0;
+                return (baseWithoutGpu + gpuTdp) <= budget;
+            });
+        }
+    }
+
+    return filteredGPUs;
 }
 
