Skip to content

Commit 5ef2e59

Browse files
authored
Merge pull request #16 from Sangam5756/Feat_API_documentation_Implemented
Feat Readme Update
2 parents f01b9d9 + 78115df commit 5ef2e59

3 files changed

Lines changed: 12 additions & 63 deletions

File tree

Architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Also shows how the frontend communicates with backend routes and how backend com
7676
7777

7878
## 🧠 Entity Relationship Diagram (ERD)
79-
![ER Diagram](./Design/ER_Diagram.png)
79+
![ER Diagram](./Design/database/ER_Diagram.png)
8080

8181

8282

@@ -101,7 +101,7 @@ Also shows how the frontend communicates with backend routes and how backend com
101101
- findPostById
102102
- createPOst
103103
- updatePost
104-
- DelelePost
104+
- DeletePost
105105
- getAllPost
106106
-getPostById
107107

feed.md renamed to Design/feed.md

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,3 @@
1-
# 1 — PlantUML code
2-
3-
4-
```plantuml
5-
@startuml
6-
' Title
7-
title Materialized Feed Architecture (BullMQ + Redis + MongoDB)
8-
9-
actor "Client (Browser / Mobile)" as Client
10-
node "API Server\n(Node.js / Express)" as API
11-
database "MongoDB\nPrimary DB\n(Questions, Likes, Answers)" as Mongo
12-
database "MongoDB\nFeed Collection\n(denormalized)" as FeedDB
13-
folder "Redis\nBullMQ" as Redis
14-
node "Feed Worker\n(BullMQ Worker)" as Worker
15-
node "Backfill Job\n(Batch Script)" as Backfill
16-
cloud "Monitoring / Metrics\n(Prometheus / Grafana)" as Monitoring
17-
18-
Client --> API : GET /feed/public
19-
API --> FeedDB : Query feed (fast indexed read)
20-
API --> Mongo : (writes) create Question / Like / Answer / Update
21-
API --> Redis : push job to queue (feed-updates)\n(e.g. like-added, answer-added)
22-
API --> Client : 200 OK (feed JSON)
23-
24-
Redis --> Worker : job consumed
25-
Worker --> FeedDB : upsert / $inc (likes,dislikes,replies)
26-
Worker --> Mongo : optionally read question snapshot (on question-created/update)
27-
Worker --> Redis : ack (job completed)
28-
29-
Backfill --> Mongo : scan questions, counts
30-
Backfill --> FeedDB : bulk upsert seed / reconcile
31-
32-
Monitoring <.. API : metrics
33-
Monitoring <.. Worker : worker metrics
34-
Monitoring <.. Redis : queue depth
35-
36-
' Notes
37-
note right of API
38-
- Publish events (like-added, like-removed,\n dislike-added, answer-added, question-created)
39-
- API only pushes job, returns quickly
40-
end note
41-
42-
note left of Worker
43-
- Jobs processed concurrently
44-
- Atomic updates with $inc
45-
- Idempotency & retries via BullMQ
46-
end note
47-
48-
@enduml
49-
```
50-
51-
---
52-
53-
54-
````markdown
551
# Materialized Feed Service (BullMQ + Redis + MongoDB)
562

573
## Overview
@@ -80,8 +26,9 @@ Reads are fast (single query to `Feed`), and expensive aggregations are handled
8026
"likes": 0,
8127
"dislikes": 0,
8228
"replies": 0
83-
}
84-
````
29+
}```
30+
31+
8532

8633
* **Backfill script**: Recompute and populate `Feed` documents from primary DB to recover drift.
8734

@@ -163,9 +110,8 @@ Prereqs: Node.js, MongoDB, Redis
163110

164111
MIT
165112

166-
```
167113

168-
---
114+
169115

170116
# 3 — Cause-of-change examples in STAR format
171117

@@ -210,4 +156,4 @@ Below are short STAR entries for the common events that cause the feed to change
210156
- c) the worker code with idempotency (event dedupe with Redis or Mongo dedupe table)?
211157

212158
Tell me which of (a–c) to deliver next and I’ll produce the code files ready to paste into your project.
213-
```
159+

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ DevFlow is a full-stack, production-grade **developer Q\&A platform** inspired b
44

55
👨‍💻 Built with a scalable architecture in mind, DevFlow empowers users to ask programming questions, post answers, and engage in in-depth threaded conversations.
66

7+
8+
* 🔗 **Live Project**: https://devflowbackend.sangammundhe.site/api-docs
9+
710
---
811

912
## 🚀 Why DevFlow?
@@ -191,8 +194,8 @@ MIT License. Feel free to use, share, or build on top of this!
191194

192195
## 🌍 Links
193196

194-
* 🔗 **Live Project**: *Coming Soon*
195-
* 📦 **Repo**: [github.com/your-username/devflow](https://github.com/Sangam5756/devflow)
197+
* 🔗 **Live Project**: https://devflowbackend.sangammundhe.site/api-docs
198+
* 📦 **Repo**: [github.com/Sangam5756/devflow](https://github.com/Sangam5756/devflow)
196199
* 🧠 **Follow**: [X @sangammundhe](https://x.com/sangammundhe)
197200
Tag: `#BuildInPublic #DevFlow`
198201

0 commit comments

Comments
 (0)