InterStock – Stock Market Learning Platform

Computer Science

Description

InterStock is a web-based stock market learning platform that gives university students a risk free environment to learn trading, build financial literacy, and apply data-driven decision making. Each student starts with a $50,000 virtual balance and trades real-world stocks (AAPL, MSFT, TSLA, NVDA and 11 others) using live Yahoo Finance prices, with support for spot buy/sell and leveraged futures (2x–100x). An integrated LSTM neural network (97.88% R², 2.03% MAPE) generates 7 day price forecasts with bullish/bearish confidence levels. The platform pairs trading with structured learning timed quizzes, assignments, study materials, an AI chatbot and community features like group chat rooms, private messaging, leaderboards, and achievements. A dedicated teacher portal lets instructors upload content, monitor student performance, and run ML-driven analytics on trading behaviour.

Objectives

InterStock was built to bridge the gap between theoretical financial education and practical trading experience inside a university setting. Its primary objectives are: Deliver a fully functional stock market simulation that lets students practice trading with virtual currency ($50,000 starting balance) using live market data from the Yahoo Finance API, so the learning experience mirrors real market conditions without any financial risk. Implement a comprehensive trading engine supporting multiple instruments spot stock buy/sell with weighted-average price tracking, and futures trading with configurable leverage from 2x to 100x, complete with margin locking, liquidation price calculation, and real-time P&L settlement. Integrate an LSTM (Long Short-Term Memory) deep-learning model trained on five years of historical data across fifteen stocks (large-cap blue-chips and high-volatility names) with thirteen engineered features (RSI, MACD, moving averages, etc.) to expose students to AI-driven price prediction, directional analysis, confidence scoring, and 7-day forecasts. Build a structured educational module timed quizzes with automatic grading and answer review, assignment submission with drag-and-drop file upload, and curated study materials that reinforces theoretical financial knowledge alongside practical trading. Provide community and collaboration features (group chat rooms, private one-to-one messaging, AI-powered learning chatbot, notifications) to encourage peer learning and instant assistance. Add a gamification layer (leaderboards, achievement badges such as First Profit and Risk Master, Hall of Fame for top performers) that sustains engagement through healthy competition. Ensure secure authentication and data protection through JWT tokens, bcrypt password hashing with 10 salt rounds, and role-based access control separating student and teacher capabilities. Deliver a responsive, mobile-first interface using React 18 and Tailwind CSS that works smoothly from 320 px mobile up to desktop resolutions. Architect the platform as a scalable, maintainable three-tier system (React SPA ? Node.js/Express REST API ? MongoDB, with a separate Python/Flask LSTM microservice) following modern software-engineering practices so it can be self-hosted and customised by any educational institution.

Socio-economic benefit

Financial literacy is a critical life skill, yet conventional classroom teaching rarely gives students hands-on exposure to real markets, and commercial simulators (Investopedia, Wall Street Survivor, MarketWatch) are subscription-based, externally hosted, and lack the academic integration universities need. InterStock addresses this gap, producing benefits across four stakeholder groups: For students: a zero-risk environment to develop practical trading skills alongside theoretical knowledge. Live Yahoo Finance data makes the simulation authentic, while the LSTM predictions introduce students to applied machine learning a fast-growing competency in the financial industry. Gamification (leaderboards, achievements) turns learning into an engaging, semester-long experience that sustains motivation without exposing students to any monetary loss. For educators: built-in assessment tools quizzes with automatic grading, assignment tracking, and leaderboard-based performance monitoring let instructors evaluate students on both theory and practical trading behaviour. The teacher portal also surfaces ML-driven analytics on student trading patterns, enabling more holistic, data-informed evaluation than traditional written exams allow. For educational institutions: because InterStock is self-hosted and built entirely on open-source technologies (React, Node.js, MongoDB, Python), there are no per-seat licensing costs and no third-party data-sharing concerns. Institutions retain full control over student data, can customise content to match their curriculum, and can deploy it on their own infrastructure for long-term maintainability. For the broader field of financial education: the project demonstrates how modern web technologies, AI/ML, and real-time market data can be fused into a single effective learning tool. The LSTM model's 97.88% R² accuracy is a concrete example of deep learning applied to an educational context. Beyond universities, the same architecture is adaptable to corporate training in financial services, personal-finance workshops, investment-club simulations, and broader financial-literacy initiatives particularly valuable in emerging economies like Pakistan where access to safe, structured market-learning tools is limited and where improving population-wide financial literacy has direct economic upside (better household saving and investment decisions, lower exposure to fraudulent schemes, a more capable future workforce for the financial sector).

Methodologies

