Core Functionality

Motivation:

Anthias is designed to provide a powerful and flexible digital signage solution. The core functionality of Anthias is built around a few key components:

  • WebSocket (anthias-websocket): The WebSocket component is responsible for forwarding requests from NGINX to the Anthias backend. This component allows for real-time communication between the front-end and back-end, enabling features like live updates and dynamic content. [Source: docs/developer-documentation.md]
  • Redis (redis): Anthias leverages Redis as a database, cache, and message broker. This enables efficient data storage, retrieval, and communication within the system. [Source: docs/developer-documentation.md]
  • Database: Anthias uses SQLite for storing information about assets. This database allows for the management of media files and other content used in the digital signage displays. [Source: docs/developer-documentation.md]

Core Functionality Components and Interplay:

  1. Asset Management: Anthias provides a robust asset management system, allowing for the storage and organization of digital signage content. This involves:

    • Uploading Assets: Users can upload various types of assets like images, videos, and HTML content.
    • Database Storage: The assets are stored in the SQLite database.
    • Asset Metadata: Metadata for each asset is also stored in the database, such as file type, dimensions, and upload date.
  2. Playlist Management: Playlists are used to control the order and timing of assets displayed on the digital signage displays.

    • Creating Playlists: Users can create and manage playlists through the Anthias interface.
    • Scheduling Assets: Assets are scheduled within playlists, defining the sequence and duration of their display.
    • Database Storage: Playlist details and asset scheduling information are stored in the SQLite database.
  3. Content Delivery: Once assets are organized into playlists, the content is delivered to the digital signage displays:

    • Asset Retrieval: The Anthias backend retrieves assets from the SQLite database.
    • Redis Caching: The assets are cached in Redis for fast retrieval.
    • WebSocket Communication: The WebSocket component forwards asset data to the NGINX server, which then delivers it to the displays.
    • Dynamic Content Updates: Changes in the playlist or asset scheduling are propagated through Redis and the WebSocket connection, ensuring real-time updates on the displays.

Example Scenarios:

  1. New Asset Upload: When a user uploads a new image, the following steps occur:

    • Upload: The image file is uploaded to the server.
    • Database Storage: The image file and associated metadata (filename, type, dimensions) are stored in the SQLite database.
    • Asset ID Generation: A unique asset ID is assigned to the image.
  2. Playlist Creation: When a user creates a new playlist:

    • Playlist Definition: The user defines the name, scheduling rules (e.g., start time, duration), and assets to be included.
    • Database Storage: The playlist information is stored in the SQLite database.
  3. Content Display: When a digital signage display connects to the system:

    • Playlist Retrieval: The display requests the active playlist from the Anthias backend.
    • Asset Selection: The backend selects the next asset to display based on the playlist’s schedule.
    • Asset Delivery: The asset data is retrieved from the database or Redis cache and sent to the display via the WebSocket connection.

Key Benefits of this Architecture:

  • Flexibility: The modular design allows for easy adaptation to different needs and configurations.
  • Scalability: The use of Redis and the WebSocket component enables handling a large number of displays and assets efficiently.
  • Real-Time Updates: The WebSocket communication ensures that changes to playlists and assets are reflected on the displays instantly.
  • Data Persistence: The SQLite database provides persistent storage for asset and playlist information.
  • Efficient Content Delivery: The caching mechanism in Redis speeds up asset retrieval.

This outline provides a foundational understanding of the core functionality within Anthias and how it interacts to provide digital signage capabilities. Further details can be found in the source code and documentation of each component.

Top-Level Directory Explanations

.github/ - This directory contains GitHub-specific configuration files and workflows for the project.

.github/workflows/ - This directory contains YAML files defining continuous integration and deployment workflows for GitHub Actions.

ansible/ - Ansible is an open-source configuration management and automation tool. This directory contains Ansible playbooks and roles for managing and configuring the project.

ansible/roles/ - This directory contains Ansible roles, which are reusable collections of tasks and configurations for managing specific aspects of a system.

ansible/roles/network/ - This role manages network configurations.

ansible/roles/screenly/ - This role is specific to the Screenly project and likely contains configurations and tasks related to it.

ansible/roles/splashscreen/ - This role manages the configuration of a splash screen.

ansible/roles/system/ - This role manages system-level configurations.

anthias_app/ - This directory contains the main application codebase for the project, likely written in Django.

anthias_app/migrations/ - This directory contains database migration files for the Django application.

anthias_django/ - This directory may contain additional Django-specific configuration files and code.

api/ - This directory contains the API codebase for the project.

api/serializers/ - This directory contains Django REST Framework serializers for converting data between Python objects and JSON.

api/views/ - This directory contains Django views for handling HTTP requests and rendering responses.

bin/ - This directory contains executable scripts for the project.

lib/ - This directory contains reusable Python modules and libraries for the project.

static/ - This directory contains static files, such as images, CSS, and JavaScript, that are served directly to the user by the web server.

static/fontawesome/ - This directory contains Font Awesome icons and styles.

static/fontawesome/css/ - This directory contains Font Awesome CSS files.

static/js/ - This directory contains JavaScript files.

static/spec/ - This directory contains test files for the static files.

static/spec/jasmine/ - This directory contains Jasmine test files.

templates/ - This directory contains HTML templates used to render dynamic content.

tests/ - This directory contains test files for the project.

tools/ - This directory contains tools and scripts used to develop and maintain the project.

tools/image_builder/ - This tool likely builds and optimizes images for the project.

website/ - This directory contains the website codebase.

website/assets/ - This directory contains website assets, such as images, CSS, and JavaScript.

website/assets/styles/ - This directory contains website styles.

website/bin/ - This directory contains website executable scripts.

webview/ - This directory likely contains configuration files and code for a webview component.

webview/src/ - This directory contains webview source code.