Investment platforms need to handle sensitive user data securely, simulate live portfolio performance in real time, and surface intelligent recommendations that help users make better decisions. Building this as a clean, extensible backend — one that could serve as a real product foundation rather than a throwaway demo — required careful architecture decisions around auth, data modelling, background processing, and the AI layer.
Built the Ecovest API as a structured Express/Mongoose skeleton with production-ready patterns throughout. JWT authentication with cookie-based sessions handles secure user access. A cron-based investment simulation engine runs on a configurable schedule, updating portfolio values in the background to mimic live market behaviour. The dashboard endpoint aggregates portfolio data efficiently. The AI recommendations module is architected as a clean placeholder — structured to accept real OpenAI calls without touching the rest of the system.
JWT authentication with bcrypt password hashing and cookie-based sessions
User registration and login with secure credential handling
Investment model with demo balance and portfolio tracking
Cron-based simulation engine for live investment value updates
Protected dashboard route with portfolio aggregation
AI recommendations module — structured for OpenAI integration
Background updater logic for continuous portfolio simulation
Modular file structure: models, controllers, routes, middleware, utils