Database & Infrastructure
Spinning up the data layer (Mongo, Redis, Milvus, RustFS, Docling) and understanding storage topology.
Before you run the Iqra AI applications, you must have the Data Layer running. This layer holds all state, vector embeddings, binary files, and document processing capabilities.
The Stack
| Service | Default Port | Usage |
|---|---|---|
| MongoDB | 27017 | Persistent storage for users, businesses, and logs. |
| Redis | 6379 | Real-time concurrency tracking, audio buffering, and queues. |
| Milvus | 19530 | Vector database for RAG Knowledge Base. |
| RustFS / S3 | 9000 | S3-compatible object storage for recordings and assets. |
| Docling | 8000 | AI Document Parser (PDF/Docx -> Markdown) for RAG ingestion. |
Setup Guide
We maintain up-to-date Docker configurations in our GitHub repository.
Download Configuration
Clone the repository and navigate to the docker folder.
git clone https://github.com/abdofallah/IqraAI.git
cd IqraAI/docker/dependenciesConfigure Environment
- Copy the example env file:
cp .env.example .env - Security Warning: Change the default
MONGO_PASSWORDandRUSTFS_SECRET_KEYimmediately.
Start Infrastructure
docker-compose up -dTip: The first run involves downloading large images for Milvus and Docling. Please be patient.
Regional Storage Strategy (Advanced)
For a single-node setup, one S3/RustFS container is sufficient. However, for Production Multi-Region deployments, Iqra AI supports a distributed storage architecture to minimize audio latency.
The Architecture: Write Local, Replicate Async
When an agent in US-East generates a TTS audio file, we shouldn't fetch it from EU-Central every time.
How it works
- Configuration: You define a specific S3 Bucket/Connection for each Region in the Admin Dashboard.
- Write: The Backend always writes to its Local Region storage. It tags the file metadata with
OriginRegion: us-east. - Replication: You configure your storage provider (AWS S3, MinIO, or RustFS Cluster) to replicate data across buckets in the background.
- Read: When retrieving a file (e.g., Audio Cache):
- Attempt 1: Try the Local Region storage (Fastest).
- Attempt 2: If missing (replication lag), fallback to the Origin Region storage (Slower, but guarantees availability).
Connection Strings Reference
You will need these values for the Application Configuration.
- Host: If apps run in Docker on the same network -> Use Service Name (e.g.,
mongodb). - Host: If apps run Native -> Use
localhostor Docker Host IP.
| Service | Connection String Template |
|---|---|
| MongoDB | mongodb://<user>:<pass>@localhost:27017 |
| Redis | localhost:6379,password=<pass> |
| Milvus | Host: localhost, Port: 19530 |
| Docling | http://localhost:8000 |
| Storage | Configured dynamically per region in Admin Dashboard. |