ScrollHub Documentation

Overview

ScrollHub is a web server application that provides git-based folder hosting with real-time collaboration features. It's built with Express.js and provides functionality for file management, version control, and live updates.

Core Features

Main Components

Server Initialization

```javascript

class ScrollHub {

}

```

Security Features

Write Permission Control

File Extension Security

Core Routes

File Management

Git Integration

Real-time Features

Usage Examples

Creating a New Folder

```javascript

const response = await fetch('/create.htm', {

});

```

Writing a File

```javascript

const response = await fetch('/write.htm', {

});

```

Subscribing to Real-time Updates

```javascript

const evtSource = new EventSource('/requests.htm?folderName=my-project');

evtSource.onmessage = (event) => {

};

```

Configuration

Environment Setup

Required directories:

Security Configuration

```javascript

{

}

```

Error Handling

The server implements comprehensive error handling:

Example error response:

```javascript

{

}

```

Folder Structure

```

root/

โ”œโ”€โ”€ folders/ # User folders

โ”‚ โ”œโ”€โ”€ project1/

โ”‚ โ””โ”€โ”€ project2/

โ”œโ”€โ”€ templates/ # Folder templates

โ”‚ โ”œโ”€โ”€ blank_template/

โ”‚ โ””โ”€โ”€ other_templates/

โ””โ”€โ”€ trash/ # Deleted folders

```

Best Practices

  1. *Folder Names*
  2. - Must start with a lowercase letter

  1. *File Management*
  2. - Use appropriate file extensions

  1. *Security*
  2. - Implement proper authentication if needed

Technical Notes

  1. *Certificate Management*
  2. - Automatic certificate generation for HTTPS

  1. *Performance Considerations*
  2. - File operations are asynchronous

  1. *Monitoring*
  2. - Request logging

Limitations

  1. File size limited to 100MB
  2. Rate limited to 30 writes per minute per IP
  3. Limited to specific file extensions
  4. No built-in user authentication system

Troubleshooting

Common issues and solutions:

  1. *Rate Limiting*
  2. - Issue: "Your IP has been temporarily throttled"

  1. *Invalid File Types*
  2. - Issue: "Editing 'xyz' files not yet supported"

  1. *Certificate Errors*
  2. - Issue: SSL certificate errors

  1. *Git Errors*
  2. - Issue: Git operation failures

Contributing

When contributing to ScrollHub:

  1. Follow the existing code style
  2. Add tests for new features
  3. Update documentation
  4. Handle errors appropriately
  5. Consider backward compatibility

Dependencies

Major dependencies:

Public Domain

ScrollHub is open source, public domain software.

Built with Scroll v146.1.0