|
| 1 | +--- |
| 2 | +title: "GSoC’25 Week 12 Update by Om Santosh Suneri" |
| 3 | +excerpt: "AI-powered Debugger for Music Blocks" |
| 4 | +category: "DEVELOPER NEWS" |
| 5 | +date: "2025-08-24" |
| 6 | +slug: "2025-08-24-gsoc-25-omsuneri-week12" |
| 7 | +author: "@/constants/MarkdownFiles/authors/om-santosh-suneri.md" |
| 8 | +tags: "gsoc25,sugarlabs,week12,Debugger,AI,Music Blocks,Final Submission" |
| 9 | +image: "assets/Images/GSOC.png" |
| 10 | +--- |
| 11 | + |
| 12 | +<!-- markdownlint-disable --> |
| 13 | + |
| 14 | +# Week 12 Progress Report by Om Santosh Suneri |
| 15 | + |
| 16 | +**Project:** [AI-powered Debugger for Music Blocks](https://github.com/omsuneri/AI-powered-Debugger-for-Music-Blocks) |
| 17 | +**Mentors:** [Walter Bender](https://github.com/walterbender/) [Sumit Srivastava](https://github.com/sum2it) |
| 18 | +**Assisting Mentors:** [Devin Ulibarri](https://github.com/pikurasa/) |
| 19 | +**Reporting Period:** 2025-08-21 - 2025-08-24 |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Goal for This Week |
| 24 | + |
| 25 | +The **primary objective** for this final week of Google Summer of Code 2025 was to **refactor and modularize the backend FastAPI server**, enabling it to operate **independently from the Streamlit frontend**. Additionally, I aimed to make the project **production-ready by deploying it on an AWS EC2 instance using systemd**, allowing continuous availability of the service. |
| 26 | + |
| 27 | +Alongside the deployment, I also worked on **documenting the complete contributor and user experience**, ensuring that **future contributors and users can easily get started** with the AI Debugger system. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## This Week’s Achievements |
| 32 | + |
| 33 | +### Backend Independence from Streamlit |
| 34 | + |
| 35 | +One of the **most important milestones** of this week was separating the **FastAPI backend** from the **Streamlit app**. Previously, the backend was tightly coupled with the Streamlit interface, limiting flexibility. I restructured the repository and added an **independent `api.py` file** that runs **Uvicorn as a FastAPI app**, making it easier to scale, test, and deploy. |
| 36 | + |
| 37 | +```bash |
| 38 | +# Now the backend can be launched directly with: |
| 39 | +python -m uvicorn app.api:app --host 0.0.0.0 --port 8000 |
| 40 | +``` |
| 41 | + |
| 42 | +This approach aligns with production-grade practices and allows the **Streamlit app and FastAPI backend to scale independently**. |
| 43 | + |
| 44 | + |
| 45 | +### Production Deployment on AWS EC2 with systemd |
| 46 | + |
| 47 | +To ensure the backend could **serve users 24/7**, I set up a **dedicated EC2 instance** on AWS and deployed the backend using a `systemd` service. |
| 48 | + |
| 49 | +Here’s a breakdown of the finalized configuration: |
| 50 | + |
| 51 | +```ini |
| 52 | +[Unit] |
| 53 | +Description=Debugger for Music Blocks - FastAPI backend |
| 54 | +After=network.target |
| 55 | + |
| 56 | +[Service] |
| 57 | +User=ubuntu |
| 58 | +WorkingDirectory=/home/ubuntu/AI-powered-Debugger-for-Music-Blocks |
| 59 | +ExecStart=/home/ubuntu/AI-powered-Debugger-for-Music-Blocks/venv/bin/python -m uvicorn app.api:app --host 0.0.0.0 --port 8000 |
| 60 | +Restart=always |
| 61 | +RestartSec=5 |
| 62 | +Environment=PYTHONUNBUFFERED=1 |
| 63 | + |
| 64 | +[Install] |
| 65 | +WantedBy=multi-user.target |
| 66 | +``` |
| 67 | + |
| 68 | +**Key Highlights:** |
| 69 | + |
| 70 | +* `ExecStart` runs Uvicorn directly from the virtual environment, ensuring environment consistency. |
| 71 | +* `Restart=always` allows **automatic recovery** in case of backend crashes. |
| 72 | +* Using `systemctl`, I enabled and started the service: |
| 73 | + |
| 74 | +```bash |
| 75 | +sudo systemctl daemon-reload |
| 76 | +sudo systemctl enable debugger.service |
| 77 | +sudo systemctl start debugger.service |
| 78 | +``` |
| 79 | + |
| 80 | +This ensures the backend remains **persistent and robust**, especially under real-world usage. |
| 81 | + |
| 82 | + |
| 83 | +### Contributor Documentation |
| 84 | + |
| 85 | +To make the project **accessible for new developers**, I authored the **AI-powered Debugger Widget - Contributor Guide**, which outlines the full stack — from the frontend widget integration to backend architecture. |
| 86 | + |
| 87 | +Some key highlights: |
| 88 | + |
| 89 | +* **Architecture Overview**: |
| 90 | + |
| 91 | +<a href=""><img src="https://i.ibb.co/CK8qXhfm/Screenshot-2025-08-22-at-12-34-44-AM.png" alt="Debugger Architecture"></a> |
| 92 | + |
| 93 | +* **API Interaction Sample**: |
| 94 | + |
| 95 | + ```js |
| 96 | + fetch("http://13.49.246.243:8000/analyze", { |
| 97 | + method: "POST", |
| 98 | + headers: { "Content-Type": "application/json" }, |
| 99 | + body: JSON.stringify({ |
| 100 | + code: projectData, |
| 101 | + prompt: message, |
| 102 | + history: history, |
| 103 | + prompt_count: this.promptCount |
| 104 | + }) |
| 105 | + }); |
| 106 | + ``` |
| 107 | + |
| 108 | +📎 [Contributor Guide on GitHub](https://github.com/omsuneri/musicblocks/blob/Debugger-docs/js/widgets/aidebugger-guide.md) |
| 109 | + |
| 110 | + |
| 111 | +### User Guide & Demo Video |
| 112 | + |
| 113 | +To assist end-users, especially **students, teachers, and parents**, I published a **visually engaging User Guide** along with a demo video: |
| 114 | + |
| 115 | +<a href=""><img src="https://i.ibb.co/93HCW8hC/Screenshot-2025-08-22-at-12-45-48-AM.png" alt="AI-Powered Debugger Widget Demo"/></a> |
| 116 | + |
| 117 | +**🎥 [Click to Watch the Demo Video](https://www.youtube.com/watch?v=G-NfDo_A5PM)** |
| 118 | + |
| 119 | +This guide explains: |
| 120 | + |
| 121 | +* How to drag and use the AI Debugger widget |
| 122 | +* Example questions to ask the AI |
| 123 | +* How the AI assistant explains errors and suggests fixes |
| 124 | + |
| 125 | +📘 [AI-Powered Debugger Widget Guide](https://github.com/omsuneri/musicblocks/blob/Debugger-docs/AI-Debugger-widget-guide.md) |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +### Why It Matters |
| 130 | + |
| 131 | +This week's work marks a **significant transition from development to deployment**. By **decoupling the backend**, setting up **system-level service management**, and providing **comprehensive documentation**, the project is now **fully production-ready**. |
| 132 | + |
| 133 | +This effort makes the **AI Debugger more scalable**, **developer-friendly**, and **accessible to educators and learners** across the Sugar Labs community. Now, **Music Blocks users can rely on a stable, intelligent assistant** to help them debug their musical creations in real time. |
| 134 | + |
| 135 | +--- |
| 136 | + |
| 137 | +### Final Thoughts |
| 138 | + |
| 139 | +As this marks the **final official week of Google Summer of Code 2025**, I want to take a moment to reflect on this incredible journey. |
| 140 | + |
| 141 | +Working on this project has not only sharpened my technical skills in **FastAPI**, **Streamlit**, **systemd**, **deployment pipelines**, and **full-stack architecture**, but also introduced me to the **open-source world** in the most collaborative way possible. I’m **deeply grateful** to my mentors and the Sugar Labs community for their continuous support and guidance. |
| 142 | + |
| 143 | +Building the AI-powered Debugger has been **one of the most fulfilling experiences** of my development journey so far. The ability to contribute to something that helps kids **learn music and programming more easily** makes me feel proud and inspired for future contributions. |
| 144 | + |
| 145 | +--- |
| 146 | + |
| 147 | +## Resources & References |
| 148 | + |
| 149 | +* **Backend Repository**: [AI Debugger](https://github.com/omsuneri/AI-powered-Debugger-for-Music-Blocks) |
| 150 | +* **Frontend Widget Code**: [Music Blocks Repository](https://github.com/omsuneri/musicblocks/blob/Debugger-docs/js/widgets/aidebugger.js) |
| 151 | +* **Documentation**: [Contributor Guide](https://github.com/omsuneri/musicblocks/blob/Debugger-docs/js/widgets/aidebugger-guide.md) | [User Guide](https://github.com/omsuneri/musicblocks/blob/Debugger-docs/AI-Debugger-widget-guide.md) |
| 152 | +* **Demo Video**: [Watch on YouTube](https://www.youtube.com/watch?v=G-NfDo_A5PM) |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## Acknowledgments |
| 157 | + |
| 158 | +Huge thanks to my mentors **Walter Bender**, **Sumit Srivastava**, and **Devin Ulibarri** for their mentorship, trust, and encouragement throughout the summer. |
| 159 | + |
| 160 | +Thanks also to the **Sugar Labs community** for welcoming me and providing constant feedback and motivation. |
| 161 | + |
| 162 | +I look forward to staying active in this community, contributing more, and supporting new learners through the tools we’ve built together. |
| 163 | + |
| 164 | +--- |
| 165 | +*Made with ❤️ for Music, Open Source, and Learning.* |
| 166 | + |
0 commit comments