Skip to content

Commit 94a36df

Browse files
author
Anton
committed
clean up
1 parent d508539 commit 94a36df

File tree

6 files changed

+61
-120
lines changed

6 files changed

+61
-120
lines changed

documentation/arc42/05_building_block_view.adoc

+2-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ include::../diagrams/Containers-key.puml[]
1919
....
2020

2121
=== Microservices
22-
==== Timelines API
23-
include::./building_blocks/timelines_api/_timelines_api_short.adoc[]
24-
include::./building_blocks/timelines_api/_timelines_api_details.adoc[]
22+
include::./building_blocks/timelines_api/_timelines_api.adoc[]
2523

26-
==== Users API
27-
include::building_blocks/users_api/_users_api_short.adoc[]
24+
include::./building_blocks/users_api/_users_api.adoc[]

documentation/arc42/building_blocks/timelines_api/_timelines_api_details.adoc documentation/arc42/building_blocks/timelines_api/_timelines_api.adoc

+27-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
:diagram-server-url: https://kroki.io
22
:diagram-server-type: kroki_io
33

4+
==== Timelines API
5+
6+
The Timelines API microservice is responsible for managing user timelines in the image-sharing system.
7+
It retrieves posts from users that the specified user follows, ensuring that they are ordered by recency.
8+
9+
[plantuml, format=png]
10+
....
11+
include::../../../diagrams/TimelinesAPIContainer.puml[]
12+
....
13+
14+
[plantuml, format=png]
15+
....
16+
include::../../../diagrams/TimelinesAPIContainer-key.puml[]
17+
....
18+
19+
===== Interface(s)
20+
* link:https://editor.swagger.io/?url=https://raw.githubusercontent.com/shcherby/system-design-arc42/refs/heads/main/documentation/arc42/building_blocks/timelines_api/timelines_api_swagger.yaml[REST API]
21+
* link:https://github.com[Messages]
22+
23+
===== Locations
24+
* link:https://github.com[Repository]
25+
* link:https://github.com[CI/CD]
26+
* link:https://github.com[Database]
27+
* link:https://github.com[Releases]
28+
429
===== Fulfilled Requirements
530
* Users can read their timeline with recent updates from users they follow.
631
* Users can set number of posts in their timeline, max 50 posts.
@@ -23,9 +48,9 @@ include::../../../diagrams/TimelinesApiAppComponents.puml[]
2348
include::../../../diagrams/TimelinesApiAppComponents-key.puml[]
2449
....
2550

26-
*Timeline Event Handler*
51+
*Updating Timeline postCreated event consumer*
2752

28-
* The Timeline Event Handler component is responsible for processing updates to user timelines in response to new created post.
53+
* Is responsible for processing updates to user timelines in response to new created post.
2954

3055
*Followers timeline updater*
3156

@@ -44,15 +69,6 @@ include::../../../diagrams/TimelinesApiAppComponents-key.puml[]
4469
* Responsible for managing and accessing timeline data.
4570
* Saving and retrieving followers timeline by user Id.
4671

47-
*Updating Influencers Posts Event Handler*
48-
49-
* Responsible for processing post created events related to influencer posts within the image-sharing system.
50-
51-
*Influencers posts updater*
52-
53-
* Responsible for managing and updating influencer-related posts within the timeline service.
54-
* Maintaining a synchronized copy of posts from users marked as influencers within the Timeline service.
55-
5672
*Influencers posts repository*
5773

5874
* Responsible for storing and managing influencer posts within the timeline service.

documentation/arc42/building_blocks/timelines_api/_timelines_api_short.adoc

-25
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
==== Users API
12

3+
The Users API microservice is responsible for managing all user-related functionality within the system.
4+
Its primary purpose is to handle operations such as user registration, authentication, profile management, and account settings.
5+
It also manages user data, including personal information, preferences, and security features like password updates and account recovery.
26

3-
==== Users API
4-
include::_users_api_short_description.adoc[]
7+
===== Interface(s)
8+
link:https://editor.swagger.io/?url=https://raw.githubusercontent.com/shcherby/system-design-arc42/refs/heads/main/documentation/arc42/building_blocks/users_api/users_api_swagger.yaml[REST API]
9+
link:https://github.com[Messages]
10+
11+
===== Locations
12+
link:https://github.com[users-api details]
13+
link:https://github.com[users-api repository]
14+
link:https://github.com[users-api CI/CD]
15+
link:https://github.com[users-api database]
16+
link:https://github.com[users-api releases]
517

618
===== Quality/Performance Characteristics
719
====== Performance
@@ -29,55 +41,4 @@ include::_users_api_short_description.adoc[]
2941
* Ensuring compliance with data protection regulations (e.g., GDPR) regarding user data handling and storage.
3042
* Risks of unauthorized access or data breaches if security measures are not adequately implemented.
3143
* Reliance on third-party authentication providers could lead to outages or service interruptions.
32-
* Complexity in the registration or authentication process may lead to user drop-off.
33-
34-
35-
=== Level 2
36-
37-
==== White Box API Application
38-
39-
[plantuml, format=png]
40-
....
41-
include::../diagrams/Components.puml[]
42-
....
43-
44-
**Legende**
45-
[plantuml, format=png]
46-
....
47-
include::../diagrams/Components-key.puml[]
48-
....
49-
50-
51-
_<white box template>_
52-
53-
==== White Box _<building block 2>_
54-
55-
56-
_<white box template>_
57-
58-
...
59-
60-
==== White Box _<building block m>_
61-
62-
63-
_<white box template>_
64-
65-
66-
67-
=== Level 3
68-
69-
70-
71-
72-
==== White Box <_building block x.1_>
73-
74-
75-
76-
77-
_<white box template>_
78-
79-
80-
==== White Box <_building block x.2_>
81-
82-
_<white box template>_
83-
44+
* Complexity in the registration or authentication process may lead to user drop-off.

