-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment.txt
78 lines (33 loc) · 1.74 KB
/
Assignment.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Assignment Response Form
Title: Social media application
Question:
Objective:
To create a comprehensive backend for a social media application using Node.js and Express.js. The backend should handle post creation and management, commenting, likes, and follower relationships.
Requirements:
Node.js and Express.js installed
Postgres database
Sequelize ORM
Tasks:
1. User Management: (for future).
a. Create a user model with attributes like username, email, password, and profile picture.
b. Implement user registration and login endpoints.
c. Implement password hashing and authentication using bcrypt or a similar library.
d. Implement user profile management endpoints to update user information.
2. Post Management:
a. Create a post model with attributes like author, content, timestamp, and likes.
b. Implement endpoints to create, read, update, and delete posts.
c. Implement post filtering and sorting options. (for future).
d. Implement image or file upload for posts (for future).
3. Comment Management:
a. Create a comment model with attributes like author, content, timestamp, and post reference.
b. Implement endpoints to create, read, update, and delete comments.
4. Likes:
a. Create a model or data structure to store user likes for posts.
b. Implement endpoints to like and unlike posts.
c. Implement a mechanism to track the total number of likes for each post.
d. Implement a way to display liked posts to users (Optional).
5. Followers:
a. Create a model or data structure to store follower relationships.
b. Implement endpoints to follow and unfollow users.
c. Implement a mechanism to track the number of followers and following for each user.
d. Implement a way to display a user's followers and following (Optional).