Skip to content

TheotimeC/G-Faim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” G-Faim | Event-Driven Food Delivery Platform

Microservices Apache Kafka Node.js CLI Tool Security

A high-performance, distributed delivery ecosystem orchestrated via Apache Kafka & Zookeeper. Featuring distinct interfaces for Clients, Restaurants, and Couriers, plus a dedicated security layer for external developers.


πŸ“‘ Table of Contents


πŸ— Event-Driven Architecture

G-Faim moves beyond traditional REST communication by implementing an Event-Driven Architecture. Services are decoupled and communicate asynchronously, ensuring high scalability and fault tolerance.

  • Message Broker: Apache Kafka handles the stream of events (Order Placed, Payment Validated, Courier Assigned).
  • Coordination: Zookeeper manages the cluster state and configuration.
  • Services: Autonomous Node.js microservices scaling independently.

Architecture Schema Figure: Microservices architecture with Kafka Bus communication and Zookkeeper.


πŸ“± The Trinity Experience (User Features)

The platform is designed around three distinct personas, each with a dedicated workflow and feature set.

πŸ˜‹ 1. The Client (UberEats-like Experience)

A seamless, consumer-facing application designed for speed.

  • Marketplace Navigation: Browse restaurants, filter by categories, and view real-time availability.
  • Smart Cart: Add items, customize dishes (toppings, sizes), and manage basket.
  • Live Order Tracking: Real-time status updates consuming Kafka events (Preparing -> Picked Up -> Arriving).

πŸ‘¨β€πŸ³ 2. The Restaurant Owner (Admin Suite)

A powerful dashboard for operational control.

  • Order Governance: Real-time reception of incoming orders with the ability to Accept or Refuse based on kitchen load.
  • Dynamic Menu Engineering:
    • Create and edit articles.
    • Manage complex customization options (sides, sauces, variations).
  • Access Management: Granular control over staff access and permissions.
  • Audit Logs: View detailed history of all interactions and order flows.

🚴 3. The Courier (Gig-Economy Interface)

Location-based tooling for independent logistics.

  • Proximity Radar: Receive order notifications for pick-ups within a specific radius (Geo-fencing logic).
  • Self-Assignment: Freedom to browse available deliveries and choose which order to accept.
  • Route Optimization: Detailed info on pickup and drop-off locations.

πŸ›  Developer Experience & CLI

We treat external developers as first-class citizens. G-Faim includes a robust ecosystem for third-party integrations, secured by a dedicated Auth Service.

πŸ“Ÿ The G-Faim CLI

A custom command-line tool designed for speed and automation.

  • Public Resource Fetching: Dedicated commands to download menus, restaurant lists, and public datasets.
  • System Status: Check the health of the microservices grid from the terminal.

[INSERT SCREENSHOT HERE: Screenshot of the Terminal using the CLI]

πŸ”‘ Advanced API Key Management

  • Renewable & Revocable: Developers can generate API keys that can be rotated for security or instantly revoked in case of compromise.
  • Granular Scopes: Keys are bound to specific permissions, ensuring secure external access.

πŸ” Security & Access Control

The platform implements a Hybrid Security Model:

  1. JWT (JSON Web Tokens):

    • Used for frontend user authentication (Clients/Couriers).
    • Stateless authentication ensuring scalability across microservices.
    • Token payload contains RBAC (Role-Based Access Control) claims.
  2. API Keys (Hashed):

    • Used for the CLI and external developer tools.
    • Keys are hashed and validated against the Developer Service.
    • Allows machine-to-machine communication without user sessions.

πŸ’» Tech Stack

Component Technology
Core Backend Node.js / Express.js / Typescript
Messaging & Broker Apache Kafka
Orchestration Apache Zookeeper
Database MongoDB (Per-service databases)
Security JWT (Users) + Hashed API Keys (Devs)
Interface ReactJS + REST API + Custom CLI

Application Screenshots

Client side

Home page

Client_Home

Search page

Client_Restaurants

Restaurant side

Dashboard

Restaurant_home

Menus configuration

Restaurant_menu

Courier side

Dashboard

Coursier_Home

Order validation

Coursier_order

Order delivery

Coursier_in_progress


πŸš€ Installation & Setup

Prerequisites

  • Docker (for Kafka/Zookeeper)
  • Node.js v16+
  • MongoDB

1. Start the Infrastructure

Use Docker Compose to spin up the Kafka Cluster and Zookeeper.

docker-compose up -d zookeeper kafka

2. Install Microservices

Clone the repo and install dependencies for the ecosystem.

git clone https://github.com/TheotimeC/G-Faim.git
cd G-Faim
npm install # Installs dependencies for the workspace

3. Configure Environment

Create .env files for each service connecting them to the Kafka broker.

KAFKA_BROKER=
MONGO_URI=
JWT_SECRET=

4. Run the Dev CLI

# Login with your Developer Key
./bin/gfaim-cli login --key=YOUR_API_KEY

# Fetch public data
./bin/gfaim-cli get-orders --status=pending

πŸ‘€ Author

ThΓ©otime Colinet Engineering Student

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •