Skip to content

4awmy/aast-lms-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AAST LMS Sync

Automated course material synchronization for AAST Moodle LMS

Node.js License: ISC Puppeteer AI Skill

Eliminates the manual effort of downloading and organizing lectures, sections, and assignments from the AAST LMS. Supports delta sync, intelligent categorization, Google Drive integration, and AI agent control via the Gemini CLI.


Table of Contents


Features

Feature Description
Automated Sync Pulls course materials directly from the AAST LMS (Moodle)
Course Discovery Auto-detects enrolled courses and their LMS IDs
Smart Categorization Sorts resources into Lectures/, Sections/, and Assignments/
Standardized Naming Applies Week XX β€” [Resource Name] prefix from LMS section structure
Delta Sync Only downloads new or modified files β€” saves time and bandwidth
Google Drive Support Syncs supplementary materials from Drive links via gdown
Session Persistence Caches authenticated sessions to minimize login frequency

Architecture

aast-lms-sync/
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ discover.cjs        # Dashboard scraper β€” extracts course names & LMS IDs
β”‚   β”œβ”€β”€ lms_sync.cjs        # Core sync engine β€” auth, parsing, download pipeline
β”‚   └── parse_portal.cjs    # AAST portal utilities & data extraction
β”œβ”€β”€ courses.json            # Course ID mapping (created from example)
β”œβ”€β”€ courses.json.example    # Template for courses.json
β”œβ”€β”€ SKILL.md                # AI agent skill definition (Gemini / MCP)
└── package.json

Data Flow

Credentials  ──►  Authentication  ──►  Session Cache (session.json)
                       β”‚
                       β–Ό
              Course ID Resolution
             (courses.json / Discovery)
                       β”‚
                       β–Ό
              Delta Analysis
         (remote metadata vs local state)
                       β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό                 β–Ό
         LMS Download     Google Drive
         (axios/fetch)      (gdown)
              β”‚                 β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β–Ό
              Post-Processing
         (rename β†’ Week XX prefix β†’ categorize)

Prerequisites

Dependency Version Purpose
Node.js v16+ Runtime environment
Puppeteer bundled via npm Headless browser for Moodle login & AJAX pages
gdown latest Downloads files/folders from Google Drive
Chrome / Chromium any recent Browser engine used by Puppeteer

Install gdown via pip:

pip install gdown

Setup

1. Clone & Install

git clone https://github.com/4awmy/aast-lms-sync.git
cd aast-lms-sync
npm install

2. Create Credentials File

Create lms_creds.txt in your Uni directory:

your_lms_username
your_lms_password

Important

Each credential must be on its own line. Do not include labels or extra whitespace.

3. Configure Environment

Create a .env file in the project root:

BASE_DIR="C:/Users/YourUser/OneDrive/Desktop/Uni"
CRED_FILE="C:/Users/YourUser/OneDrive/Desktop/Uni/lms_creds.txt"
GDOWN_PATH="gdown"
PUPPETEER_EXECUTABLE_PATH="C:/Program Files/Google/Chrome/Application/chrome.exe"

Configuration

Course Mapping

Copy the example and populate your courses:

cp courses.json.example courses.json

Edit courses.json:

{
  "Numerical Methods": { "id": "1523" },
  "System Modeling And Simulation": {
    "id": "10227",
    "extra_sources": {
      "Sections": "https://drive.google.com/drive/folders/YOUR_FOLDER_ID"
    }
  },
  "Computing Algorithms": { "id": "10230" }
}

Tip: Don't know your course IDs? Run the discovery script:

npm run discover

Usage

Sync a Specific Course

node scripts/lms_sync.cjs "Numerical Methods"

Discover All Enrolled Courses

npm run discover

Output Structure

After a sync, materials are organized as:

Uni/
└── Numerical Methods/
    β”œβ”€β”€ Lectures/
    β”‚   β”œβ”€β”€ Week 01 β€” Introduction to Numerical Methods.pdf
    β”‚   └── Week 02 β€” Error Analysis.pdf
    β”œβ”€β”€ Sections/
    β”‚   └── Week 01 β€” Section Practice.pdf
    └── Assignments/
        └── Week 03 β€” Assignment 1.pdf

AI Skill Integration

aast-lms-sync is designed as an AI Skill compatible with the Gemini CLI and MCP-based agents. The SKILL.md file provides agents with the context to:

  • Understand when to trigger a sync
  • Map natural language course names to script parameters
  • Handle local filesystem paths according to the user's workspace

Example Agent Commands

"Sync my Computing Algorithms course."
"Check for new assignments in Numerical Methods."
"Download all missing materials for this week."

Security & Privacy

Caution

Protect Your Credentials

  • lms_creds.txt β€” Contains your plaintext LMS password. Store it in a secure location and never commit it to version control. It is listed in .gitignore by default.
  • session.json β€” Contains active session cookies. Treat it with the same security level as your password.
  • .env β€” Contains filesystem paths. Do not commit.

Compliance: Use this tool in accordance with AAST's Acceptable Use Policy. Avoid excessive scraping that may trigger rate limits or security flags.


License

This project is licensed under the ISC License.


Built for AAST students, by an AAST student.

About

πŸš€ Professional AAST LMS synchronization tool with course discovery, smart renaming, and AI skill integration (Gemini CLI / MCP).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors