How ente-io/ente works
This monorepo is a complex, multi-product, multi-platform open source ecosystem that delivers a fully end‐to‐end encrypted cloud platform. Its purpose is to support applications like Ente Photos (a cloud photo storage solution that emphasizes privacy, replication, and features like face detection and semantic search) and Ente Auth (an encrypted two‐factor authenticator), along with several other client apps (mobile for iOS/Android/F‑Droid, desktop, web, CLI, etc.) and a backend server that drives all the products.
Main components
● Client/Frontends:
– Mobile apps (Android, iOS, F-Droid, etc.)
– Web applications (Ente Auth, Ente Photos web app, and related packages)
– Desktop application (Electron-based)
– CLI (command-line tool)
– Other platform-specific clients (Linux, macOS, Windows)
● Backend/Server:
– Core server component written in Go (directory “server”) that exposes APIs, handles authentication, file operations, encryption, storage bonus, push notifications, etc.
– API endpoints and controllers that manage modules (authenticator, file data, collection, encryption, billing, family, etc.)
● Shared Modules/Library/Packages:
– Common libraries and packages extracted in “packages” and “lib” directories for shared cryptography, UI components, network utilities, and domain models.
● Infrastructure:
– Infrastructure scripts and configurations in “infra” (for deployments, mail templates, ML, CDN, and external integrations such as Wasabi, listmonk, and other cloud services)
– CI/CD workflows (in .github/workflows) that automate builds, releases, and deployments.
● Documentation and Community:
– Documentation (“docs”), architecture details (“architecture”), and supporting material like readme, supporting guides, and community resources.
Relationships and Interactions
● Client apps (mobile, web, desktop, CLI) communicate with the backend server via RESTful or similar APIs. Illustrate directional data flows where users make requests (e.g., sign in, upload photos, manage authentication codes) that go to the server.
● The server handles core business logic such as end-to-end encryption, file storage, processing (e.g., ML for photos, face detection, semantic search), user sessions, and push notifications. It uses microservice-style segregation in its code (with separate packages/controllers for authenticator, billing, file management, etc.).
● Shared libraries and packages provide cross-cutting functionality (crypto implementations, internationalization, UI libraries, error handling) that are consumed by both client apps and possibly by the server.
● Infrastructure components support deployment (Dockerfiles, Kubernetes/compose files, migration scripts) and integrate with external systems (storage backends, CDN services, mail services).
Architectural Patterns and Design Principles
● Modular Monorepo: Although all components live in one repository, they are organized into distinct directories for mobile, web, server, CLI, etc. This separation reflects both ownership and clear boundaries between the different layers.
● Multi-Tier Architecture: The architecture spans presentation (client apps), business logic (server controllers, API endpoints), data access/storage (databases, file systems, remote storage services, backups), and cross-cutting concerns (encryption, error reporting, logging).
● End-to-End Encryption: Backbone design principle – ensure that data encryption, decryption, and cryptographic key management are clearly encapsulated as shared services both on the client side (using shared crypto libraries) and on the server side.
● Microservices-like internal organization: The server codebase itself is divided into controllers, repo (data access), middleware (authentication, rate limiting, logging), and external integrations with dedicated packages for handling services such as push notifications and share functions.