Skip to content

Artifact-Virtual/PHANTOMui

Repository files navigation

Phantom Desktop UI

Angular Tailwind CSS Python License

πŸ“Έ Screenshots

Phantom Desktop UI Dashboard

Modern dashboard showcasing system stats, key features, API endpoints, and technology stack

πŸš€ Overview

Phantom Desktop UI is a cutting-edge application that bridges the gap between Large Language Models (LLMs)β€”such as OpenAI, Ollama, and othersβ€”and your desktop environment. By enabling LLMs to interact with your desktop, this tool unlocks unparalleled productivity, automation, and collaboration opportunities.

✨ Key Features

  • Universal LLM Integration: Seamlessly connects with any LLM (OpenAI, Ollama, etc.) to expose desktop capabilities.
  • Secure Desktop Control: Empowers LLMs to interact with files, applications, and system resources while maintaining robust security protocols.
  • Multi-LLM Collaboration: Supports simultaneous connections of multiple LLMs to a single desktop session for enhanced collaborative workflows.
  • Real-Time Interaction: Facilitates seamless human-AI collaboration by allowing users to log into desktop sessions and work alongside LLMs.
  • Modern and Responsive UI: Built with Angular 15 and Tailwind CSS to deliver a sleek, intuitive, and responsive user experience.
  • Python FastAPI Backend: Ensures efficient communication between the UI and desktop environment, enabling smooth integration with LLMs.

πŸ› οΈ Technology Stack

Frontend

  • Angular 15 - Modern web framework
  • Angular Material - UI component library
  • Tailwind CSS - Utility-first CSS framework
  • TypeScript - Type-safe JavaScript
  • RxJS - Reactive programming

Backend

  • Python 3.9+ - Programming language
  • FastAPI - Modern, fast web framework
  • Uvicorn - ASGI server
  • Pydantic - Data validation

πŸ“ Project Structure

phantom-desktop-ui/
β”œβ”€β”€ src/                        # Frontend source code
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ components/        # Angular components
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/    # Dashboard component
β”‚   β”‚   β”‚   β”œβ”€β”€ file-manager/ # File management component
β”‚   β”‚   β”‚   β”œβ”€β”€ header/       # Navigation header
β”‚   β”‚   β”‚   β”œβ”€β”€ login/        # Authentication component
β”‚   β”‚   β”‚   └── settings/     # Settings component
β”‚   β”‚   β”œβ”€β”€ services/         # Angular services
β”‚   β”‚   β”‚   β”œβ”€β”€ api.service.ts      # API communication
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.service.ts     # Authentication
β”‚   β”‚   β”‚   └── theme.service.ts    # Theme management
β”‚   β”‚   β”œβ”€β”€ app.module.ts           # Main Angular module
β”‚   β”‚   └── app-routing.module.ts   # Routing configuration
β”‚   β”œβ”€β”€ assets/               # Static assets
β”‚   β”œβ”€β”€ styles.css           # Global styles
β”‚   └── index.html           # HTML entry point
β”œβ”€β”€ desktop_api.py           # Python FastAPI backend
β”œβ”€β”€ test_api.py             # Backend tests
β”œβ”€β”€ angular.json            # Angular configuration
β”œβ”€β”€ package.json            # Node dependencies
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ tsconfig.json          # TypeScript configuration
β”œβ”€β”€ tailwind.config.js     # Tailwind configuration
β”œβ”€β”€ Dockerfile             # Frontend Docker image
β”œβ”€β”€ Dockerfile.backend     # Backend Docker image
└── docker-compose.yml     # Docker Compose configuration

🚦 Getting Started

Prerequisites

  • Node.js 16+ and npm
  • Python 3.9+
  • Angular CLI (install with npm install -g @angular/cli)

Installation

  1. Clone the repository

    git clone https://github.com/Artifact-Virtual/PHANTOMui.git
    cd PHANTOMui
  2. Install Frontend Dependencies

    npm install
  3. Install Backend Dependencies

    pip install -r requirements.txt

Running the Application

Option 1: Run Both Services Separately

  1. Start the Backend Server

    python3 desktop_api.py

    The API will be available at http://localhost:8000 API Documentation: http://localhost:8000/docs

  2. Start the Frontend Development Server

    ng serve

    The application will be available at http://localhost:4200

Option 2: Using Docker Compose

docker-compose up

This will start both frontend and backend services.

Default Credentials

