How amoraschi/amoraschi works
Project Type and Purpose
• This is an open-source Node.js tool that automatically generates and updates your GitHub profile README on a schedule. It fetches data (weather, moon phase, SHA, sun events, etc.), renders charts/SVGs, and rewrites README.md accordingly.
File Structure Analysis
• Top level:
• .github/workflows/hourly.yml – GitHub Action scheduled to run hourly
• src/index.js – entry point (orchestrator)
• data/ – persists fetched data between runs
• old/ – legacy modules (generateChart, getMoon, updateWeather, etc.) and tests
• README.md – final output (profile)
• package.json/.lock – Node.js project config
• Pattern: a cron-driven pipeline invoking a central script which calls modular “generator” functions and writes output.
README Insights
• No explicit architecture section, but badges and commented sections show this is a dynamic profile readme generator.
• Relies on external data (weather APIs, astronomy APIs, GitHub metadata).
a. Main Components
• GitHub Scheduler (cron in .github/workflows/hourly.yml)
• GitHub Actions Runner (hosted VM)
• Orchestrator (src/index.js)
• Modules:
– getWeather/updateWeather.js
– getMoon.js
– generateSun.js
– generateChart.js
– generateReadme.js
– getSHA.js
• Data Store (data/ folder)
• Output Artifact (README.md + SVGs in repo)
• External Services:
– Weather API
– Astronomy API for moon/sun events
– GitHub API for commit SHA
b. Relationships and Data Flows
1. Scheduler triggers Workflow
2. Runner checks out code and runs npm install
3. src/index.js starts and:
• Calls each module in sequence
• Each module reads/writes data in data/
• Modules fetch from External Services
4. generateReadme.js assembles data+SVGs into README.md
5. Runner commits and pushes updated files back to GitHub repo
c. Architectural Patterns
• Pipeline/Batch pattern: a linear sequence of independent modules
• Modular design: each concern (weather, moon phase, charts) lives in its own function
• GitOps: all changes occur via commits through GitHub Actions
d. Key Technologies
• Node.js runtime
• GitHub Actions for scheduling and CI
• External REST APIs (weather, astronomy)
• Local filesystem for caching (data/)
• SVG generation libraries (in generateChart, generateSun)