LDOC Viewer Frontend

This directory contains the frontend implementation for the LDOC Viewer application.

Overview

The frontend provides a user interface for:

  1. Uploading LDOC files
  2. Viewing the contents of LDOC containers
  3. Extracting files from LDOC containers
  4. Creating new LDOC containers

Core Components

Main Interface

The main interface is divided into two columns:

  • Left Column: Upload and Create sections

    • Upload LDOC files
    • Create new LDOC containers by uploading files
  • Right Column: Viewer and Info panels

    • File browser for navigating LDOC contents
    • File viewer for displaying file contents
    • Info panel for displaying LDOC metadata

File Viewer

The file viewer supports:

  • Text Files: Displayed with syntax highlighting using Prism.js
  • Images: Displayed in an image viewer
  • Binary Files: Displayed as metadata with download option

File Upload

The application supports two types of file uploads:

  1. LDOC Upload: For uploading LDOC containers to view or extract
  2. File Upload: For uploading files to create a new LDOC container

Both upload areas support drag-and-drop and file browsing.

Technologies Used

  • Tailwind CSS: For styling the interface
  • Prism.js: For syntax highlighting of code files
  • JSZip: For handling ZIP files when extracting LDOC contents

JavaScript Features

The frontend JavaScript handles:

  • File uploads via drag-and-drop and file input
  • API requests to the backend
  • Rendering the file tree and file contents
  • Downloading extracted files and created LDOC containers