$ show andfanilo/social-media-tutorials
This repository is a collection of educational tutorials demonstrating various Python web frameworks and data analysis techniques. The majority of content consists of self-contained Streamlit applications showcasing features like QR code generation, form handling, session state, file-based routing, and multipage apps. It also includes examples of other frameworks such as FastAPI (with JWT authentication), Reflex, Marimo, NiceGUI, H2O Wave, Dash, and Fasthtml. A notable data research component is the Jupyter notebook analyzing pandas usage patterns across 1.2 million notebooks from UCSD Library archives. Architecture-wise, each tutorial is independent with no overarching system. Streamlit apps range from single-file scripts to multipage applications using st.navigation or custom file-based routing. Backend services like the FastAPI server in the authentication tutorial are paired with Streamlit frontends. The pandas analysis notebook follows an end-to-end pipeline: extracting notebooks from archives, parsing code via AST, filtering results, and visualizing API usage statistics. Key entry points are streamlit_app.py files in each tutorial directory, framework-specific server files (e.g., fastapi_server.py), and the pandasmostused.ipynb notebook. The repository exhibits moderate craftsmanship with several reusable patterns: a file-based routing system for Streamlit, a JWT authentication mechanism securing Streamlit via FastAPI backend, and parallel AST processing for bulk notebook analysis. However, it shows signs of technical drift including mixed use of deprecated and current Streamlit caching methods, hardcoded secrets in plaintext, and inconsistent dependency management. Maintenance is active based on recent commits, but the tutorial nature means some examples prioritize clarity over production best practices.
The LLM identified 3 files worth highlighting for reuse:
Implements a dynamic file-based routing system for Streamlit apps that automatically generates pages from a directory structure. Eliminates boilerplate for multipage apps by using st.navigation and filesystem discovery. Demonstrates advanced Streamlit usage with modular page organization and is easily extractable due to minimal dependencies (only streamlit and os).
Provides a reusable JWT-based authentication backend for securing Streamlit applications. Includes token generation, verification, user management, and role-based access control. Isolated from the Streamlit frontend (which consumes the API) and demonstrates non-obvious skill in integrating FastAPI with Streamlit for secure multipage apps. Can be adapted to other frontend frameworks with minimal changes.
Contains a scalable pipeline for analyzing pandas usage across large collections of Jupyter notebooks. Features robust AST parsing to extract imports/calls/attributes, parallel processing via joblib, and filtering for alias consistency. The core functions (files_in_zip, get_nb_code, parse_nb) are well-encapsulated and demonstrate expertise in static analysis and performance optimization for bulk notebook processing.