{"slug": "how-i-built-a-multi-asset-investment-platform-with-next-js-postgresql-docker-and", "title": "How I Built a Multi-Asset Investment Platform with Next.js, PostgreSQL, Docker and AI", "summary": "A developer built ApexPulse, an open-source multi-asset investment dashboard that unifies Binance crypto holdings, Trading 212 stocks and ETFs, and Nigerian Stock Exchange positions behind a modular monolith on Next.js 15 and TypeScript, with PostgreSQL and Prisma as the shared data layer. A dedicated pricing engine routes each holding to its source (Binance, Yahoo Finance, synced broker data, or the Mansa API with a scraper fallback) and normalises all prices to USD, while a separate cron worker syncs holdings, builds market snapshots, and generates AI swing signals through OpenAI with a DeepSeek fallback, storing only signals above an 80% confidence threshold and emailing daily briefs via Resend. External price providers are treated as best-effort dependencies, falling back to a holding's cost basis when a live quote is unavailable.", "body_md": "Most investment dashboards are easy to build when every asset comes from one provider.\n\nThe real engineering challenge starts when your portfolio is spread across different markets, currencies, APIs, and data sources.\n\nThat is the problem I am solving with **ApexPulse**.\n\nApexPulse is a multi-asset investment dashboard designed to bring together:\n\n• Binance crypto holdings\n\n• Trading 212 stocks and ETFs\n\n• Nigerian Stock Exchange (NGX) positions\n\n• Different currencies and pricing sources\n\n• AI-generated market signals\n\n• Automated portfolio updates and daily intelligence\n\nInstead of forcing every data provider into the UI directly, I designed ApexPulse as a **modular monolith** with clear responsibilities.\n\nThe core application runs on **Next.js 15 + TypeScript**, while PostgreSQL and Prisma provide the shared data layer.\n\nA dedicated pricing engine routes each holding to the correct source:\n\nCrypto → Binance\n\nUS stocks → Yahoo Finance\n\nTrading 212 → synced broker data\n\nNGX → Mansa API with scraper fallback\n\nAll prices are normalised internally into USD so the rest of the application works with one consistent pricing model.\n\nThat removes a major source of complexity from the dashboard itself.\n\nAnother important part of the architecture is background processing.\n\nA separate **cron worker** handles work that should not depend on a user opening the application.\n\nIt:\n\n• Synchronises Binance holdings automatically\n\n• Builds market snapshots\n\n• Generates AI swing signals\n\n• Applies an 80%+ confidence threshold\n\n• Stores qualified signals in PostgreSQL\n\n• Sends daily portfolio intelligence through Resend\n\nFor deployment flexibility, I also included **GitHub Actions as an alternative scheduling mechanism**.\n\nThat means scheduled jobs do not have to depend entirely on the application process itself. GitHub Actions can trigger automation independently when that deployment model makes more sense.\n\nThe system also uses:\n\n🔐 NextAuth v5 for authentication\n\n🐘 PostgreSQL + Prisma for persistence\n\n⚡ TanStack Query for client-side caching and refresh\n\n🤖 OpenAI with DeepSeek fallback for AI signals\n\n📩 Resend + React Email for daily briefs\n\n🐳 Docker for consistent local and production environments\n\n⚙️ GitHub Actions for workflow automation and optional scheduling\n\n🧠 Redis reserved for  caching and rate limiting\n\nOne architectural requirement I considered carefully was resilience.\n\nFinancial APIs are not always available.\n\nA provider may become rate-limited, return incomplete data, or temporarily fail.\n\nApexPulse therefore treats external price providers as **best-effort dependencies**.\n\nWhen a live quote cannot be retrieved, the system can fall back to the holding's existing cost basis rather than returning zero, removing the asset, or breaking the dashboard.\n\nThat design decision matters because availability should not depend entirely on one external API.\n\nI also deliberately avoided moving immediately to microservices.\n\nAt this stage, a modular monolith gives ApexPulse:\n\n• Clear domain separation\n\n• Simpler deployment\n\n• Lower operational complexity\n\n• Shared transactional data\n\n• Easier local development\n\n• A clear path to split services later if scale requires it\n\nRedis, managed workers, queues, and further service separation can be introduced when there is an actual scaling requirement rather than adding infrastructure prematurely.\n\nBuilding ApexPulse has reinforced something I think matters in software engineering:\n\n**Architecture is not about using the largest number of technologies. It is about designing boundaries, failure behaviour, automation, and data flow around the problem being solved.**\n\nI have made the project public for anyone interested in reviewing the implementation or architecture:\n\n🔗 [https://github.com/bhoyee/ApexPulse](https://github.com/bhoyee/ApexPulse)\n\nI would particularly like feedback from engineers working with distributed systems, fintech platforms, backend architecture, or cloud infrastructure:\n\n**Which part of this architecture would you separate first if the platform started scaling significantly?**", "url": "https://wpnews.pro/news/how-i-built-a-multi-asset-investment-platform-with-next-js-postgresql-docker-and", "canonical_source": "https://dev.to/bhoyee/how-i-built-a-multi-asset-investment-platform-with-nextjs-postgresql-docker-and-ai-2ld1", "published_at": "2026-09-25 06:22:34+00:00", "updated_at": "2026-09-25 06:59:03.418003+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "developer-tools", "ai-infrastructure"], "entities": ["ApexPulse", "Next.js", "PostgreSQL", "Prisma", "Binance", "Trading 212", "OpenAI", "DeepSeek"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-i-built-a-multi-asset-investment-platform-with-next-js-postgresql-docker-and", "markdown": "https://wpnews.pro/news/how-i-built-a-multi-asset-investment-platform-with-next-js-postgresql-docker-and.md", "text": "https://wpnews.pro/news/how-i-built-a-multi-asset-investment-platform-with-next-js-postgresql-docker-and.txt", "jsonld": "https://wpnews.pro/news/how-i-built-a-multi-asset-investment-platform-with-next-js-postgresql-docker-and.jsonld"}}