%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR subgraph Era1["ยุคแยก Front/Back / Separate Apps"] A["Angular Dev Serverlocalhost:4200"] B["Express APIlocalhost:3000"] end subgraph Era2["ยุค Proxy/CORS / Development Integration"] C["proxy.conf.jsonforward /api"] D["cors middlewareallow origin"] end subgraph Era3["ยุค Shared Contract / Type-safe Integration"] E["HttpClient Serviceเรียก API"] F["Shared Typesinterface ร่วมกัน"] end A --> C --> E B --> D --> E --> F
%%{init: {"theme": "base", "themeVariables": {"primaryColor": "#fabd2f", "primaryTextColor": "#282828", "primaryBorderColor": "#b57614", "lineColor": "#7c6f64", "secondaryColor": "#83a598", "tertiaryColor": "#b8bb26", "background": "#fbf1c7", "mainBkg": "#ebdbb2", "fontFamily": "Tahoma, sans-serif"}}}%% flowchart LR A["Angular Componentหน้าจอ"] --> B["Angular API ServiceHttpClient"] B --> C["/api/lessonsProxy หรือ apiUrl"] C --> D["Express BackendREST API"] D --> E["Database/Memoryข้อมูล"] E --> D --> B --> A