How srgitq/instagram-crawler-app works
Project type and purpose
• This is a full-stack application for crawling data from public Instagram profiles, processing it, and exposing it via a dashboard.
• The backend is a Flask-based “crawler_api” that orchestrates scrapers, stores data, and applies preprocessing.
• The frontend is a Streamlit app (“streamlit-front”) that renders charts and tables based on the scraped data.
File structure
• Top-level directories:
• crawler_api/ – Python package that includes:
· db.py – database connection and ORM or queries
· scrapper/ – modules that actually fetch data (instagram_conf.py, navigator_assistant.py)
· utils/ – helper modules (preprocessing, timer, userParser)
• streamlit-front/ – Streamlit UI code: atoms/ (reusable widgets), frontutils/, display.py, main.py
• Requirements.txt defines backend dependencies (Flask, scraping libraries, database drivers)
• No Docker or Kubernetes manifests—this is deployed as two separate services.
README for additional insights
• Describes task distribution among multiple extractors to speed up scraping
• Mentions multiple accounts to avoid abuse detection
• Points at advanced data-processing steps (sentiment analysis, topic modeling, clustering)
• Indicates scalability but no dedicated message queue—likely Python threads or processes.
a. Main components:
1. Streamlit Frontend
2. Flask Backend API
3. Scraper Engine (the “crawler_api.scrapper” modules)
4. Data Processing / Preprocessing modules
5. Database (e.g., Postgres, MongoDB, or SQLite)
6. External Service: Instagram Public API / Web endpoints
b. Relationships & interactions:
• Streamlit UI → (HTTP/gRPC) → Flask API endpoints to start a crawl or fetch results
• Flask API → orchestrates Scraper Engine → fetches raw data from Instagram
• Scraper Engine → passes raw data → Preprocessing modules (sentiment, clustering)
• Processed data → saved into Database via db.py
• Streamlit UI → polls or subscribes for new data → renders bar charts, post lists, user info
c. Architectural patterns / design principles:
• Separation of concerns: UI vs. API vs. Scraper vs. Data Store
• Modular design (utils, scrapper vs. orchestration layer)
d. Key technologies & frameworks:
• Python 3.x, Flask for API
• Streamlit for frontend
• Scraping libraries (Selenium, Instaloader or custom navigator_assistant)
• Pandas / Numpy… for preprocessing
• Database driver (psycopg2, SQLAlchemy, PyMongo)