An interactive, gamified financial education platform that teaches lifelong investing through engaging gameplay. Experience 30 years of financial decisions in just minutes across multiple game modes.
TradeSim gamifies financial literacy by letting players experience real-world financial scenarios in a safe, educational environment. Players start at age 22 with $5,000 and navigate through life events (jobs, emergencies, market crashes) while making investment choices that teach core financial principles.
- Story Mode: 5 levels with 7 randomized questions per level, covering ages 22-52
- Battle Mode: 2-player competitive mode with 3 levels and timed questions
- Kcoin Story: Branching narrative scenario with real-time price simulation and behavioral feedback
- Realistic Finance Engine: Monthly salary deposits, debt compounding, market volatility
- Dynamic Difficulty: Higher levels introduce black-swan events, expense inflation, and riskier choices
- Educational Feedback: End-of-level summaries with personalized advice
- Badge System: Track achievements and learning milestones
- Portfolio Visualization: Real-time charts showing net worth progression
- Retro UI: Pixel-art aesthetic with character avatars
- Node.js 16.x or higher
- npm 8.x or higher (comes with Node.js)
-
Clone or download the repository
cd TradeSim -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:7971 - The game will automatically open in your default browser
- Navigate to
# Create optimized production build
npm run build
# Preview production build locally
npm run previewThe production build will be in the dist/ folder, ready for deployment.
-
Push your code to GitHub
-
Connect to Vercel
- Go to vercel.com
- Click "New Project"
- Import your GitHub repository
- Vercel will auto-detect Vite and configure settings
-
Deploy
- Click "Deploy" - your site will be live in seconds!
-
Install Netlify CLI (optional)
npm i -g netlify-cli
-
Build and deploy
npm run build netlify deploy --prod --dir=dist
- Build the project:
npm run build - Upload the
dist/folder to any static hosting service:- GitHub Pages
- AWS S3 + CloudFront
- Firebase Hosting
- Any web server
- Start Game: Enter your name and select a starting scenario
- Choose Mode: Select Story Mode, Battle Mode, or Kcoin Story
- Make Decisions: Answer financial questions and make investment choices
- Watch Your Portfolio: See your net worth grow (or shrink) in real-time
- Learn: Receive feedback and tips at the end of each level
- Complete: Finish all levels and see your final financial outcome
- Frontend Framework: React 18.2.0
- Build Tool: Vite 5.0.8
- Styling: Tailwind CSS 3.3.6
- Charts: Chart.js 4.4.0
- Animations: react-confetti 6.1.0
TradeSim/
├── src/
│ ├── components/ # React UI components
│ ├── core/ # Financial engine & game rules
│ ├── modes/ # Game mode implementations
│ ├── utils/ # Helper functions
│ ├── knowledge/ # Educational content
│ ├── App.jsx # Main application component
│ └── main.jsx # Application entry point
├── public/ # Static assets
│ └── backgrounds/ # Background images
├── docs/ # Architecture documentation
│ ├── CODE_ARCHITECTURE_QA.md
│ └── FRONTEND_BACKEND_ARCHITECTURE.md
├── index.html # HTML template
├── package.json # Dependencies
└── vite.config.js # Vite configuration
Note: Detailed architecture documentation is available in the
docs/folder for developers.
npm run dev- Start development server (port 7971)npm run build- Build for productionnpm run preview- Preview production build
Issue: Stale bundles or cache problems
# Clear Vite cache
rm -rf node_modules/.vite
# On Windows:
rmdir /s node_modules\.vite
# Reinstall and restart
npm install
npm run devIssue: Port 7971 already in use
- Change the port in
vite.config.jsor kill the process using port 7971
TradeSim teaches:
- Compound Interest: How money grows over time
- Diversification: Spreading risk across investments
- Emergency Funds: Importance of cash reserves
- Debt Management: Understanding credit card interest
- Market Volatility: Realistic market ups and downs
- Sequence Risk: Timing of market events matters
- Behavioral Finance: Emotional decision-making pitfalls
After playing TradeSim, users will understand:
- How compound interest works
- Why starting early matters
- The importance of emergency funds
- How debt compounds and impacts wealth
- Market volatility and recovery patterns
- Risk management strategies
This project is built by NCTBytes, a HKU Student-led group. For contributions:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
All rights reserved by NCTBytes, a HKU Student-led group.
Built for hackathon demonstration. Designed to be educational and engaging for Gen Z non-investors (ages 18-25).
- Game state resets on page refresh (intentional for MVP)
- No save/load functionality (can be added with localStorage)
- No user accounts or leaderboards (future feature)
- User accounts and progress tracking
- Leaderboards and social features
- Real-time market data integration
- Additional game scenarios
- Mobile app version
- Multiplayer features
Need Help? Check the code comments or open an issue on GitHub.