For testing purposes, use these default credentials:

  • Username: admin or user
  • Password: password

⚠️ Note: Change these credentials in production environments!

πŸ“š API Documentation

The backend provides a comprehensive REST API with the following endpoints:

Desktop Operations

  • GET /desktop/list - List all files on desktop
  • GET /desktop/file?path={path} - Download a file
  • POST /desktop/upload - Upload a file
  • DELETE /desktop/delete?path={path} - Delete a file
  • GET /desktop/search?query={query} - Search for files
  • GET /desktop/preview?path={path} - Preview file contents
  • POST /desktop/zip?path={path} - Create ZIP archive
  • POST /desktop/unzip?path={path} - Extract ZIP archive
  • POST /desktop/set-wallpaper?path={path} - Set desktop wallpaper

System Information

  • GET /admin/system-info - Get system information
  • GET /health - Health check endpoint

LLM Integration

  • GET /llm/describe-path?path={path} - Describe a file/directory for LLM

Tools

  • POST /tools/add?a={number}&b={number} - Example addition tool

πŸ§ͺ Testing

Backend Tests

Run the Python backend tests:

python3 test_api.py

Or using pytest:

pytest test_api.py -v

Frontend Tests

Run Angular tests:

ng test

πŸ”’ Security Features

  • Path Traversal Prevention: All file operations are restricted to the Desktop directory
  • File Type Validation: Executable files (.exe, .sh, .bat, etc.) are blocked
  • CORS Configuration: Controlled cross-origin resource sharing
  • Input Sanitization: All inputs are validated and sanitized
  • Secure Error Handling: Detailed errors logged, generic messages to clients

🎨 Features Showcase

Dashboard

  • Real-time system information
  • Quick statistics (files, uploads, connections)
  • Quick action buttons
  • Responsive card-based layout

File Manager

  • File upload/download
  • File deletion with confirmation
  • Search functionality
  • Preview support for text files
  • Clean table-based interface

Settings

  • Dark/Light theme toggle
  • API configuration
  • User preferences
  • About information

Responsive Design

  • Mobile-friendly interface
  • Adaptive layouts
  • Touch-optimized controls

πŸ”§ Configuration

Backend Configuration

Edit desktop_api.py to configure:

  • BASE_DIR - Base directory for file operations (default: Desktop)
  • ALLOWED_EXTENSIONS - Allowed file types
  • MAX_FILE_SIZE - Maximum upload size

Frontend Configuration

Edit src/app/services/api.service.ts to configure:

πŸ“¦ Building for Production

Frontend

ng build --configuration production

The build artifacts will be stored in the dist/ directory.

Backend

The backend can be run directly or containerized using the provided Dockerfile.

🐳 Docker Deployment

Build and Run with Docker Compose

docker-compose up --build

Individual Container Build

# Frontend
docker build -t phantom-ui .

# Backend
docker build -f Dockerfile.backend -t phantom-api .

🀝 Contributing

We welcome contributions from the community! Please see our Contributing Guidelines for detailed instructions.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

Phantom Desktop UI is open-source software licensed under the MIT License.

πŸ™ Acknowledgments

  • Angular Team for the excellent framework
  • FastAPI for the modern Python web framework
  • Tailwind CSS for the utility-first CSS framework
  • Material Design for the component library

πŸ“ž Support

For issues, questions, or suggestions:

  • Create an issue on GitHub
  • Contact the development team

Phantom Desktop UI - Redefining desktop interaction by enabling seamless collaboration between humans and AI, paving the way for innovative workflows and enhanced productivity.

🎯 Roadmap

  • Add authentication with JWT tokens
  • Implement WebSocket for real-time updates
  • Add support for multiple desktop sessions
  • Enhance LLM integration capabilities
  • Add file preview for images and PDFs
  • Implement drag-and-drop file upload
  • Add internationalization (i18n)
  • Create mobile application
  • Add plugin system for extensions

πŸ“Š System Requirements

Minimum Requirements

  • OS: Windows 10/11, macOS 10.15+, Ubuntu 20.04+
  • RAM: 4GB
  • CPU: Dual-core processor
  • Disk Space: 500MB

Recommended Requirements

  • OS: Windows 11, macOS 12+, Ubuntu 22.04+
  • RAM: 8GB+
  • CPU: Quad-core processor
  • Disk Space: 1GB

About

Universal Language Model (ULM) Desktop Driver

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors