How onlyoffice/server works
• Common Library/Shared Module:
– Represented by the “Common” directory.
– Contains shared configuration files, core utilities (logger, license handling, notification, RabbitMQ and ActiveMQ cores, storage interfaces, etc.).
• Document Service (DocService):
– This is the primary module that exposes document-related endpoints.
– Contains the server, routes, database connectors for different RDBMS (MySQL, PostgreSQL, Oracle, MS SQL, Dameng).
– Handles interactions with various services (e.g., WOPI for integration) and connects to external storage or messaging.
• File Converter:
– The “FileConverter” component includes logic for file and document conversion.
– Acts as a service that receives conversion requests and outputs converted files.
• Spell Checker:
– This module, found in “SpellChecker,” handles language and spellchecking services.
• Metrics Service:
– Found in “Metrics,” it collects and reports on performance and usage data.
• Ancillary Services and Third-Party Integrations:
– Messaging via RabbitMQ – both used in Common and DocService as well as explicitly existing in the source files of modules.
– Database(s) – MySQL or PostgreSQL for persistent storage; the schema directory highlights multiple database vendor sets of scripts.
– External Dependencies:
· Redis for caching.
· Other required components (Java for SDK build, Python for spellchecker modules build, etc).
Relationships and Interactions
• The DocService is the central orchestration layer that interacts with:
– The Common module for reusable functions and configuration.
– The various database connectors to perform CRUD operations based on client requests.
– RabbitMQ and, possibly, the ActiveMQ core from Common for asynchronous messaging and task queuing.
• FileConverter, SpellChecker, and Metrics operate as independent services or microservices.
– They may communicate with DocService via internal APIs or message queues.
– They might also access the Common module’s utilities where applicable.
• The system’s configuration is determined by several JSON files located in Common/config (for different OS and environment setups).
Architectural Patterns and Design Principles
• Modularity: The project is clearly split by functionality (document service, file conversion, spell checking, metrics) with a shared common library.
• Microservices/Multi-module Architectural Style: While they might run on the same machine, there is clear separation of concerns.
• Use of Dependency Injection and Reusable Libraries: The “Common” folder encapsulates shared logic and configurations used across modules.
• Database Abstraction: Each database connector is encapsulated within its own file inside “DocService/sources/databaseConnectors”, which makes it easy to support multiple relational databases.
Relevant Technologies, Frameworks, and Libraries
• Node.js (as the runtime environment).
• RabbitMQ and ActiveMQ (messaging and task queues).
• Various database technologies (MySQL, PostgreSQL, Oracle, SQL Server, Dameng).
• Redis (for caching).
• External tools like Java, Python, and Erlang as mentioned in the README.
• Testing frameworks (unit, integration, performance tests under “tests”).