This branch of Yfin features a Streamlit web application that provides a user-friendly interface for managing stock data. It allows users to authenticate, track stock tickers, run the data pipeline, and visualize historical stock data, all through a web browser.
- Interactive Web UI: A Streamlit-based application for easy interaction.
- User Authentication: Secure login via Google OAuth or email/password (powered by Supabase).(Working on google auth)
- Personalized Ticker Management: Users can add, view, and manage their own list of stock tickers.
- On-Demand Data Sync: Trigger the data pipeline directly from the web interface to fetch and update stock data.
- Data Visualization: View historical stock data for tracked tickers within the application.
- PostgreSQL Integration: Stores all fetched data in a structured PostgreSQL database.
- Python 3.x
- PostgreSQL database server
- Supabase project (for authentication and database)
-
Create a Supabase Project: Sign up for Supabase and create a new project. Note down your project URL and
anonpublic key. -
Configure Supabase Authentication: Enable Google authentication in your Supabase project settings if you plan to use it.
-
Database Setup: The Streamlit app connects to a PostgreSQL database. You can use the default PostgreSQL database provided by Supabase or configure your own.
Ensure your database has a
public.user_tickerstable for storing user-specific tickers. Thepostgre.pyscript handles table creation for stock data. -
Configure Streamlit Secrets: Create a
.streamlitdirectory in your project root if it doesn't exist. Inside, create asecrets.tomlfile with your Supabase credentials and database URL:# .streamlit/secrets.toml [supabase] url = "YOUR_SUPABASE_URL" key = "YOUR_SUPABASE_ANON_KEY" db_url = "postgresql://postgres:YOUR_DB_PASSWORD@db.YOUR_SUPABASE_PROJECT_REF.supabase.co:5432/postgres"
Replace placeholders with your actual Supabase project details and database credentials.
Navigate to the project root directory and install the required Python packages:
pip install -r requirements.txtTo run the Streamlit application:
streamlit run streamlit_app.pyThis will open the application in your web browser, typically at http://localhost:8501.
This Streamlit application can be deployed to Streamlit Community Cloud or other platforms that support Streamlit applications. Ensure your secrets.toml is correctly configured for the deployment environment.