How hanshans135/shin-her works
Project type and purpose
• This is a small full-stack web application built with Python/Flask on the backend and server-rendered HTML (Jinja2) with Tailwind CSS/JavaScript on the frontend.
• Purpose: Improve usability of the “欣河” (Xinhe) academic system by scraping data (via BeautifulSoup) and re-presenting it through a cleaner UI. It also automates login via an external captcha-solving service (CapMonster).
File structure
• Top-level files:
• app.py – Flask application entrypoint, defines routes/controllers
• get_fun.py – scraping functions (data retrieval from the original Xinhe system)
• login_fun.py – login automation (handles session & captcha)
• config.example.json / config.json – configuration for external URLs, API keys, secrets, ports
• data.json – local JSON “database” to cache or persist scraped data
• requirements.txt – Python dependencies
• templates/ – Jinja2 templates for each page (index, login, scores, attendance, curriculum, etc.)
• No separate “static” folder is shown, but Tailwind CSS & JS likely injected via CDN or inline.
README for additional insights
• Backend stack: Python + Flask + Jinja2 + BeautifulSoup
• Frontend: HTML + Tailwind + JS
• External dependencies: original Xinhe URL (“base_url”), CapMonster captcha API
Detailed capture of essential elements
• Route definitions (app.py)
• Auth sub-module (login_fun)
• Scraper sub-module (get_fun)
• Configuration loader
• File store
• How data flows from initial user request through authentication, scraping, persistence, templating, and final render.