Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🔧 Printed Part Tracker

A client-side web application that analyzes GitHub repositories to extract STL file structures and generates organized JSON catalogs for 3D printing projects.

Features

  • 🔍 Repository Analysis: Automatically scans GitHub repositories for STL and STLs folders
  • 📁 Hierarchical Structure: Maintains folder hierarchy in the generated JSON
  • 🎯 Smart Detection: Finds STL folders at root level and one level deep
  • 📋 Copy to Clipboard: Easy JSON export functionality
  • 🎨 Modern UI: Clean, responsive interface with loading states
  • Fast Processing: Efficient GitHub API integration

How It Works

  1. Enter a GitHub repository URL (e.g., https://github.com/PrintersForAnts/Micron)
  2. Click "Go" to analyze the repository
  3. The app will:
    • Search for STL/STLs folders in the repository
    • Recursively scan for STL files and subfolders
    • Generate a JSON structure where:
      • Keys are folder names
      • Values are arrays containing file names and subfolder objects
      • Subfolders are represented as objects within the parent folder's array

Example Output

For a repository with this structure:

STLs/
├── Frame/
│   ├── corner_bracket.stl
│   └── side_panel.stl
├── Electronics/
│   └── fan_mount.stl
└── hotend_mount.stl

The generated JSON would be:

{
  "STLs": [
    "hotend_mount.stl",
    {
      "Frame": [
        "corner_bracket.stl",
        "side_panel.stl"
      ]
    },
    {
      "Electronics": [
        "fan_mount.stl"
      ]
    }
  ]
}

Installation & Usage

Prerequisites

  • Python 3 (for local development server) or any HTTP server
  • Modern web browser with JavaScript enabled

Setup

  1. Clone or download this repository

  2. Start a local HTTP server:

    # Option 1: Using Python (recommended)
    python3 -m http.server 3000
    
    # Option 2: Using npm script
    npm start
    
    # Option 3: Use any other HTTP server of your choice
  3. Open your browser and navigate to http://localhost:3000

How It Works

  • Client-side only: No backend server required
  • Direct GitHub API: Calls GitHub's public API directly from the browser
  • CORS-friendly: GitHub API supports cross-origin requests for public repositories
  • No authentication needed: Works with public repositories without API keys

Technical Details

Dependencies

  • None: Pure client-side JavaScript with no external dependencies
  • Fetch API: Built-in browser API for HTTP requests to GitHub
  • GitHub API: Direct integration using public endpoints

GitHub API Integration

  • Uses GitHub's public API (no authentication required for public repos)
  • Direct browser-to-GitHub communication (CORS enabled)
  • Handles rate limiting and error responses
  • Supports repositories with complex folder structures

Search Strategy

  1. First searches for STL folders in the repository root
  2. If none found, searches one level deep in subdirectories
  3. Recursively processes found STL folders to build the complete structure
  4. Filters for .stl files and STL-related folder names

Error Handling

The application handles various error scenarios:

  • Invalid GitHub URLs
  • Repository not found (404)
  • API rate limiting (403)
  • Network connectivity issues
  • Empty repositories or no STL files found

License

MIT License - feel free to use this project for your own 3D printing needs!

Contributing

Contributions are welcome! Feel free to submit issues, feature requests, or pull requests.


Built for the 3D printing community 🖨️

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages