- Structure
- Requirements
- How to build
- How to start
- Troubleshooting and known issues
StockAnalyzer/
├── backend/
│ ├── data/
│ ├── include/
│ │ ├── auth.h
│ │ ├── json_utils.h
│ │ ├── server.h
│ │ ├── stock.h
│ │ ├── user.h
│ │ ├── watchlist.h
│ │ └── yahoo_finance.h
│ ├── src/
│ │ ├── auth.cpp
│ │ ├── json_utils.cpp
│ │ ├── main.cpp
│ │ ├── server.cpp
│ │ ├── stock.cpp
│ │ ├── user.cpp
│ │ ├── watchlist.cpp
│ │ └── yahoo_finance.cpp
│ └── CMakeLists.txt
├── frontend/
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ ├── app.js
│ │ └── auth.js
│ ├── index.html
│ ├── login.html
│ └── signup.html
├── .gitignore
└── readme.md
- CMake (avalible on https://cmake.org/download/)
During install, choose "Add CMake to system PATH".
To verify:
camake --version
- A C++ compiler (Visual Studio avalible on https://visualstudio.microsoft.com/)
During install, check "Desktop development with C++"
In powershell
Navigate to backend:
cd path_to_project\stockanalyzer\backend
Building the whole thing:
cmake -B build
cmake --build build -- config Release
The executable will be at build\Release\StockAnalyzer.exe
In PowerShell
From inside the backend, run the executable:
./build\Release\StockAnalyzer.exe
The output should be:
[Main] Initialising Yahoo Finance client...
[Yahoo] Initialised. Crumb obtained.
[Main] Starting server on port 8081...
[Server] Listening on http://localhost:8081
Once it says "Listening", open the second PowerShell
In 2nd PowerShell
Start-Process " path_to_project\frontend\login.html"
It will open the Login page in Browser
How to stop In 1st PowerShell "Ctrl + C", and just close the window in browser
Note: The server creates a
backend/datafolder automatically on first run. This is whereusers.binandstocks.binare stored. Do not delete this folder while the server is running.
| Problem | Fix |
|---|---|
cmake not found |
Re-run the CMake installer and choose "Add to PATH", then restart your terminal |
bind() failed on port 8081 |
Something else is using port 8081. Find and close it, or change the port number in src/main.cpp and rebuild |
[Yahoo] Warning: could not obtain crumb |
No internet connection, or Yahoo Finance is temporarily down. The frontend will fall back to cached stock data from the last successful fetch |
| Frontend shows "Connection error" | The server is not running. Start it first, then refresh the page |
| Blank stock list after login | The server started but Yahoo Finance returned no data. Wait 30 seconds and click Refresh Data |