Skip to content

Commit

Permalink
Update mermaid architecture in README.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshs committed Oct 22, 2024
1 parent b658cb4 commit 8a16266
Showing 1 changed file with 63 additions and 16 deletions.
79 changes: 63 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,69 @@ A modern, full-stack todo application built with Go (Fiber) + React + MongoDB

```mermaid
graph TD
Client[React Frontend] -->|HTTP Requests| Backend[Go API]
Backend -->|CRUD Operations| Database[(MongoDB)]
Client -->|Static Assets| FrontendBuild[React Build]
subgraph "Frontend (React)"
Client
FrontendBuild
end
subgraph "Backend (Go)"
Backend
end
subgraph "Database"
Database[(MongoDB)]
end
subgraph Client["Frontend Client"]
UI[React UI]
end
subgraph Server["Go Fiber Server (main.go)"]
Main[Main Function]
ENV[Load Environment]
DB[MongoDB Connection]
Router[Fiber Router]
subgraph Endpoints["API Endpoints"]
GET[GET /api/todos]
POST[POST /api/todos]
PATCH[PATCH /api/todos/:id]
DELETE[DELETE /api/todos/:id]
end
subgraph Handlers["Handler Functions"]
getTodos
createTodo
updateTodo
deleteTodo
end
end
subgraph Database["MongoDB Atlas"]
Collection["Collection: todos</br>Database: golang_db"]
end
%% Main Application Flow
Main --> ENV
ENV --> DB
Main --> Router
Router --> Endpoints
%% Connect Endpoints to Handlers
GET --> getTodos
POST --> createTodo
PATCH --> updateTodo
DELETE --> deleteTodo
%% Connect Handlers to Database
getTodos --> Collection
createTodo --> Collection
updateTodo --> Collection
deleteTodo --> Collection
%% Client Interaction
UI <--> GET
UI <--> POST
UI <--> PATCH
UI <--> DELETE
%% Styling
classDef server fill:#f9f,stroke:#333,stroke-width:2px
classDef database fill:#b5d8ff,stroke:#333,stroke-width:2px
classDef client fill:#baffc9,stroke:#333,stroke-width:2px
classDef endpoint fill:#fff5ba,stroke:#333,stroke-width:2px
class Server server
class Database database
class Client client
class GET,POST,PATCH,DELETE endpoint
```

## ✨ Features
Expand Down

0 comments on commit 8a16266

Please sign in to comment.