📖 About the Project: The Story

💡 The Inspiration

Most CRMs are built for "The Big Close"—complex B2B sales cycles with long pipelines and multiple stakeholders. While building the early versions of this project, we realized that small retail businesses were being left behind.

A local shop owner doesn't need a "lead qualification" stage; they need to know which customers haven't visited in 30 days and how to send them a discount code via SMS. We were inspired to pivot from a generic "contact manager" to a retail-first intelligence engine that treats every purchase as a data point for growth.


🛠️ How We Built It

We chose a modern, high-performance stack to ensure the CRM felt "instant" even with thousands of records:

  • The Core: Built with React 19 and Vite for the frontend, leveraging the latest in component performance, paired with Tailwind CSS for a premium "glassmorphism" aesthetic.
  • The Brain: The backend is powered by Node.js and PostgreSQL 17. We implemented a custom ML Analytics Service that handles K-means clustering and RFM analysis directly on the server.
  • The AI: We integrated ASI:One (Meta-Llama 3.1) to create a "DB-Aware" chat. This allows users to talk to their data using natural language, removing the need for complex SQL reporting.
  • Data Sync: We built a real-time Google Sheets bridge that auto-syncs inventory and customer data every 60 seconds.

🧠 What We Learned

  • Data Strategy over Feature Set: We learned that a single "Total Spent" aggregate field on a customer profile is often more valuable than five separate "deal" stages for a retail user.
  • The Power of JSON: Using JSON columns in PostgreSQL for itemized purchase history allowed us to stay flexible without the overhead of a rigid many-to-many schema for every single SKU.
  • AI Grounding: We discovered that "prompt engineering" isn't enough; to make the AI truly useful, we had to build a system that injects specific database schemas into the context so the AI "knows" exactly what it's looking at.

🚧 Challenges We Faced

  1. The Migration Wall: Moving from version 2.0 (Generic) to 3.0 (Retail) required migrating thousands of legacy "Contacts" and "Sales" into the new "Customer 360" schema while recalculating complex aggregate statistics on-the-fly.
  2. Real-time Performance: Calculating 7 different ML modules (like Churn Prediction and Cohort Analysis) can be resource-intensive. We optimized our SQL queries and implemented server-side caching to keep load times under 200ms.
  3. UI Density: Fitting a sales pipeline, purchase history, SMS campaigns, and AI chat into a single dashboard without making it feel cluttered was a major design hurdle, solved through a "Contextual Sidebar" and tabbed views.

🚀 The Result

AstroCRM is now more than just a place to store phone numbers. It’s a tool that tells a business owner who to call, what they’re likely to buy next, and exactly how much the business is worth today.

Built With

Share this project:

Updates