How bansal-yash08/stock-market-project- works
1. What this repository is
- This is a single-app Streamlit project for Nifty 500 stock analysis and prediction.
- Architecturally, it is a monolithic Python dashboard: the same app.py file handles UI rendering, business logic, authentication, watchlists, admin access, and stock visualization.
2. Primary execution boundary
- The main runtime entrypoint is app.py.
- There is no separate backend service, database server, or frontend app in the tree.
- The browser talks directly to the Streamlit server process running this Python app.
3. User-facing interaction model
- Users access the system through a Streamlit web UI.
- The UI includes:
- login/signup
- user watchlists
- an admin dashboard
- stock analysis and prediction views
- Streamlit’s reactive execution model means most interaction state is managed inside the app process rather than through a separate API layer.
4. Data layer
- The core dataset is nifty500_stocks.csv, which serves as the stock market source data for analysis and prediction visuals.
- The README also indicates a local users.json file is used for account data and salted password hashes, although it is not shown in the tree.
- This suggests a file-based persistence model, not a relational database or external storage service.
5. Authentication and authorization
- Authentication appears to be implemented inside app.py.
- Admin access is controlled by a hardcoded email allowlist (ADMIN_EMAILS in app.py), with the README naming yash08bansal@gmail.com as the admin account.
- Regular user identities and password hashes are stored locally, so the auth boundary is application-managed rather than outsourced to an identity provider.
6. Watchlists and account state
- Watchlists are part of the user experience and likely stored alongside user records in the local user store.
- Because the project is file-backed, this state is simple to run locally but is not inherently durable across cloud restarts unless moved to a persistent database.
7. Deployment model
- The repository supports two deployment modes:
- Local execution on http://localhost:8503
- Streamlit Community Cloud for a permanent public dashboard URL
- The README explicitly recommends Streamlit Cloud as the long-term public deployment, and treats Cloudflare tunnel links as temporary.
8. Local launch and operational tooling
- There are multiple launcher scripts:
- START_DASHBOARD.bat
- run_app.bat
- run_app.ps1
- start_dashboard.ps1
- related “final project” and tunnel launchers
- These wrappers mainly manage starting the Streamlit process, choosing the port, and opening or reusing the local dashboard.
- The existence of these scripts indicates the project is optimized for non-technical users and classroom demos.
9. Cloud and networking options
- The repo includes Cloudflare tunnel setup files and notes, but these are positioned as temporary public access mechanisms.
- The final recommended public boundary is Streamlit Community Cloud, which removes dependence on a laptop staying online.
- So the repo’s external-access story has evolved from local-only, to tunneled preview, to permanent hosted dashboard.
10. Environment and dependency boundary
- requirements.txt defines the Python stack required by the app.
- runtime.txt pins the Python version for cloud deployment.
- .streamlit/config.toml configures Streamlit behavior, likely including UI/runtime settings that affect how the app is presented.
11. Documentation and packaging artifacts
- The repository contains multiple project deliverables:
- DEPLOYMENT.md
- PERMANENT_CLOUDFLARE_SETUP.md
- project PDFs/DOCX files
- link shortcut files like OPEN_DASHBOARD.url
- These are not runtime components, but they document and support the deployment/usage path for the dashboard.
12. Architecture summary for diagramming
- The most accurate diagram is:
- Browser user
- → Streamlit app process (app.py)
- → local file-based inputs/outputs (nifty500_stocks.csv, likely users.json)
- Admin and user flows are both inside the same app process.
- There are no separate services, queues, or databases in this repository; the architecture is intentionally compact and file-backed.
Main entry points: app.py app.py · README.md Docs · START_PERMANENT_CLOUDFLARE_TUNNEL.bat Tunnel setup · nifty500_stocks.csv Nifty CSV
Components 16
Runtime
Interactive Streamlit app and the main user-facing flows.
- Browser users · End users and admins accessing the dashboard through a web browser.
- app.py · Single monolithic Python application handling UI, business logic, authentication, and visualization.
app.py - UI shell · Reactive dashboard layout, navigation, and view rendering inside the app process.
app.py - Auth flow · User authentication, password handling, and session state managed in-app.
app.py - User data · Local account records and watchlist state maintained by the application.
- Admin panel · Restricted administration area gated by the app's admin email allowlist.
app.py - Stock views · Stock analysis, prediction, and visualization workflows exposed to users.
app.py - Watchlists · Per-user tracked stock lists and saved selections.
app.py - Nifty CSV · Primary stock-market input data used for analysis and prediction visuals.
nifty500_stocks.csv
Support
Deployment, configuration, and local launch artifacts.
- Streamlit server · Local or hosted Streamlit process serving the app to browsers.
- Launch scripts · Wrappers for starting the dashboard locally, opening ports, and handling demos or tunnels.
- Tunnel setup · Temporary public access path for exposing the local app through Cloudflare tunnels.
START_PERMANENT_CLOUDFLARE_TUNNEL.bat - Streamlit config · Streamlit settings that tune the app's runtime and presentation.
.streamlit/config.toml - Dependencies · Python packages required to run the dashboard.
requirements.txt - Python pin · Pinned Python version for deployment compatibility.
runtime.txt - Docs · Documentation and packaging artifacts for local launch, cloud deployment, and project delivery.
README.md
Connections 18
- Browser users → Streamlit server: use · Users open the dashboard in a browser.
- Streamlit server → app.py: runs · The Streamlit server executes the single app process.
- app.py → UI shell: renders · The app builds the dashboard interface and views.
- app.py → Auth flow: handles · Authentication and session control are implemented in the app.
- app.py → Stock views: serves · Analysis and prediction views are produced inside the same app.
- app.py → Watchlists: manages · User watchlists are created and updated in-app.
- app.py → Admin panel: gates · Admin features are exposed through app-level authorization.
- Auth flow → User data: reads/writes · Account records and password hashes are stored locally.
- Watchlists → User data: persists in · Watchlist state is associated with local user records.
- Stock views → Nifty CSV: reads · Market data is loaded from the CSV dataset.
- app.py → Streamlit config: uses · Streamlit runtime and presentation settings are loaded from config.
- app.py → Dependencies: depends on · The app runs with the Python dependency set.
- app.py → Python pin: targets · Deployment uses a pinned Python version.
- Launch scripts → Streamlit server: start · Batch and PowerShell scripts launch the local dashboard process.
- Tunnel setup → Streamlit server: exposes · Temporary tunnel scripts publish the local app to the public internet.
- Docs → Launch scripts: documents · Project docs explain local startup and operational usage.
- Docs → Tunnel setup: documents · Project docs explain tunnel-based access and setup.
- Docs → app.py: describes · Documentation centers on the single Streamlit application architecture.