Inspiration

Small and Medium-sized Businesses (SMBs) are the backbone of the economy, yet they often make expensive, make-or-break decisions with limited visibility into future consequences. If a restaurant owner wants to hire three new staff members and raise prices by 10%, they usually rely on intuition, basic spreadsheets, or expensive consultants. Meanwhile, Fortune 500 enterprises use sophisticated simulation software to model outcomes before spending a dime. We were inspired to democratize this power. We built TwinOS to give every SMB owner their own "Digital Twin" a virtual, living model of their business where they can simulate operational, financial, and staffing decisions safely in a sandbox before executing them in the real world.

What it does

TwinOS is a complete AI-powered business simulation platform. Digital Twin Builder: Users connect their data (or sync via integrations like QuickBooks, Square, and Shopify) to create a living model of their revenue streams, products, employees, and fixed costs. Scenario Engine: Users can create hypothetical events (e.g., "Marketing budget +50%" or "Supplier delay of 2 weeks"). Simulation & Forecasting: Our engine runs the scenario against the business's baseline and forecasts the impact on Profit, Revenue, Employee Capacity, and Inventory Risk over 30, 90, or 365 days. Counterfactual Explorer: Instead of guessing, users can tell the system their goal (e.g., "Increase profit by 20%") and TwinOS will calculate the exact operational changes required to achieve it.

How we built it

I built TwinOS to be incredibly fast and highly scalable, starting with rapid UI iteration. Frontend: I prototyped the initial UI concepts using v0 to get a feel for the layouts. From there, I built out the full application using Next.js (App Router) and React for a snappy, server-rendered interface, fully custom-styled with Tailwind CSS. All data visualizations and timeline projections are powered by Recharts. Backend & Database: I utilized TypeScript API routes interfacing with Prisma ORM. The database layer was designed to run locally on SQLite for rapid development, and I later scaled it to a production-grade AWS Aurora PostgreSQL cluster for core relational data, paired with Amazon DynamoDB as a high-speed NoSQL caching layer to instantly store and retrieve heavy AI simulation results. Authentication: Secure, multi-tenant user authentication and session management is handled via Clerk. Integrations: I built custom OAuth 2.0 pipelines to sync live financial, product, and labor data directly from the QuickBooks API, Square POS API, and Shopify API. I also engineered fallback sandbox/mock modes so the platform can be tested and demonstrated without needing live developer keys.

Challenges we ran into

One of the hardest challenges was designing the Simulation Engine. I had to ensure the mathematical formulas (e.g., forecasting demand elasticity when prices change) were generic enough to apply to various industries (retail, hospitality, ecommerce) but accurate enough to be actionable. Another major hurdle was building the integration architecture. Implementing secure OAuth 2.0 token exchanges and refresh cycles for QuickBooks, Square, and Shopify required careful encryption and state management. I also had to build a robust "Mock Mode" so the platform could still be demonstrated cleanly even if live developer API keys weren't present.

Accomplishments that we're proud of

As a first-time user of AWS Aurora and DynamoDB, I am incredibly proud of successfully architecting and deploying a robust, dual-cloud database layer. Transitioning my local SQLite development environment to a fully managed PostgreSQL cluster and NoSQL caching system on AWS was a major technical milestone for me. I figured out how to securely handle VPC configurations, manage database endpoints, and seamlessly integrate Aurora with Prisma ORM while using DynamoDB for high-speed simulation telemetry. Seeing my Next.js backend reliably read and write real-time simulation data to enterprise-grade AWS databases without breaking a sweat during testing was a massive eureka moment. Alongside that, I’m deeply proud of the Workspace Settings Dashboard I built, which allows users to interact with this cloud database through zero-latency inline editing.

What we learned

I learned that business owners do not trust pure "black-box" AI when it comes to their financial decisions. I discovered that by combining deterministic mathematical simulation formulas with AI-driven explanations (clearly explaining why a number went up or down), I could drastically increase user trust and make the platform much more valuable. On the technical side, diving into AWS Aurora and DynamoDB taught me a massive amount about cloud database provisioning and modern serverless architecture.

What's next for TwinOS

I am planning to upgrade the Counterfactual Optimization Engine from Hill Climbing to Genetic Algorithms, allowing it to search millions of scenario permutations in seconds. I also plan to introduce real-time multiplayer collaboration, so business partners can tweak simulations together simultaneously.

Built With

Share this project:

Updates