Skip to content

smangukia/CommuneDrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Commune Drop Ride Sharing Platform

Terraform Kubernetes AWS Google Cloud Badge Apache Kafka Amazon EKS Badge Supabase Badge Stripe Badge .NET Badge React Badge Node.js Badge Tailwind CSS Badge Redis Badge MongoDB TypeScript Express Socket.IO

Demo

CommuneDrop-SR.1.mp4

Overview

CommuneDrop is a comprehensive delivery tracking platform built with a modern microservice architecture. The platform enables real-time delivery tracking, secure payment processing, and efficient order management through a set of specialized microservices deployed on AWS EKS.

System Architecture

Screenshot 2025-04-22 at 11 03 15β€―PM

CommuneDrop is built on a robust microservice architecture with the following components:

Microservices

Service Technology Stack Purpose
AuthService .NET, Duende Identity Server, MongoDB Authentication and authorization for all microservices
Frontend Service React, Vite, TailwindCSS, Socket.IO User interface and service coordination
LiveLocationService Node.js, Socket.IO, Kafka, MongoDB Real-time driver location tracking
LocationService Node.js, Express, AWS Location, Redis Geocoding and route calculation
OrderService Node.js, TypeScript, Express, MongoDB, Kafka Order management and status tracking
PaymentService Node.js, TypeScript, Express, MongoDB, Stripe Payment processing and refund management

Communication Flow

  1. Authentication: All services authenticate through AuthService using OAuth2/OpenID Connect
  2. Order Creation: Users create orders through the Frontend, which are processed by OrderService
  3. Payment Processing: PaymentService handles secure payment transactions via Stripe
  4. Location Tracking: LiveLocationService provides real-time driver location updates via Kafka and WebSockets
  5. Route Calculation: LocationService calculates optimal routes and delivery estimates

AuthService

A .NET-based authentication service built as a Duende Identity Server for microservice authorization.

Key Features:

  • User Authentication & Authorization
  • JWT-Based Authentication
  • OAuth2 & OpenID Connect Support
  • Scope-Based Access Control
  • Secure Password Hashing

Frontend Service

React-based user interface that coordinates communication between all microservices.

Key Features:

  • Real-time delivery tracking on maps
  • Live notifications for order updates
  • Secure payment processing
  • Order history and delivery estimates
  • Service-to-Service Authentication with OAuth tokens

LiveLocationService

Provides real-time location tracking between drivers and customers.

Key Features:

  • Real-time Driver Location Tracking via WebSockets
  • Order Notification System
  • Bi-directional Communication
  • Event-Driven Architecture with Kafka
  • Geospatial queries for nearby driver discovery

LocationService

Provides geocoding, route calculation, and location-based services.

Key Features:

  • Address Geocoding
  • Route Calculation with AWS Location Services
  • Detailed Route Information
  • Address Autocomplete
  • Efficient Redis Caching

OrderService

Manages delivery orders, status tracking, and payment processing.

Key Features:

  • Order Creation
  • Payment Processing
  • Order Status Management
  • Pricing Calculation
  • Event-Driven Architecture with Kafka

PaymentService

Handles all payment-related operations through Stripe integration.

Key Features:

  • Customer Management
  • Payment Method Handling
  • Payment Processing
  • Refund Management
  • Order Status Updates

Infrastructure as Code

The entire infrastructure is provisioned and managed using Terraform, enabling consistent, version-controlled deployment across environments.

AWS EKS Cluster

The platform runs on Amazon EKS (Elastic Kubernetes Service) with the following components:

  • VPC Configuration:

    • Custom VPC with public and private subnets across multiple availability zones
    • Internet Gateway for public access
    • NAT Gateway for private subnet outbound traffic
    • Security groups with appropriate ingress/egress rules
  • EKS Cluster:

    • Kubernetes version 1.27
    • OIDC provider for service account IAM roles
    • Cluster logging enabled for audit and troubleshooting
  • Node Groups:

    • Spot instances for cost optimization (t3.medium)
    • Auto-scaling configuration (1-3 nodes)
    • IAM roles with necessary permissions
  • Load Balancing:

    • AWS Load Balancer Controller for ingress management
    • Automatic provisioning of Application Load Balancers
    • SSL/TLS termination support

Kubernetes Resources

The /Infrastructure/Kubernetes directory contains:

  • egress-configuration.yaml: Outbound traffic rules
  • ingress-commune-drop-configuration.yaml: Ingress rules for the main application
  • ingress-live-location-configuration.yaml: Ingress rules for the location service

Getting Started

Prerequisites

  • AWS CLI configured with appropriate credentials
  • Terraform CLI
  • kubectl
  • Helm

Deployment Steps

  1. Clone the repository
git clone https://github.com/smangukia/CommuneDrop.git
cd CommuneDrop
  1. Initialize Terraform
cd Infrastructure
terraform init
  1. Apply Terraform configuration
terraform apply
  1. Configure kubectl
aws eks update-kubeconfig --name eks-cluster --region us-east-1
  1. Deploy microservices
kubectl apply -f Kubernetes/
  1. Verify deployment
kubectl get pods --all-namespaces

Technology Stack

Backend Technologies

  • .NET Core: Powers the AuthService with Duende Identity Server
  • Node.js: Foundation for most microservices
  • Express: Web framework for Node.js services
  • TypeScript: Type-safe JavaScript for robust applications
  • MongoDB: NoSQL database for flexible data storage
  • Redis: In-memory caching for LocationService
  • Kafka: Event streaming platform for real-time updates
  • Socket.IO: Real-time bidirectional communication

Frontend Technologies

  • React: UI library for building the user interface
  • Vite: Next-generation frontend tooling
  • TailwindCSS: Utility-first CSS framework
  • Google Maps API: Map visualization for location tracking
  • Supabase: Authentication and database services

DevOps & Infrastructure

  • Docker: Containerization of all services

  • Kubernetes: Container orchestration for deployment

  • Terraform: Infrastructure as Code for cloud resources

  • AWS Services:

  • Amazon EKS

  • VPC and networking components

  • Load Balancer Controller

  • IAM roles and policies

Security

  • OAuth2 & OpenID Connect: Industry-standard authentication protocols
  • JWT: Secure token-based authentication
  • Stripe: PCI-compliant payment processing

Monitoring and Observability

  • Kubernetes Dashboard: Visual management of cluster resources
  • AWS CloudWatch: Metrics and logging
  • Prometheus & Grafana: Advanced monitoring (planned)

Security Considerations

  • All services use JWT-based authentication
  • Sensitive data is encrypted at rest and in transit
  • API endpoints are protected with appropriate scopes
  • Payment information is handled securely through Stripe
  • Private subnets for sensitive workloads
  • Security groups with least privilege access

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

πŸš— CommuneDrop is a scalable, microservices-based ride-booking platform for transporting goods with real-time tracking, secure inter-service communication via Identity Server, and Kafka-powered async messaging. Deployed on AWS with Kubernetes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors