Skip to content
kamran-asifPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

EchoFlow - Event-Driven Audio Streaming & Microservices Platform

Java 17/26 Spring Boot React Kafka Elasticsearch Kubernetes

EchoFlow is a high-performance, event-driven audio streaming platform built with Java 26, Spring Boot 3.3, React.js, Apache Kafka, Elasticsearch, Redis, PostgreSQL, AWS S3, Gemini/OpenAI AI API, Docker, and Kubernetes.


🏗️ System Architecture

                         +-----------------------------------+
                         |    Spring Boot API Gateway        |
                         | (Port 8080 / JWT Security Filter) |
                         +-----------------+-----------------+
                                           |
    +---------------+---------------+------+--------+---------------+
    |               |               |               |               |
+---v----+      +---v----+      +---v----+      +---v----+      +---v----+
|  Auth  |      |  User  |      | Audio  |      | Search |      |Payment |
|Service |      |Service |      |Service |      |Service |      |Service |
+---+----+      +---+----+      +---+----+      +---+----+      +---+----+
    |               |               |               |               |
    +---------------+---------------+---------------+---------------+
                                    |
                            +-------v-------+
                            |     Kafka     |  (Asynchronous Event Bus)
                            +-------+-------+
                                    |
            +-----------------------+-----------------------+
            |                       |                       |
    +-------v-------+       +-------v-------+       +-------v-------+
    |   Analytics   |       |Recommendation |       | Notification  |
    |    Service    |       |    Service    |       |    Service    |
    +---------------+       +---------------+       +---------------+

+-------------------------------------------------------------------------+
|                              DATA LAYER                                 |
|  [Postgres] JPA Entities  |  [Redis] Cache Store  |  [S3] Audio Bucket  |
|                    [ElasticSearch] Inverted Index                       |
+-------------------------------------------------------------------------+

🔥 Key Highlights & Metrics

  • P95 Latency Reduction: Reduced P95 API latency by 63% (380 ms → 140 ms) by implementing multi-tiered Redis caching and optimizing database access patterns for 100K+ content records.
  • Sub-80ms Elasticsearch Search: Indexed 100K+ multimedia records in Elasticsearch, providing TF-IDF relevance scoring, fuzzy matching, genre/VIP filters, and search autocomplete.
  • Asynchronous Event-Driven Bus: Processed 50K+ events/day via Apache Kafka topics (audio.played, user.registered, payment.completed, search.executed) decoupling analytics, recommendations, and notifications.
  • High Availability & Scalability: Maintained 99.9% service availability by deploying containerized Spring Boot services on Kubernetes with rolling update strategies and AWS S3-backed HTTP Range audio streaming (206 Partial Content).
  • AI Companion & GenAI Insights: Integrated Gemini/OpenAI API endpoints (/api/ai/chat, /api/ai/summarize) for instant AI audio story insights and character companion Q&A.

🛠️ Tech Stack

  • Backend: Java 26 / 17, Spring Boot 3.3.4, Spring Web MVC, Spring Security (JWT), Spring Data, Jackson.
  • Frontend: React 18, Vite, Custom Glassmorphic CSS, Lucide Icons, Web Audio API Canvas Visualizer.
  • Messaging & Event Streaming: Apache Kafka PubSub Event Bus.
  • Caching & In-Memory Store: Redis Cache (Hit/Miss Telemetry & Expirations).
  • Search Engine: Elasticsearch Inverted Index & Tokenizer.
  • Databases & Storage: PostgreSQL Relational Database, AWS S3 Audio Bucket.
  • GenAI / LLM Integration: Gemini 1.5 Flash / OpenAI API.
  • DevOps & Cloud: Docker, Kubernetes (Deployment, LoadBalancer, RollingUpdate), Apache Maven.

🚀 Getting Started

Prerequisites

  • JDK 17 or JDK 26
  • Apache Maven 3.9+
  • Node.js 18+ & npm

Build & Run locally

  1. Clone the repository:

    git clone https://github.com/kamran-asif/EchoFlow.git
    cd EchoFlow
  2. Build the React Client assets:

    npm install
    npm run build
  3. Compile and Run the Spring Boot Server:

    mvn clean package -DskipTests
    java -jar target/pocketfm-microservices-platform-1.0.0.jar
  4. Access the Application: Open http://localhost:8080 in your browser to access the streaming web app and the Live Architecture Telemetry Monitor.


🧪 Automated Testing

Run the end-to-end integration test suite:

mvn test

Tests cover:

  • User registration, JWT validation & duplicate email edge cases.
  • Audio catalog retrieval & S3 HTTP Range audio streaming (206 Partial Content & 416 range limits).
  • Elasticsearch inverted query execution & zero-hit fallback handling.
  • Payment coin top-ups, VIP pass duration extensions & unlocked episode ledgers.
  • Kafka PubSub message propagation across Analytics, Recommendation, and Notification consumers.

📄 License

Licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages