{"slug": "day-3-of-demolishing-my-stack-of-unfinished-projects-smartnotes-project", "title": "Day 3 of Demolishing my Stack of Unfinished Projects: SmartNotes Project", "summary": "A developer's SmartNotes project and portfolio chatbot broke after their OpenAI API account was suspended. They migrated to Hugging Face inference APIs via Nebius, rewrote the AI integration layer, and switched from MongoDB to Neon PostgreSQL, implementing streaming responses and multi-layered fallbacks for resilience.", "body_md": "Published on Aug 18th, 2025\n\nAfter successfully implementing a chatbot based on ChatGPT in my portfolio (as detailed in my previous \"Redesign Portfolio\" post), I was feeling pretty good about myself. The AI integration was working smoothly, users could ask questions about my skills and projects, and I had successfully created content embeddings that made the chatbot intelligent and contextually aware.\n\nLittle did I know that this \"completed\" project was about to become the perfect candidate for my \"Unfinished Projects\" series.\n\nIt started with a simple error message: \"OpenAI API account suspended.\" At first, I thought it was a simple configuration issue. Maybe I had accidentally exposed my API key or hit some rate limit. But after checking my environment variables and account status, I realized the problem was deeper.\n\nMy OpenAI account was suspended, and suddenly, my \"completed\" AI chat functionality was completely broken. Suddenly, my SmartNotes app which also powers the chat functionality went offline.\n\nThis was supposed to be a finished project. Instead, it had become the latest addition to my stack of unfinished work.\n\nThe immediate challenge was clear: either abandon the chat functionality entirely or find an alternative solution. Given that I had already invested significant time in building the user interface and database integration, abandoning it wasn't an option.\n\nI started researching alternatives:\n\n**Claude API**: Limited availability and different pricing structure\n\n**Local AI models**: Required significant computational resources\n\n**Hugging Face**: Promising, but I had no experience with their inference API\n\nThe clock was ticking, and my portfolio was broken.\n\nAfter several hours of research and testing, I discovered that Hugging Face offered inference APIs that could potentially replace OpenAI's functionality. The catch? I had to completely rewrite the AI integration layer.\n\nThis wasn't just a simple API swap - it was a complete architectural overhaul. I had to:\n\nReplace OpenAI's embedding model with Hugging Face alternatives\n\nFind a suitable text generation model\n\nHandle different response formats\n\nImplement proper error handling for a new service\n\n**Model Selection Hell** Finding the right model on Hugging Face proved more challenging than expected. My first attempts failed spectacularly:\n\n`microsoft/DialoGPT-medium`\n\n- \"No inference provider available\"\n\n`gpt2`\n\nand `distilgpt2`\n\n- Limited conversational capabilities\n\n`Qwen/Qwen3-4B`\n\n- Finally worked with the `nebius`\n\nprovider\n\n**Database Architecture Evolution** The migration also exposed a fundamental issue: my MongoDB setup wasn't ideal for production use. I decided to migrate to Neon PostgreSQL, which meant:\n\nUpdating Prisma schema\n\nMigrating existing data\n\nHandling different ID types\n\nTesting the new connection\n\n**Streaming Responses: The Silver Lining** One positive outcome was implementing streaming text responses. Instead of waiting for complete AI responses, users now see text appear word-by-word, creating a ChatGPT-like experience that's actually better than the original implementation.\n\nI learned a valuable lesson about building robust systems. I implemented a multi-layered fallback approach:\n\n**Vector Search**: Primary method using Pinecone embeddings\n\n**Text Search**: Fallback to simple text matching\n\n**Intelligent Responses**: Pre-built responses for common queries\n\nThis ensures that even if the AI service fails, users still get helpful responses.\n\nWhat started as a crisis has evolved into a more robust, scalable system. The new implementation includes:\n\n✅ Hugging Face AI integration via Nebius\n\n✅ Streaming text responses\n\n✅ PostgreSQL database backend\n\n✅ Comprehensive error handling\n\n✅ Multiple fallback mechanisms\n\n**Single Point of Failure**: Relying on one AI service provider is risky\n\n**Production vs. Development**: What works in development might fail in production\n\n**Resilience by Design**: Building fallback systems from the start saves time and maintains user experience\n\n**The Definition of \"Complete\"**: A project isn't truly finished until it can handle real-world failures gracefully\n\nThis experience taught me something important about my \"Unfinished Projects\" series. Sometimes, what appears to be a finished project is actually just waiting for the right failure to reveal its incompleteness.\n\nThe AI chat integration wasn't truly finished until it could survive the loss of its primary service provider. In that sense, the \"unfinished\" phase was actually a blessing - it forced me to build something more robust than I originally planned.\n\nEven now, I'm not sure this project is truly \"finished.\" I'm already planning improvements:\n\nUser analytics for chat interactions\n\nConversation history persistence\n\nMulti-language support\n\nIntegration with more AI models\n\nThis project taught me that \"unfinished\" isn't always a negative state. Sometimes, it's the catalyst for building something better than originally envisioned. The AI chat integration that almost wasn't has become one of my portfolio's most resilient features.\n\nFor developers facing similar challenges, remember: every obstacle is an opportunity to improve your architecture. What seems like a setback might actually be pushing you toward a better solution.\n\nThe journey from \"finished\" to \"unfinished\" to \"better than finished\" is what makes development exciting. Embrace the chaos, build resilience, and never stop improving.\n\n**Technical Stack Used:**\n\nNext.js 15.0.0\n\nHugging Face Inference API\n\nNeon PostgreSQL\n\nPrisma ORM\n\nPinecone Vector Database\n\nStreaming text responses\n\nMulti-layered fallback system\n\n**Resources:**\n\nThis blog post captures the emotional journey, technical challenges, and valuable lessons learned while maintaining the honest, problem-solving tone that your \"Unfinished Projects\" series is known for. It shows how \"unfinished\" can actually lead to better outcomes!", "url": "https://wpnews.pro/news/day-3-of-demolishing-my-stack-of-unfinished-projects-smartnotes-project", "canonical_source": "https://dev.to/codenificient/day-3-of-demolishing-my-stack-of-unfinished-projects-smartnotes-project-j2f", "published_at": "2026-07-28 03:50:49+00:00", "updated_at": "2026-07-28 04:05:14.617276+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "developer-tools", "ai-infrastructure"], "entities": ["OpenAI", "Hugging Face", "Nebius", "Neon PostgreSQL", "MongoDB", "Pinecone", "Prisma", "ChatGPT"], "alternates": {"html": "https://wpnews.pro/news/day-3-of-demolishing-my-stack-of-unfinished-projects-smartnotes-project", "markdown": "https://wpnews.pro/news/day-3-of-demolishing-my-stack-of-unfinished-projects-smartnotes-project.md", "text": "https://wpnews.pro/news/day-3-of-demolishing-my-stack-of-unfinished-projects-smartnotes-project.txt", "jsonld": "https://wpnews.pro/news/day-3-of-demolishing-my-stack-of-unfinished-projects-smartnotes-project.jsonld"}}