@eventcatalog/create-eventcatalog 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +3 -0
  2. package/dist/default/Dockerfile +36 -0
  3. package/dist/default/README-template.md +1 -0
  4. package/dist/default/dockerignore +7 -0
  5. package/dist/default/eventcatalog.config.js +26 -0
  6. package/dist/default/events/AddedItemToCart/index.md +30 -0
  7. package/dist/default/events/AddedItemToCart/schema.json +46 -0
  8. package/dist/default/events/AddedItemToCart/versioned/0.0.1/index.md +30 -0
  9. package/dist/default/events/AddedItemToCart/versioned/0.0.1/schema.json +39 -0
  10. package/dist/default/events/OrderComplete/index.md +25 -0
  11. package/dist/default/events/OrderComplete/schema.json +39 -0
  12. package/dist/default/events/OrderConfirmed/index.md +25 -0
  13. package/dist/default/events/OrderConfirmed/schema.json +39 -0
  14. package/dist/default/events/OrderRequested/index.md +27 -0
  15. package/dist/default/events/OrderRequested/schema.json +39 -0
  16. package/dist/default/events/PaymentProcessed/index.md +27 -0
  17. package/dist/default/events/PaymentProcessed/schema.json +43 -0
  18. package/dist/default/events/RemovedItemFromCart/index.md +30 -0
  19. package/dist/default/events/RemovedItemFromCart/schema.json +46 -0
  20. package/dist/default/events/ShipmentDelivered/index.md +26 -0
  21. package/dist/default/events/ShipmentDelivered/schema.json +43 -0
  22. package/dist/default/events/ShipmentDispatched/index.md +25 -0
  23. package/dist/default/events/ShipmentDispatched/schema.json +43 -0
  24. package/dist/default/events/ShipmentPrepared/index.md +25 -0
  25. package/dist/default/events/ShipmentPrepared/schema.json +43 -0
  26. package/dist/default/gitignore +21 -0
  27. package/dist/default/public/logo.svg +44 -0
  28. package/dist/default/public/opengraph.png +0 -0
  29. package/dist/default/services/Basket Service/index.md +17 -0
  30. package/dist/default/services/Data Lake/index.md +12 -0
  31. package/dist/default/services/Payment Service/index.md +14 -0
  32. package/dist/default/services/Shipping Service/index.md +17 -0
  33. package/dist/gitignore +21 -0
  34. package/dist/index.js +2 -0
  35. package/package.json +76 -0
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # create-eventcatalog
2
+
3
+ NPM package that is used to allow users to quickly create EventCatalogs.
@@ -0,0 +1,36 @@
1
+
2
+
3
+ # Install dependencies only when needed
4
+ FROM node:16-alpine AS deps
5
+ # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
6
+ RUN apk add --no-cache libc6-compat
7
+ WORKDIR /app
8
+ COPY package.json yarn.lock ./
9
+ RUN yarn install --frozen-lockfile
10
+
11
+ # Rebuild the source code only when needed
12
+ FROM node:16-alpine AS builder
13
+ WORKDIR /app
14
+ COPY --from=deps /app/node_modules ./node_modules
15
+ COPY . .
16
+ RUN yarn build
17
+
18
+ # Production image, copy all the files and run next
19
+ FROM node:16-alpine AS runner
20
+ WORKDIR /app
21
+
22
+ ENV NODE_ENV production
23
+
24
+ RUN addgroup -g 1001 -S nodejs
25
+ RUN adduser -S nextjs -u 1001
26
+ RUN /bin/sh -c "apk add --no-cache bash"
27
+
28
+ COPY --from=builder --chown=nextjs:nodejs /app ./
29
+
30
+ USER nextjs
31
+
32
+ EXPOSE 3000
33
+
34
+ ENV PORT 3000
35
+
36
+ CMD ["npm", "start"]
@@ -0,0 +1 @@
1
+ # My Event Catalog
@@ -0,0 +1,7 @@
1
+ Dockerfile
2
+ .dockerignore
3
+ node_modules
4
+ npm-debug.log
5
+ README.md
6
+ .next
7
+ .eventcatalog-core
@@ -0,0 +1,26 @@
1
+ module.exports = {
2
+ title: 'EventCatalog',
3
+ tagline: 'Discover, Explore and Document your Event Driven Architectures',
4
+ organizationName: 'Your Company',
5
+ projectName: 'Event Catalog',
6
+ editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
7
+ logo: {
8
+ alt: 'EventCatalog Logo',
9
+ // found in the public dir
10
+ src: 'logo.svg',
11
+ },
12
+ users: [
13
+ {
14
+ id: 'dboyne',
15
+ name: 'David Boyne',
16
+ avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
17
+ role: 'Developer',
18
+ },
19
+ {
20
+ id: 'mSmith',
21
+ name: 'Matthew Smith',
22
+ avatarUrl: 'https://randomuser.me/api/portraits/lego/3.jpg',
23
+ role: 'Developer',
24
+ },
25
+ ],
26
+ }
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: AddedItemToCart
3
+ version: 0.0.2
4
+ summary: |
5
+ Holds information about what the user added to their shopping cart.
6
+ producers:
7
+ - Basket Service
8
+ consumers:
9
+ - Data Lake
10
+ domains:
11
+ - Shop
12
+ owners:
13
+ - dboyne
14
+ - mSmith
15
+ ---
16
+
17
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
18
+
19
+ ### Details
20
+
21
+ This event can be triggered multiple times per customer. Everytime the customer adds an item to their shopping cart this event will be triggered.
22
+
23
+ We have a frontend application that allows users to buy things from our store. This front end interacts directly with the `Basket Service` to add items to the cart. The `Basket Service` will raise the events.
24
+
25
+
26
+ ### Consumer / Producer Diagram
27
+
28
+ <Mermaid />
29
+
30
+ <Schema />
@@ -0,0 +1,46 @@
1
+ {
2
+ "$id": "https://example.com/AddedItemToCart.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "AddedItemToCart",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "itemId": {
33
+ "type": "string",
34
+ "description": "The ID of the shopping item"
35
+ },
36
+ "quantity": {
37
+ "type": "number",
38
+ "description": "How many items the user wants to add to their shopping cart",
39
+ "minimum": 1,
40
+ "maximum": 100,
41
+ "default": 1
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: AddedItemToCart
3
+ version: 0.0.1
4
+ summary: |
5
+ Holds information about what the user added to their shopping cart.
6
+ producers:
7
+ - Basket Service
8
+ consumers:
9
+ - Data Lake
10
+ domains:
11
+ - Shop
12
+ owners:
13
+ - dboyne
14
+ - mSmith
15
+ ---
16
+
17
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
18
+
19
+ ### Details
20
+
21
+ This event can be triggered multiple times per customer. Everytime the customer adds an item to their shopping cart this event will be triggered.
22
+
23
+ We have a frontend application that allows users to buy things from our store. This front end interacts directly with the `Basket Service` to add items to the cart. The `Basket Service` will raise the events.
24
+
25
+
26
+ ### Consumer / Producer Diagram
27
+
28
+ <Mermaid />
29
+
30
+ <Schema />
@@ -0,0 +1,39 @@
1
+ {
2
+ "$id": "https://example.com/AddedItemToCart.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "AddedItemToCart",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "itemId": {
33
+ "type": "string",
34
+ "description": "The ID of the shopping item"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: OrderComplete
3
+ version: 0.0.1
4
+ summary: |
5
+ Event represents when an order has been complete. (Delivered and finished)
6
+ producers:
7
+ - Orders Service
8
+ consumers:
9
+ - Data Lake
10
+ owners:
11
+ - dboyne
12
+ - mSmith
13
+ ---
14
+
15
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
16
+
17
+ ### Details
18
+
19
+ This event is the final event of the ordering process. It gets raised when the shipment has been delivered.
20
+
21
+ ### Consumer / Producer Diagram
22
+
23
+ <Mermaid />
24
+
25
+ <Schema />
@@ -0,0 +1,39 @@
1
+ {
2
+ "$id": "https://example.com/OrderRequested.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "OrderRequested",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain", "service"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "orderId": {
33
+ "type": "string",
34
+ "description": "The ID the users order"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: OrderConfirmed
3
+ version: 0.0.1
4
+ summary: |
5
+ Event represents when an order has been confirmed and ready to be processed (shipped for example)
6
+ producers:
7
+ - Orders Service
8
+ consumers:
9
+ - Shipping Service
10
+ owners:
11
+ - dboyne
12
+ - mSmith
13
+ ---
14
+
15
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
16
+
17
+ ### Details
18
+
19
+ This event is triggered when the customers order has been verified and the stock has been checked. Once this event is triggered we are safe to say it is ready for shipment.
20
+
21
+ ### Consumer / Producer Diagram
22
+
23
+ <Mermaid />
24
+
25
+ <Schema />
@@ -0,0 +1,39 @@
1
+ {
2
+ "$id": "https://example.com/OrderRequested.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "OrderRequested",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain", "service"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "orderId": {
33
+ "type": "string",
34
+ "description": "The ID the users order"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: OrderRequested
3
+ version: 0.0.1
4
+ summary: |
5
+ Holds information about the customers order.
6
+ producers:
7
+ - Basket Service
8
+ consumers:
9
+ - Payment Service
10
+ owners:
11
+ - dboyne
12
+ - mSmith
13
+ ---
14
+
15
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
16
+
17
+ ### Details
18
+
19
+ This event is triggered when the user confirms their order and wants to process their payment.
20
+
21
+ We have a frontend application that allows users to buy things from our store. The frontend application interacts with the Backet Service to trigger the `OrderRequested` event.
22
+
23
+ ### Consumer / Producer Diagram
24
+
25
+ <Mermaid />
26
+
27
+ <Schema />
@@ -0,0 +1,39 @@
1
+ {
2
+ "$id": "https://example.com/OrderRequested.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "OrderRequested",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain", "service"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "orderId": {
33
+ "type": "string",
34
+ "description": "The ID the users order"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: PaymentProcessed
3
+ version: 0.0.1
4
+ summary: |
5
+ Holds information about the payment that has been processed.
6
+ producers:
7
+ - Payment Service
8
+ consumers:
9
+ - Orders Service
10
+ owners:
11
+ - dboyne
12
+ - mSmith
13
+ ---
14
+
15
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
16
+
17
+ ### Details
18
+
19
+ This event is triggered when the payment has succesfully been processed for a customers orders.
20
+
21
+ We use Stripe to handle customer payments. The Payment Service listens for Stripe webhooks and raises the PaymentProcessed event.
22
+
23
+ ### Consumer / Producer Diagram
24
+
25
+ <Mermaid />
26
+
27
+ <Schema />
@@ -0,0 +1,43 @@
1
+ {
2
+ "$id": "https://example.com/PaymentProcessed.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "PaymentProcessed",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain", "service"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "orderId": {
33
+ "type": "string",
34
+ "description": "The ID the users order"
35
+ },
36
+ "stripeId": {
37
+ "type": "string",
38
+ "description": "The ID the payment handled in stripe"
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: RemovedItemFromCart
3
+ version: 0.0.1
4
+ summary: |
5
+ Holds information about what the user removed from their cart.
6
+ producers:
7
+ - Basket Service
8
+ consumers:
9
+ - Data Lake
10
+ domains:
11
+ - Shop
12
+ owners:
13
+ - dboyne
14
+ - mSmith
15
+ ---
16
+
17
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
18
+
19
+ ### Details
20
+
21
+ This event can be triggered multiple times per customer. Everytime the customer adds an item to their shopping cart this event will be triggered.
22
+
23
+ We have a frontend application that allows users to buy things from our store. This front end interacts directly with the `Basket Service` to add items to the cart. The `Basket Service` will raise the events.
24
+
25
+
26
+ ### Consumer / Producer Diagram
27
+
28
+ <Mermaid />
29
+
30
+ <Schema />
@@ -0,0 +1,46 @@
1
+ {
2
+ "$id": "https://example.com/RemovedItemFromCart.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "RemovedItemFromCart",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "itemId": {
33
+ "type": "string",
34
+ "description": "The ID of the shopping item"
35
+ },
36
+ "quantity": {
37
+ "type": "number",
38
+ "description": "How many items the user wants to remove to their shopping cart",
39
+ "minimum": 1,
40
+ "maximum": 100,
41
+ "default": 1
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: ShipmentDelivered
3
+ version: 0.0.1
4
+ summary: |
5
+ Event represents when a shipment has been delievered and received.
6
+ producers:
7
+ - Shipping Service
8
+ consumers:
9
+ - Order Service
10
+ - Data Lake
11
+ owners:
12
+ - dboyne
13
+ - mSmith
14
+ ---
15
+
16
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
17
+
18
+ ### Details
19
+
20
+ This event is triggered when a shipment has been delievered to it's destination.
21
+
22
+ ### Consumer / Producer Diagram
23
+
24
+ <Mermaid />
25
+
26
+ <Schema />
@@ -0,0 +1,43 @@
1
+ {
2
+ "$id": "https://example.com/ShipmentDispatched.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "title": "ShipmentDispatched",
5
+ "type": "object",
6
+ "properties": {
7
+ "metadata": {
8
+ "type": "object",
9
+ "properties": {
10
+ "correlationId": {
11
+ "type": "string",
12
+ "description": "The ID of the user"
13
+ },
14
+ "domain": {
15
+ "type": "string",
16
+ "description": "The domain of the event"
17
+ },
18
+ "service": {
19
+ "type": "string",
20
+ "description": "The name of the service that triggered the event"
21
+ }
22
+ },
23
+ "required": ["correlationId", "domain", "service"]
24
+ },
25
+ "data": {
26
+ "type": "object",
27
+ "properties": {
28
+ "userId": {
29
+ "type": "string",
30
+ "description": "The ID of the user"
31
+ },
32
+ "shipmentId": {
33
+ "type": "string",
34
+ "description": "The ID of the shipment"
35
+ },
36
+ "orderId": {
37
+ "type": "string",
38
+ "description": "The order assigned to the shipment"
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: ShipmentDispatched
3
+ version: 0.0.1
4
+ summary: |
5
+ Event represents when a shipment has been dispatched.
6
+ producers:
7
+ - Shipping Service
8
+ consumers:
9
+ - Shipping Service
10
+ owners:
11
+ - dboyne
12
+ - mSmith
13
+ ---
14
+
15
+ <Admonition>When firing this event make sure you set the `correlation-id` in the headers. Our schemas have standard metadata make sure you read and follow it.</Admonition>
16
+
17
+ ### Details
18
+
19
+ This event is triggered when a shipment has been dispatched from the warehouse.
20
+
21
+ ### Consumer / Producer Diagram
22
+
23
+ <Mermaid />
24
+
25
+ <Schema />