documentation/arc42/building_blocks/users_api/_users_api_short.adoc

-14
This file was deleted.

documentation/diagrams-as-code/main.dsl

+17-11
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ workspace "highly-scalable-image-sharing-platform" "This is an example workspace
2222
imagesProcessingFuncApp = container "Images Processing Func" "Resize images, removes temporary." "Functions, C#"
2323
postsDatabase = container "Posts Database" "Manage user posts, stores images urls." "NoSQL Document Schema" "Database"
2424
timelinesApiApp = container "Timelines API" "Provides timelines functionality via a JSON/HTTP API." "ASP .NET API, C#" {
25-
group "Domain"{
26-
timeline = component "Timeline" "Timeline entity logic" "Doman entity" "components,timelines"
27-
influencersPosts = component "Influencers posts" "Influencers posts entity logic" "Doman entity" "components,timelines"
28-
}
29-
timelinesRepository = component "Timelines repository"
25+
timelinesRepository = component "Timelines repository" "Manages CRUD operations for user timelines, ensuring efficient storage and retrieval in chronological order."
3026
updatingTimelineConsumer = component "Updating timeline postCreated event consumer" "Triggers updating followers timelines" "MassTransit Consumer" "components,timelines"
3127
followersTimelineUpdater = component "Followers timeline updater" "Updates followers' timelines with the latest posts from the users they follow" "c# classes" "components,timelines"
3228
usersClient = component "Users client" "Get users data from users microservice" "HTTP client" "components,timelines"
3329

34-
influencersPostsRepository = component "Influencers posts repository" "" "" "components,timelines"
30+
influencersPostsRepository = component "Influencers posts repository" "Manages CRUD operations for influencer posts" "" "components,timelines"
3531

3632
getTimelineEndpoint = component "Timelines endpoint" "Handles query requests""Minimal API endpoint" "components,timelines"
3733
timelineQuery = component "Timelines query" "Build user timeline query"
@@ -95,15 +91,12 @@ workspace "highly-scalable-image-sharing-platform" "This is an example workspace
9591
# updating timeline
9692
postsApiApp -> updatingTimelineConsumer "uses" "messages:posts" "components,timelines"
9793
updatingTimelineConsumer -> followersTimelineUpdater "uses""" "components,timelines"
98-
updatingTimelineConsumer -> timeline "uses" """components,timelines"
9994
followersTimelineUpdater -> usersClient "uses" """components,timelines"
10095
usersClient -> usersApiApp "uses" "REST/HTTP" "components,timelines"
10196
followersTimelineUpdater -> timelinesRepository "uses" "" "components,timelines"
10297
followersTimelineUpdater -> influencersPostsRepository "uses" "" "components,timelines"
103-
timelinesRepository -> timelinesTable "uses" "" "components,timelines"
104-
105-
# updating influencers posts
106-
influencersPostsRepository -> influencersPostsTable "uses" "" "components,timelines"
98+
timelinesRepository -> timelinesDatabase "uses" "" "components,timelines"
99+
influencersPostsRepository -> timelinesDatabase "uses" "" "components,timelines"
107100

108101
# query timelines
109102
webApp -> getTimelineEndpoint "uses" "REST/HTTP" "components,timelines"
@@ -361,6 +354,13 @@ workspace "highly-scalable-image-sharing-platform" "This is an example workspace
361354
usersApiApp -> usersClient "Returns user {'type' : 'influencer'}"
362355
usersClient -> followersTimelineUpdater "Returns user {'type' : 'influencer'}"
363356
followersTimelineUpdater -> influencersPostsRepository "if user type 'influencer', adds influencer post"
357+
influencersPostsRepository -> timelinesDatabase "influencers posts table"
358+
timelinesDatabase -> influencersPostsRepository "Returns"
359+
influencersPostsRepository -> followersTimelineUpdater "Returns"
360+
followersTimelineUpdater -> timelinesRepository "Saves timeline"
361+
timelinesRepository -> timelinesDatabase "timelines table"
362+
timelinesDatabase -> timelinesRepository "Returns"
363+
timelinesRepository -> followersTimelineUpdater "Returns"
364364
autoLayout lr
365365
}
366366

@@ -369,11 +369,17 @@ workspace "highly-scalable-image-sharing-platform" "This is an example workspace
369369
webApp -> getTimelineEndpoint "/timelines/{userId}"
370370
getTimelineEndpoint -> timelineQuery "Get user timeline by id {userId}"
371371
timelineQuery -> timelinesRepository "Reads timeline by user id {userId}"
372+
timelinesRepository -> timelinesDatabase "Reads timelines from table"
373+
timelinesDatabase -> timelinesRepository "Returns"
374+
timelinesRepository -> timelineQuery "Returns"
372375
timelineQuery -> usersClient "Get user influencer folowers"
373376
usersClient -> usersApiApp "GET /users/{id}/followers?type=influencer"
374377
usersApiApp -> usersClient "Returns list of influencers"
375378
usersClient -> timelineQuery "Returns list of influencers"
376379
timelineQuery -> influencersPostsRepository "if user follows influencers, reads influencer posts"
380+
influencersPostsRepository -> timelinesDatabase "influencers posts table"
381+
timelinesDatabase -> influencersPostsRepository "Returns"
382+
influencersPostsRepository -> timelineQuery "Returns"
377383
timelineQuery -> getTimelineEndpoint "Returns timeline or if user follows influencers, returns aggregated timeline with influencers posts"
378384
getTimelineEndpoint -> webApp "Returns timeline"
379385
autoLayout rl

0 commit comments

Comments
 (0)