-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anton
committed
Oct 24, 2024
1 parent
83dff86
commit c941802
Showing
7 changed files
with
127 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
documentation/arc42/building_blocks/timelines_api/timelines_api_details.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
include::../diagrams/TimelinesAPIContainer.puml[] | ||
include::../diagrams/TimelinesAPIContainer-key.puml[] | ||
|
||
include::users_api_short_description.adoc[] | ||
|
||
===== Fulfilled Requirements | ||
The API implements rate limiting to prevent abuse and ensure fair usage. | ||
|
||
===== Risks | ||
* Risk of slow response times or degraded performance during peak usage periods. |
15 changes: 15 additions & 0 deletions
15
documentation/arc42/building_blocks/timelines_api/timelines_api_short.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
==== Timelines API | ||
|
||
The Timelines API microservice is responsible for managing user timelines in the image-sharing system. | ||
It retrieves posts from users that the specified user follows, ensuring that they are ordered by recency. | ||
|
||
===== Interface(s) | ||
link:https://editor.swagger.io/?url=https://raw.githubusercontent.com/shcherby/system-design-arc42/refs/heads/main/documentation/arc42/building_blocks/users_api/timelines_api_swagger.yaml[REST API] | ||
link:https://github.com[Messages] | ||
|
||
===== Locations | ||
link:https://github.com[users-api details] | ||
link:https://github.com[users-api repository] | ||
link:https://github.com[users-api CI/CD] | ||
link:https://github.com[users-api database] | ||
link:https://github.com[users-api releases] |
68 changes: 68 additions & 0 deletions
68
documentation/arc42/building_blocks/timelines_api/timelines_api_swagger.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Timelines API | ||
description: API for retrieving timelines of posts from followed users. | ||
version: 1.0.0 | ||
servers: | ||
- url: http://api.example.com/v1 | ||
description: Main API server | ||
paths: | ||
/users/{userId}/timeline: | ||
get: | ||
summary: Get user timeline | ||
description: Retrieve the latest posts from the users that the specified user follows. | ||
parameters: | ||
- name: userId | ||
in: path | ||
required: true | ||
description: The ID of the user whose timeline to retrieve. | ||
schema: | ||
type: string | ||
example: "12345" | ||
- name: limit | ||
in: query | ||
required: false | ||
description: The number of posts to retrieve (default is 20). | ||
schema: | ||
type: integer | ||
example: 20 | ||
- name: page | ||
in: query | ||
required: false | ||
description: The page number for pagination. | ||
schema: | ||
type: integer | ||
example: 1 | ||
responses: | ||
'200': | ||
description: A list of posts for the user's timeline. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
posts: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
postId: | ||
type: string | ||
example: "67890" | ||
author: | ||
type: string | ||
example: "user123" | ||
imageUrl: | ||
type: string | ||
example: "http://cdn.example.com/image.jpg" | ||
caption: | ||
type: string | ||
example: "Enjoying the view!" | ||
timestamp: | ||
type: string | ||
format: date-time | ||
example: "2024-10-24T14:34:00Z" | ||
'400': | ||
description: Invalid request parameters (e.g., missing userId). | ||
'404': | ||
description: User not found or no posts available. |
47 changes: 20 additions & 27 deletions
47
documentation/arc42/building_blocks/users_api/users_api_details.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters