Skip to content

Commit 9420520

Browse files
committed
add mkdocs-material
1 parent f884594 commit 9420520

File tree

11 files changed

+217
-0
lines changed

11 files changed

+217
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy OrderFlow - Jekyll with GitHub Pages dependencies preinstalled
2+
3+
on:
4+
push:
5+
branches:
6+
- docs
7+
workflow_dispatch:
8+
permissions:
9+
contents: write
10+
jobs:
11+
mkdocs:
12+
runs-on: ubuntu-latest
13+
if: github.ref == 'refs/heads/docs'
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Configure Git Credentials
17+
run: |
18+
git config user.name github-actions[bot]
19+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.x
23+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24+
- uses: actions/cache@v4
25+
with:
26+
key: mkdocs-material-${{ env.cache_id }}
27+
path: ~/.cache
28+
restore-keys: |
29+
mkdocs-material-
30+
- name: Install Python dependencies
31+
working-directory: docs
32+
run: |
33+
pip install -r requirements.txt
34+
- name: Build and deploy to GitHub Pages
35+
working-directory: docs
36+
run: mkdocs gh-deploy --force

docs/docs/Components.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
```md
2+
+---------------------+ +-------------------------+
3+
| Frontend UI | ---------------> | API Gateway |
4+
| (Angular + Leaflet) | (REST / WebSocket) | (Spring Cloud Gateway)|
5+
+---------------------+ +-------------------------+
6+
|
7+
8+
┌───────────────────────────────┐
9+
│ Apache Kafka │
10+
│ (order-topic, delivery-topic)│
11+
│ Simulates orders │
12+
│ & driver location │
13+
└─────────┬──┬──────────────────┘
14+
│ │
15+
┌────────────────────┘ └──────────────────┐
16+
▼ ▼
17+
┌────────────────────────────┐ ┌────────────────────────────┐
18+
│ Consumer Order Service │ │ Consumer Delivery Service │
19+
│ (Group: order-group) │ │ (Group: delivery-group) │
20+
│ - Consumes new orders │ │ - Consumes driver location │
21+
└────────────────────────────┘ └────────────────────────────┘
22+
23+
┌──────────────────────────────┐
24+
│ Consul Registry │
25+
│ (Service Discovery & Health) │
26+
└──────────────────────────────┘
27+
28+
┌──────────────────────────────┐
29+
│ Kafka UI │
30+
│ (Topic inspection) │
31+
└──────────────────────────────┘
32+
```

docs/docs/Data_Flow_Summary.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
1. **Producer Service** → Publishes new orders to Kafka (order-topic).
2+
2. **Consumer Order Service** → Processes order events
3+
1. Listens to order-topic (order list updates).
4+
2. Broadcasts order list in real time to connected WebSocket clients.
5+
3. **Consumer Delivery Service**
6+
1. Listens to delivery-topic (driver position updates).
7+
2. Broadcasts updates in real time to connected WebSocket clients.
8+
4. **Angular Frontend** → Displays orders and live locations on a map (Leaflet).

docs/docs/Technology.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Technology Stack used for development:
2+
3+
* [Spring Boot](https://spring.io/projects/spring-boot)
4+
* [Spring Cloud](https://spring.io/projects/spring-cloud)
5+
* [Apache Kafka](https://kafka.apache.org/)
6+
* [Consul](https://developer.hashicorp.com/consul)
7+
* [Angular](https://angular.io/)
8+
* [Cypress](https://docs.cypress.io/api/commands/url)
9+
* [Jest](https://jestjs.io/)
10+
* [Cucumber](https://cucumber.io/)

docs/docs/gateway.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
The **gateway-service** is a Spring Cloud Gateway application that acts as the entry point for all client requests.
2+
It routes incoming HTTP requests to the appropriate microservices.
3+
4+
Example (application.yml)
5+
```yaml
6+
spring:
7+
cloud:
8+
gateway:
9+
server:
10+
webflux:
11+
discovery:
12+
locator:
13+
enabled: true
14+
routes:
15+
- id: producer-service
16+
uri: lb://producer-service
17+
predicates:
18+
- Path=/api/**
19+
- id: consumer-order-service
20+
uri: lb://consumer-order-service
21+
predicates:
22+
- Path=/ws-orders/**
23+
- id: consumer-delivery-service
24+
uri: lb://consumer-delivery-service
25+
predicates:
26+
- Path=/ws-delivery/**
27+
```

docs/docs/images/img_1.png

292 KB
Loading

docs/docs/images/svc.png

35.1 KB
Loading

docs/docs/index.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Welcome to OrderFlow
2+
3+
## OrderFlow
4+
OrderFlow is a real-time e-commerce order tracking platform built with **Spring Boot**, **Spring Cloud**, **Apache Kafka**, and **Angular**.
5+
It enables seamless order creation, real-time delivery tracking, and live updates through event streaming.
6+
7+
![order-workflow.](images/img_1.png){ width="900px" }
8+
9+
## Components
10+
11+
```mermaid
12+
graph TD
13+
A[Frontend UI] --> |REST / WebSocket| B{API Gateway};
14+
B --> C[Apache Kafka];
15+
C --> D[Consumer Order Service];
16+
C --> E[Consumer Delivery Service];
17+
F[Consul Registry]
18+
G[Kafka UI]
19+
```
20+
21+
```mermaid
22+
graph TR
23+
A[Frontend UI (Angular + Leaflet)] --> |REST / WebSocket| B{API Gateway (Spring Cloud Gateway)};
24+
B --> C[Apache Kafka (order-topic, delivery-topic) Simulates orders & driver location];
25+
C --> D[Consumer Order Service (Group: order-group)];
26+
C --> E[Consumer Delivery Service (Group: delivery-group)];
27+
F[Consul Registry (Service Discovery & Health)]
28+
G[Kafka UI (Topic inspection)]
29+
```
30+
31+
## Running the Application
32+
In order to run this starter application locally you need to have [Docker](https://www.docker.com/) and [Docker-Compose](https://docs.docker.com/compose/install/) installed on your machine.
33+
Clone the repository:
34+
```bash
35+
git clone https://github.com/romdhanisam/OrderFlow.git
36+
cd OrderFlow
37+
```
38+
```bash
39+
docker-compose up --build
40+
```
41+
This command will build and start all the services in the docker-compose.yml file, including:
42+
43+
1. **Kafka**: The event streaming platform that enables real-time delivery tracking.
44+
2. **Consul**: The service registry for dynamic service discovery.
45+
3. **Spring Cloud Gateway**: Handles routing and load balancing between services.
46+
4. **Producer and Consumer Services**: Handle order events and delivery tracking.
47+
5. **Frontend**: Provides the Angular UI to display the order status and driver locations.

docs/docs/svc.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
![Services](./images/svc.png "Services")
2+
3+
## Docker services
4+
5+
| Services | Port | Role |
6+
|----------------------------|------|-----------------------------------------------------------------------------------------|
7+
| gateway-service | 8000 | API Gateway for routing requests to the appropriate microservice |
8+
| producer-service | 9000 | Publishes order creation events to Kafka |
9+
| consumer-order-service | 9001 | Consumes order events (**order-topic**) |
10+
| consumer-delivery-service | 9002 | Consumes delivery events (**delivery-topic**) and simulates real-time driver locations |
11+
| consul | 8500 | Service registry for discovery & health checks |
12+
| kafka | 9092 | Message broker for streaming data (Kraft Mode) |
13+
| zookeeper | 2181 | Coordinates Kafka broker |
14+
| kafka-ui | 8501 | Web UI to monitor Kafka topics and consumers |

docs/mkdocs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
site_name: OrderFlow Docs
2+
site_url: "https://romdhanisam.github.io/orderflow/"
3+
repo_url: "https://github.com/romdhanisam/OrderFlow/"
4+
repo_name: "romdhanisam/OrderFlow"
5+
site_dir: public
6+
theme:
7+
name: material
8+
features:
9+
- navigation.instant
10+
- content.code.annotate
11+
- content.tabs.link
12+
nav:
13+
- Welcome to OrderFlow: index.md
14+
- Technology: Technology.md
15+
- Services: svc.md
16+
- Components: Components.md
17+
- Data Flow Summary: Data_Flow_Summary.md
18+
- Gateway Service Configuration: gateway.md
19+
20+
markdown_extensions:
21+
- admonition
22+
- def_list
23+
- attr_list
24+
- footnotes
25+
- pymdownx.highlight:
26+
anchor_linenums: true
27+
linenums: true
28+
linenums_style: pymdownx.inline
29+
- pymdownx.inlinehilite
30+
- pymdownx.snippets
31+
- pymdownx.superfences
32+
- md_in_html
33+
- pymdownx.superfences:
34+
custom_fences:
35+
- name: mermaid
36+
class: mermaid
37+
format: !!python/name:pymdownx.superfences.fence_code_format

0 commit comments

Comments
 (0)