· 6 years ago · Feb 15, 2020, 07:28 AM
1# Requirements Gathering
21. In post we can add text, photos or videos
32. Add we can see timeline of posts
4
5
6
7# (Q1) Technology Stack
8
9First, let's choose centrized system.
10I will use Rest api architectural style.
11
12
13## For Frontend - React.Js
14React vs Angular Both of them do the same,
15React is more flexible
16Low learning curve.
17In Js language.
18
19## For Backend - Gin-Gonic
20It's in Golang language. the language is minimalistic.
21Go provies high performance.
22Low development time.
23Gin-gonic is sable.
24Low learning curve.
25
26# (Q3) Database Scheme
27For file storage we will use AWS.
28Assumeing, One post can have multiple image or video and one text.
29We will use RDMS.
30
31Post Table
32PostId - numeric
33UserId - alphanumeric (Foreign Key to User table)
34CreateTime - datetime
35ModifiedTime - datetime
36TextContent - varchar
37
38PostFile
39PostFileId - numeric
40PostId - (Foreign Key to Post table)
41FileType - numeric
42FileLink - varchar
43
44# (Q2)
451. Add Post
46From fron-end we will pass text content and file contents.
47In backend we will have add post api.
48Url: post/add
49Http Method: post
50
512. Edit Post
52From fron-end we will pass text content and file contents.
53In backend we will have edit post api.
54Url: post/edit:
55Http Method: put
56
573. Delete Post
58From fron-end we will pass PostId.
59In backend we will have delete post api.
60Url: post/delete:
61Http Method: delete
62
634. Get Post
64From fron-end we will pass UserId.
65In backend we will have delete post api.
66Url: post/get/userId=2 or post/get/postId=1:
67Http Method: get
68
69# (Q4)
70
71Security:
72For user authentication: we will use JWT token
73File authentication: we will have a spacific url which will be hashed with user spacific.
74
75Scalability:
76We have to introduce Distributed system for high Scalability.
77For database,
781. Table Shurding.
792. Database Replicas.
803. Consider CAP Theorem.