Skip to content

sean21307/stock-market-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

258 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stock Market Simulator

Features

  • Simulate market/limit buy and sell orders using real-time stock data
  • Create separate wallets to test different strategies
  • Setup watchlists to easily view different sets of stocks
  • Examine detailed information about a company and recent news related to its stock
  • View insights about today's top gainers/losers, congress trading activity, AI price prediction, and more
  • Communicate with other users on the community forums

Screenshots

Wallet Page StockSc1

Top Declining Stocks Losers

Specific Stock Page StockPageTOp StockPageBottom

Insights Insights

Adding stock to watchlists AddWatchlist

πŸ“ˆ Stock Market Simulator

This project simulates stock market activity using an Angular (TypeScript) frontend and a Django Rest Framework (python) backend. It's ideal for learning about web development, API integration, and financial technology.


🧰 Software Requirements

Before running the project, install the following tools:

Software Purpose Download Link
Git To clone the project repository https://git-scm.com/
Node.js To run the frontend (React) https://nodejs.org/
Python 3.9+ To run the backend (Python API) https://www.python.org/
MySQL Backend database https://www.mysql.com/
(Optional) VS Code Recommended code editor https://code.visualstudio.com/

πŸš€ Installation Guide (Step-by-Step)

1. Clone the Repository

git clone https://github.com/sean21307/stock-market-simulator.git
cd stock-market-simulator

2. Set Up the Frontend (Angular)

cd frontend
npm install -f
npm start

This starts the frontend at: http://localhost:4200


3. Set Up the Backend (Python)

cd ../backend
python -m venv venv

πŸ‘‰ Activate the virtual environment:

  • Windows:

    venv\Scripts\activate
  • macOS/Linux:

    source venv/bin/activate

Install Python dependencies:

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the backend folder and add:

DB_PORT="3306"
DB_NAME="stock-market-schema"
DB_HOST="localhost"
DB_USERNAME="your_mysql_username"
DB_PASS="your_mysql_password"
API_KEY="your_fmp_api_key"  # FMP (Financial Modeling Prep) API Key
HUGGING_FACE_TOKEN="hf_your_token"  # Hugging Face API Token

πŸ” Replace the placeholders with your actual credentials and API keys.


5. Tell Django to Create the Database

Be inside the root backend folder with virtual environment activated:

python manage.py migrate

6. Start the Backend Server

Be inside the root backend folder with virtual environment activated:

python manage.py runserver

πŸ’‘ Notes

  • Make sure MySQL is installed and running before starting the backend.
  • Frontend runs on port 4200.

πŸ“ Note: Use start_project.py Script

After completing all the installation steps above, you can use the start_project.py script to automatically run the project. This script will launch both the frontend and backend servers for you.

Simply run:

python start_project.py

❓Helpful Links


πŸ“¬ Questions?

If you get stuck, feel free to open an issue or ask for help!

Releases

No releases published

Packages

 
 
 

Contributors