From fa58455218ce758c7d7341cf659650997d270c8b Mon Sep 17 00:00:00 2001 From: Quinten Date: Wed, 10 Sep 2025 17:21:04 +0200 Subject: [PATCH] data flow --- docs/README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index a1e1a43..c26dc85 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1 +1,49 @@ -# webserv \ No newline at end of file +# webserv + + +### Date Flow Overview + +``` +src/ + ├─ main.cpp # starts server + ├─ Server.cpp/.hpp # listens & manages event loop + ├─ Connection.cpp/.hpp # represents a single client + ├─ RequestParser.cpp/.hpp + ├─ Router.cpp/.hpp + ├─ Response.cpp/.hpp + ├─ CGIHandler.cpp/.hpp + ├─ Config.cpp/.hpp # parses config file + └─ Utils.cpp/.hpp +``` + +``` +[Client TCP packet] + │ + ▼ +┌───────────────┐ +│ Event Loop │ (poll/select/epoll) +└──────┬────────┘ + │ + ▼ +┌───────────────┐ +│ RequestParser │ (builds Request struct) +└──────┬────────┘ + │ + ▼ +┌───────────────┐ +│ Router │ (selects location, checks methods) +└──────┬────────┘ + │ + ▼ +┌───────────────┐ +│ Handler │ (static file, CGI, error) +└──────┬────────┘ + │ + ▼ +┌───────────────┐ +│ ResponseBuilder│ (status line + headers + body) +└──────┬────────┘ + │ + ▼ +[Send response back to client] +``` \ No newline at end of file