How colloqi/pisignage-server works
Project Purpose and Type
• This is a full-stack server application designed to manage and update piSignage players on a LAN or private network. The server handles player management, group and asset administration, playlist management, and even media conversion. It also includes both server-side processing (Node.js backend) and client-side functionality (AngularJS-based front-end).
Main Components
a. Backend Server (Node.js Application):
• The “server.js” file is the entry point.
• The “app” directory implements the MVC (or similar) pattern:
• Controllers (in app/controllers) handle the business logic for assets, players, groups, Google Calendar integration (gcal.js), licensing, and more.
• Models (in app/models) represent data entities such as players, assets, groups, labels, settings.
• Helpers and utilities in app/others.
• Views for error pages and layout templates (in app/views) used to render server responses.
• Configuration files (in config and its env subdirectories) define environment-specific settings, routes, and express middleware.
b. Frontend Client (AngularJS Application):
• The “public” folder contains the web application:
• Angular controllers, services, directives, filters (located in public/app/js).
• Static assets such as CSS, fonts, images, partials (HTML/Pug templates) that render the UI.
• This layer interacts with the backend via REST endpoints.
c. Data Management and External Services:
• MongoDB is used as the database, as indicated by README instructions and configuration details.
• External media processing tools (ffmpeg, ffprobe, and ImageMagick) are integrally mentioned for video conversion and thumbnail generation.
d. Infrastructure and Deployment:
• Docker integration is evident with a Dockerfile, .dockerignore, and docker-compose (both for development and production).
• There are additional scripts for installing dependencies on various OS platforms (in the “scripts” folder).
• GitHub CI/CD (GitHub workflows and Docker build instructions) are in the .github folder.
Relationships and Data Flow
• The backend controllers handle requests (e.g., for assets upload, player management, group assignments) and interact with models to update MongoDB.
• The asset workflow involves media uploads, after which the server triggers external processing (ffmpeg for video conversion and ImageMagick for thumbnails). Indicate data flows from incoming media to external processing services and back to persistent storage.
• Players connect to the server for configuration and software updates; include communication between the piSignage players (client devices) and the server.
• Docker components encapsulate the server (and possibly MongoDB) in containers, which should be represented as a containerization layer.
Architectural Patterns and Design Principles
• Separation of concerns (frontend vs. backend, and clear MVC separation within the server code).
• Use of RESTful interfaces for communication between the frontend and backend.
• Modular design: individual controllers and models for different functions (assets, player management, playlists, etc.) and the extensible Docker/CI configuration for deployment.
• The design also supports scalability via Docker volumes for media and data directories.