FallnAI/Autonomous-Software-Developer
0
1<!DOCTYPE html>2<html lang="en">3<head>4 <meta charset="UTF-8">5 <meta name="viewport" content="width=device-width, initial-scale=1.0">6 <title>FallnAI Autonomous Software Developer</title>7 <style>8 body { font-family: sans-serif; margin: 20px; background-color: #f0f4f8; }9 .container { max-width: 900px; margin: auto; padding: 20px; background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }10 h1 { text-align: center; color: #333; }11 .input-group { margin-bottom: 20px; }12 textarea { width: 100%; height: 100px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }13 button { padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; }14 button:disabled { background-color: #aaa; cursor: not-allowed; }15 .log-section, .code-section, .docs-section { margin-top: 20px; }16 pre { background: #eee; padding: 15px; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word; }17 #progressLog, #finalCode, #finalUI, #finalDocs { border: 1px solid #ddd; min-height: 150px; }18 </style>19</head>20<body>21 <div class="container">22 <h1>🤖 FallnAI Autonomous Software Developer v.01</h1>23 <p>Enter your software specifications below. The agents will plan, code, and test the solution automatically using open-source models.</p>24 25 <div class="input-group">26 <textarea id="prompt" placeholder="e.g., A simple Python script that takes a list of numbers and returns the sum."></textarea>27 <button id="devButton" onclick="startDevelopment()">Start Development</button>28 </div>29 30 <div class="log-section">31 <h2>Development Log</h2>32 <pre id="progressLog">Waiting for input...</pre>33 </div>34 35 <div class="code-section">36 <h2>Final Code (`app.py`)</h2>37 <pre id="finalCode">The final code will appear here.</pre>38 </div>39 40 <div class="code-section">41 <h2>User Interface (`index.html`)</h2>42 <pre id="finalUI">The user interface code will appear here.</pre>43 </div>44 45 <div class="docs-section">46 <h2>Documentation (`README.md`)</h2>47 <pre id="finalDocs">The README file will be generated here.</pre>48 </div>49 </div>50 51 <script>52 async function startDevelopment() {53 const prompt = document.getElementById('prompt').value;54 const progressLog = document.getElementById('progressLog');55 const finalCode = document.getElementById('finalCode');56 const finalUI = document.getElementById('finalUI');57 const finalDocs = document.getElementById('finalDocs');58 const devButton = document.getElementById('devButton');59 60 if (!prompt) {61 alert('Please enter a prompt.');62 return;63 }64 65 devButton.disabled = true;66 progressLog.textContent = 'Development started... This may take a few minutes as the model is generating and the sandbox is building.';67 finalCode.textContent = 'Awaiting result...';68 finalUI.textContent = 'Awaiting result...';69 finalDocs.textContent = 'Awaiting result...';70 71 try {72 const response = await fetch('http://localhost:5000/develop', {73 method: 'POST',74 headers: { 'Content-Type': 'application/json' },75 body: JSON.stringify({ prompt: prompt })76 });77 78 const data = await response.json();79 80 if (response.ok) {81 progressLog.textContent = data.log;82 if (data.status === "success") {83 finalCode.textContent = data.final_code;84 finalUI.textContent = data.final_ui;85 finalDocs.textContent = data.final_docs;86 } else {87 finalCode.textContent = "Could not generate working code. See log for details.";88 finalUI.textContent = "";89 finalDocs.textContent = "";90 }91 } else {92 progressLog.textContent = `Error from server: ${data.error}`;93 }94 } catch (error) {95 progressLog.textContent = `Failed to connect to the backend: ${error.message}`;96 } finally {97 devButton.disabled = false;98 }99 }100 </script>101</body>102</html>103 