How nyaruka/rapidpro works
Main Components
• Frontend/Web Layer: Represented by the templates, static assets, and all client-side code (JS, CSS, fonts, images). This is where users interact via browsers or mobile devices.
• Application Server/Backend: The core of RapidPro lives in the “temba” directory and its many submodules (ai, airtime, api, channels, flows, contacts, campaigns, tickets, etc.). This is your Django-based server following the MVT (Model-View-Template) pattern, handling business logic, API endpoints (e.g., temba/api and temba/api/v2), scheduling, and more.
• Database & Data Stores: The README explicitly lists PostgreSQL (the primary relational database); Redis (for caching and task queues); Elasticsearch (for searching and indexing); S3 (object storage for media); DynamoDB (for NoSQL-like operations); and Cloudwatch (for monitoring/logging).
• External Components/Services: The architecture supports related services developed by TextIt such as Mailroom, Courier, Indexer, and Archiver. These can be shown as connected microservices or separate application components that integrate with the core system.
Detail the Relationships and Interactions
• For search and indexing features, the Application Server sends events/queries to Elasticsearch.
• Integrations with S3 (for storing media, uploads, etc.) and with DynamoDB if applicable for specific data access patterns.
• External services (Mailroom, Courier, Indexer, Archiver) should be shown as connected to the core application – either consuming data (like outbound messaging or archiving flows) or providing supplementary services. Represent them with separate labels and note that they may interact with other systems or share similar storage backends.
• Optionally, include Cloudwatch as a monitoring/observability layer that gathers logs and system metrics from the Application Server and related services.
Architectural Patterns and Design Principles
• Separation between presentation (templates/static), business logic (temba modules), and data persistence (databases and storages) which is inherent in the MVT pattern.
• Integration points with external messaging channels and third-party APIs, especially in the “channels” and “api” modules.
Final Touches
• Balance detail and clarity so that all major architectural elements and data flows are captured without overwhelming the viewer.