NexGate Platfom (Entry)


Social Commerce Platform (Intro)

Nexgate is a unified social commerce platform that combines eCommerce, event management, and social networking into a single ecosystem. Built for the East African market, Nexgate enables users to buy, sell, connect, and experience — all in one place.


The Concept

Nexgate reimagines how commerce happens online. Instead of separating shopping, events, and social media into different apps, Nexgate brings them together.

User creates → Product or Event → Posts to Social → Followers see in feed → Purchase or Book

A product isn't just listed in a shop — it's shared, liked, and commented on. An event isn't just a ticket page — it's a post that spreads organically through your network.


Platform Architecture

Nexgate follows a microservices architecture with nine independent services communicating via RabbitMQ message broker and backed by PostgreSQL databases.

Core Services

  1. Authentication — User registration, login, JWT tokens, OAuth, device management
  2. User Profile — Profiles, followers/following, privacy settings, trust scores
  3. File Manager — Media uploads, image processing, BlurHash, video transcoding via FFmpeg
  4. Payment — Payment methods, M-Pesa/Selcom/Tembo Plus integration, escrow, transactions
  5. Direct Message — Real-time private messaging, conversations, media sharing

Business Services

  1. E-Commerce — Shops, products, orders, cart, checkout, reviews, seller verification
  2. E-Events — Event creation, ticketing, RSA-signed tickets, check-ins, organizer ratings
  3. E-Social — Posts, feeds, likes, comments, reposts, polls, mentions, hashtags

External Service

  1. Notification — Push notifications, in-app alerts, email, SMS (async via RabbitMQ)

Architecture Diagram

nexgate_arc_diagram.png


Service Relationships

Service Role Connects To
Authentication Identity, tokens, sessions Redis, PostgreSQL Core, RabbitMQ
User Profile Profiles, follows, trust scores PostgreSQL Core, RabbitMQ
File Manager Media uploads, processing FFmpeg, MinIO, PostgreSQL Core
Payment Transactions, escrow M-Pesa, Selcom, Tembo Plus, PostgreSQL Core, RabbitMQ
Direct Message Private conversations PostgreSQL Core, RabbitMQ
E-Commerce Shops, products, orders E-Social (embed products in posts), PostgreSQL Core, RabbitMQ
E-Events Events, tickets, check-ins E-Social (embed events in posts), PostgreSQL Core, RabbitMQ
E-Social Posts, feeds, interactions E-Commerce, E-Events (receives embeds), PostgreSQL Core, RabbitMQ
Notification Push, email, SMS RabbitMQ (consumes events), PostgreSQL Notif

Data Flow Summary

Flow Path
User creates product E-Commerce → Post to E-Social → Followers see in feed
User creates event E-Events → Post to E-Social → Followers see in feed
User uploads media File Manager → FFmpeg (if video) → MinIO → BlurHash generated
User makes payment Payment → External Provider (M-Pesa/Selcom/Tembo) → Callback → Update order
Any action triggers notification Service → RabbitMQ → Notification Service → Push/Email/SMS

Infrastructure Components

Component Purpose
PostgreSQL (Core) Shared DB for Auth, User, File, Payment, DM, E-Commerce, E-Events, E-Social
PostgreSQL (Notif) Separate DB for Notification service
Redis Session storage, caching, rate limiting
RabbitMQ Async messaging, triggers notifications
MinIO S3-compatible object storage for all media
FFmpeg Video transcoding, thumbnails, compression

Tech Stack

Layer Technology
Backend Java 21, Spring Boot 3.x
Database PostgreSQL (Core + Notification)
Cache Redis
Messaging RabbitMQ
Storage MinIO (S3-compatible)
Media Processing FFmpeg
Payments M-Pesa, Selcom, Tembo Plus
Security JWT, RSA signatures, device fingerprinting

Services Requrements

Core Services

1. Authentication Service

Handles all identity and access management for the platform.

What it does:

Key concepts:


2. User Profile Service

Manages user identity, relationships, and platform reputation.

What it does:

Key concepts:


3. File Manager Service

Central media handling for the entire platform.

What it does:

Key concepts:


4. Payment Service

Handles all money movement on the platform.

What it does:

Key concepts:


5. Direct Message Service

Private real-time communication between users.

What it does:

Key concepts:


Business Services

6. E-Commerce Service

Full marketplace functionality for buying and selling products.

What it does:

Purchase Options:

Type Description
Individual Buy single item, standard checkout
Quantity-based Buy multiple units, bulk pricing available
Group Buy Multiple buyers join to unlock discount, minimum participants required
Buy Together Friends pool money for shared purchase (gifts, shared items)
Installment Pay in scheduled parts, product released after full payment or based on seller terms

Key concepts:


7. E-Events Service

Complete event management from creation to check-in.

What it does:

Event Types:

Type Description
In-Person Physical location, requires venue details and check-in
Online Virtual event, streaming link provided to ticket holders
One-Time Single date/time event
Multi-Day Spans multiple days (festivals, conferences), each day can have separate check-in

Check-in System:

Method Use Case
Mobile App Scan Organizer uses Nexgate app to scan attendee QR
Ticket Scanner Machine Hardware scanner integration via API
Manual Entry Enter ticket code manually for backup
Self Check-in Kiosk Attendee scans own ticket at kiosk

Key concepts:


8. E-Social Service

The social layer that connects everything together.

What it does:

Post Types:

Type Description
Standard Text + optional media
Product Post Embedded product card, click to buy
Event Post Embedded event card, click to book
Poll Question with voting options, timed or open
Collaborative Multiple users co-author, shared credit
Repost Share another post with optional comment

Key concepts:


External Service

9. Notification Service

Async notification delivery across all channels.

What it does:

How it works:

Any Service → Event → RabbitMQ → Notification Service → Deliver

Notification service is fully decoupled. It only listens to RabbitMQ events and decides how to notify based on user preferences.

Notification Triggers:

Source Events
Auth Welcome, password reset, new device login, suspicious activity
User Profile New follower, follow request (private account), mention
Direct Message New message, message reaction
E-Commerce Order placed, order shipped, order delivered, payment received (seller), review received, group buy progress, installment reminder
E-Events Ticket purchased, event reminder, event cancelled, check-in confirmation, event starting soon
E-Social Like, comment, repost, mention (@user), shop mention ($shop), poll ended, collaborative post invite
Payment Payment successful, payment failed, escrow released, refund processed, payout sent

User Preferences:

Setting Options
Push All, important only, none
Email All, digest (daily/weekly), none
SMS Critical only (payments, security), none
Quiet hours Disable notifications during set hours
Per-type toggle Enable/disable specific notification types

Key concepts: