Skip to content

About

A stock market simulator for the Dhaka Stock Exchange (DSE). Real-time tracking, risk-free virtual trading, and automated financial insights

Topics

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

251 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StockSimulatorBD Logo

StockSimulatorBD

A Risk-Free Trading Simulator for the Dhaka Stock Exchange


Live Demo Download APK



Next.js React TypeScript Tailwind CSS Firebase PWA License



Practice DSE trading risk-free β€” for students and for new investors moving towards the stock market.




StockSimulatorBD is a risk-free paper-trading simulator for the Dhaka Stock Exchange (DSE). It mirrors real market conditions β€” live prices, T+2/T+3 settlement, broker commission, market hours β€” using a virtual, non-monetary trading balance, so students and first-time investors (including people moving from safer instruments like Sanchayapatra or fixed deposits) can build confidence before risking real capital.


πŸ“± Download the App

The web app is a full PWA. A TWA-wrapped Android APK is also published as a GitHub Release for a native-feeling install β€” search this repo's Releases page, or use the badge below, to get it.

Requirements Android 8.0+
Package tech.stocksimulator.zaifears
Notes Not built by this repo's own build pipeline β€” packaged via PWABuilder as a Trusted Web Activity and distributed through this repo's Releases. The badge link above always resolves to the newest release.



πŸ“ˆ Main Features

Stock Trading Simulator

πŸš€ Live DSE Prices Market data is scraped from the DSE archive (api/dse_chart.py, api/market_sync.py) and cached in Firestore, including candlestick charts on each stock's page.
πŸ”’ Server-Side, Tamper-Proof Trades Every BUY/SELL runs in an authoritative Firestore Admin SDK transaction (app/api/simulator/trade) β€” price, commission, and the T+2/T+3 settlement rule are all re-derived and enforced server-side, not trusted from the client.
πŸ“… Market Calendar Bangladesh public holidays and DSE trading hours (10:00–14:15, Fri/Sat weekend) are enforced on both client and server.
πŸ’° Virtual Currency via bKash Recharge your simulator balance through an admin-reviewed bKash flow. Coins have no real-world monetary value β€” they're for practice only.
πŸ’Ύ Offline-Capable PWA A custom service worker keeps the app usable with poor connectivity; installable on desktop and Android.

πŸ‘‘ Account Tiers: Bro vs. Boss

Tier Price Who it's for Key Capabilities
Bro Tier Free forever Beginners, students, cautious learners 10,000 welcome coins, live DSE prices, candlestick charts, real-time portfolio holdings, and basic order history.
Boss Tier ΰ§³20 / Month (31 days)
ΰ§³99 / 6 Months (185 days)
Active learners & disciplined paper traders Portfolio Insights & Risk Radar (banked realized P&L, 21-sector DSE exposure, concentration risk alerts, 0.4% commission tracking), +10% free coins bonus on every recharge, and gold profile recognition.

Security & Privacy by Design: Portfolio Insights are strictly isolated in memory and the DOM for Boss users only. Non-Boss accounts receive zero insight data in their React tree, preventing any client-side inspection bypass.

Platform & Content

Area Description
Auth Firebase Auth β€” email/password, Google Sign-In, and Google One Tap. Real-time onSnapshot tier synchronization.
Boss Tier Hub /boss β€” transparent 1-month and 6-month plans, 14-feature audit comparison, mobile-friendly payment flow via bKash.
DSE Learning Blog Headless-CMS-powered (Contentful) articles on BO account opening, brokers, and DSE investing basics.
Admin Command Center /admin & /admin/tier β€” 1-click Boss tier approvals/rejections, user email/UID search & manual grant, recharge queue, tamperproof security audit, and site analytics. Firebase custom-claim gated.



πŸ› οΈ Tech Stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Framework        Next.js 16 (App Router)                   β”‚
β”‚  Language         TypeScript 5 (strict)                     β”‚
β”‚  Styling          Tailwind CSS 3                             β”‚
β”‚  UI               React 19 + Lucide Icons                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Backend / DB     Firebase Firestore + Firebase Auth        β”‚
β”‚  Market Data      Python scrapers (Oracle VM)               β”‚
β”‚  Content          Contentful (headless CMS, blog)           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Monitoring       Sentry + sampled web-vitals RUM           β”‚
β”‚  Performance      Service Workers (PWA) + bundle analysis   β”‚
β”‚  Deployment       Oracle VM + Caddy + Cloudflare            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜



πŸš€ Local Development

Prerequisites

  • Node.js β€” see .nvmrc for the exact version
  • pnpm (package manager)
  • Git
  • A Firebase project (Auth + Firestore + a service account for the Admin SDK)

Quick Start

# 1. Clone & enter
git clone https://github.com/zaifears/StockSimulatorBD.git
cd StockSimulatorBD

# 2. Install dependencies
pnpm install

# 3. Configure environment
# Create .env.local with your Firebase (client + admin), Contentful,
# reCAPTCHA, and Resend credentials. There's no .env.example in this repo -
# grep the codebase for `process.env.` to see every variable in use.

# 4. Launch dev server
pnpm dev

Note: api/dse_chart.py and api/market_sync.py are Python scrapers that run on the Oracle VM (copies kept for local dev via dev.ps1) β€” they don't run under next dev. See AGENTS.md (Deployment) for how production is released.

Available Scripts

Command Description
pnpm dev Start development server
pnpm build Production build
pnpm start Start production server
pnpm type-check Run TypeScript type checking
pnpm lint / pnpm lint:fix Run ESLint
pnpm analyze Analyze bundle size (webpack bundle analyzer)
pnpm perf-test Lighthouse + bundle-size check against production
pnpm security-audit pnpm audit at moderate severity and above



πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.




πŸš€ Ready to master the market?



Visit Live Simulator Β Β·Β  Report Issue Β Β·Β  Contact



Built with ❀️ by zaifears

About

A stock market simulator for the Dhaka Stock Exchange (DSE). Real-time tracking, risk-free virtual trading, and automated financial insights

Topics

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages