Stockle.ca is a stock market-themed spinoff of the classic Wordle game. In Stockle, players are challenged to guess a randomly chosen stock from a curated list. Players have 6 attempts to identify the correct stock based on clues provided after each incorrect guess. The clues include information about the stock's sector, share price, market cap, etc. Test your market knowledge and strategic thinking—can you crack the code and guess the stock in 6 tries?
stockle-demo.mov
- Built a robust backend with
Node.js,Express.js, andMongoDB, with endpoints for stock data and user administration - Wrote a
Pythonscript to process CSV files of NASDAQ and NYSE tickers, filtering out indices, ETFs, small-cap stocks, and cross-listed stocks; fetches historical data usingyfinanceand stores it inMongoDBwithpymongo - Implemented a secure token-based user authentication with
JWTandbcrypt, with login, signup, and guest play options - Developed a responsive and modular single page app with
ReactandMUI, featuring interative stock and bar charts withChart.js - Refactored
Reactstate components to adopt a Flux architecture withRedux, along with custom hooks for game logic and state management - Utilized
DockerandDocker Composefor streamlined development and deployment - Deployed
Reactapp withVerceland pushed aNode-basedDockerimage toAWS ECRto pull and deploy onAWS ECS, which uses a singleAWS EC2instance and load balancer
Follow these steps to set up and run the project locally with Docker Compose.
-
Prerequisites: Before you begin, ensure you have the following installed:
-
Clone the Repository: Start by cloning the repository to your local machine:
git clone git@github.com:landont168/stockle.git cd stockle -
Environment Variables: Set up the environment variables by creating a
.envfile in the root of the backend directory:PORT=4000 MONGODB_URI=mongodb+srv://<username>:<password>@<cluster-url>/<database>?retryWrites=true&w=majority SECRET=<secret> -
Run Python script: To fetch and store historical data from yfinance for the curated stocks in MongoDB, you must run a Python script within a virtual environment (Runtime: ~ 10 minutes).
-
Create and active a virtual environment:
cd backend/scripts python -m venv venv source venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt -
Run the Python script:
python get_stock_data.py -
Deactivate the virtual environment:
deactivate
-
-
Run with Docker Compose: With Docker and Docker Compose, you can run the entire application with a single command to access the application at http://localhost:5173.
-
Build and start the containers:
docker-compose up --build -
Stop the containers:
docker-compose down
-
- Full Stack Open - For resources on Node.js, Express.js, React, and Redux.
- Chart.js - Charting library.
- Material-UI - UI components.
- MongoDB Atlas - Database hosting.
- Vercel - Deployment for the React frontend.
- AWS ECS - Deployment for the Node backend.
- AWS ECR - Docker image repository.