InterStock follows an iterative, modular software-engineering process built on a three-tier client-server architecture: Presentation layer (Frontend): React 18 single-page application built with Vite 5.0, styled with Tailwind CSS, with state managed through the React Context API. Recharts powers interactive OHLCV candlestick charts with configurable timeframes (1d ? max). Axios handles all REST communication. The UI is mobile-first responsive down to 320 px. Application layer (Backend): Node.js 18 / Express.js REST API serving 40+ routes for authentication, trading, portfolio, education, community, and admin operations. JWT tokens (30-day validity) secure protected endpoints; bcryptjs (10 salt rounds) hashes passwords; role-based access control separates students from teachers. The backend orchestrates external services and proxies prediction requests to the ML microservice. Data layer: MongoDB Atlas (v6.0+) stores users, portfolios, orders, futures positions, chat messages, quizzes, assignments, and study materials. Yahoo Finance data is fetched server-side with a 60-second cache to respect rate limits. ML microservice: A separate Python 3.13 / Flask 3.0 service hosts a TensorFlow 2.16 LSTM model trained on five years of daily OHLCV data for fifteen stocks (AAPL, MSFT, GOOGL, AMZN, NVDA, META, TSLA, AMD, GME, PLTR, COIN, RIVN, SOFI, SNAP, RBLX). Thirteen engineered features (close, volume, RSI, MACD, moving averages, volatility indicators, etc.) feed a stacked LSTM that outputs the next-day price plus a 7-day forecast with directional confidence. Trading engine logic: Spot trades update weighted-average purchase price; sells compute realised P&L. Futures positions lock margin = contractValue ÷ leverage, compute liquidation price from leverage and entry, and settle P&L as priceChange × contracts × leverage (negated for shorts). Process: Development followed an incremental Gantt-driven plan (Sept 2025 – May 2026) requirements, design (deployment / class / ERD / sequence / state diagrams), implementation per module, then a structured QA phase using a requirement traceability matrix and 26+ documented test cases covering registration, trading, futures, predictions, quizzes, chat, and teacher workflows. Tools: VS Code, Git, Postman, Chrome DevTools, MongoDB Compass.

Outcome

The delivered InterStock platform is a fully working, end-to-end web application that meets every requirement defined at the start of the project: Trading simulation: Real-time spot trading for 15 stocks with live Yahoo Finance prices, weighted-average cost basis, realised/unrealised P&L tracking, and an interactive OHLCV chart with 8 selectable timeframes. Futures trading is operational with leverage selectable from 2x to 100x, automatic margin locking, liquidation-price calculation, and one-click position close. AI prediction: The trained LSTM achieves R² = 0.9788, MAPE = 2.03%, RMSE = $4.05 on the held-out test set across the 15 covered stocks. Predictions are exposed in the UI as current vs. predicted price, bullish/bearish direction with confidence percentage, and a 7-day forecast chart. Portfolio management: Auto-created portfolio with a $50,000 starting balance, live valuation, holdings breakdown by symbol, paginated 20-per-page transaction history, and a portfolio-reset option. Education: Six structured timed quizzes with automatic grading and answer review, four assignments with drag-and-drop submission, three curated study materials, and a personal notes module. An AI chatbot provides instant Q&A assistance. Community: Two group chat rooms, private one-to-one messaging with student search, notification preferences, leaderboards with podium display, achievement badges (First Profit, Risk Master, etc.), and a Hall-of-Fame for top three students. Teacher portal: Authenticated teacher accounts (OTP-based registration) can upload assignments, quizzes, and study materials; create / edit / mute chat rooms; pin or delete messages; edit profile; and view ML-driven analytics on individual student trading performance. Security & quality: JWT-based authentication with bcrypt hashing, role-based access control, server-side validation, and a documented test suite of 26 test cases all passing. Scale of delivery: 40+ routes/pages, three coordinated services (React frontend, Node backend, Flask ML), MongoDB Atlas persistence fully responsive from mobile to desktop, ready for institutional self-hosting.

Gallery

More from Computer Science

Ustad Go: An AI-Powered Mobile and Web Ecosystem for Verified Local Service Provision in P…

Computer Science

Ustad Go is a dual-platform solution bridging the gap between skilled local service providers and households.…

Supervisor: Dr. Wasif Nisar

Sales Distribution Hub

Computer Science

The Sales Distribution Hub is a web-based management system designed for Masood & Company to automate and stre…

Supervisor: Dr. Wasif Nisar.

AI Based Road Damage Detection System

Computer Science

AI Based Road Damage Detection System is a smart application that uses YOLOv8 and computer vision techniques t…

Supervisor: Mehwish Mukhtar

EvaluTech: AI-Powered Hiring & Job Platform for Employers and Applicants

Computer Science

EvaluTech is an intelligent recruitment management platform that streamlines the complete hiring lifecycle fro…

Supervisor: Dr. Wasif Nisar