feat: Update Draw.io diagrams - simplified and more readable

- Simplified authentication flow with clear sequence diagram
- Cleaned up database schema with better layout
- Reorganized API endpoints with emoji icons
- Improved system architecture with cleaner connections
- All diagrams now match Mermaid style: simple, clean, easy to understand
This commit is contained in:
oguz ozturk 2026-01-12 14:53:08 +03:00
parent 8e6322bd9b
commit 0ce4db0bb7
5 changed files with 667 additions and 0 deletions

View File

@ -0,0 +1,85 @@
<mxfile host="65bd71144e">
<diagram id="system-architecture" name="System Architecture">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="600" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- Admin UI -->
<mxCell id="2" value="Admin UI&#xa;React + Vite&#xa;:5173" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=13;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="200" width="140" height="80" as="geometry"/>
</mxCell>
<!-- Admin API -->
<mxCell id="3" value="Admin API&#xa;Flask&#xa;:5001" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=13;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="300" y="200" width="140" height="80" as="geometry"/>
</mxCell>
<!-- Admin DB -->
<mxCell id="4" value="Admin DB&#xa;PostgreSQL&#xa;admin_hosting_db" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="520" y="120" width="140" height="80" as="geometry"/>
</mxCell>
<!-- Customer DB -->
<mxCell id="5" value="Customer DB&#xa;PostgreSQL&#xa;hosting&#xa;(Read-Only)" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="520" y="280" width="140" height="90" as="geometry"/>
</mxCell>
<!-- Customer API -->
<mxCell id="6" value="Customer API&#xa;api.argeict.net&#xa;:5000" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="300" y="400" width="140" height="70" as="geometry"/>
</mxCell>
<!-- Cloudflare API -->
<mxCell id="7" value="Cloudflare API&#xa;api.cloudflare.com" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="520" y="400" width="140" height="70" as="geometry"/>
</mxCell>
<!-- Arrow: Admin UI -> Admin API -->
<mxCell id="8" value="HTTPS" style="endArrow=classic;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#6c8ebf;fontSize=11" edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Arrow: Admin API -> Admin DB -->
<mxCell id="9" value="R/W" style="endArrow=classic;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryDz=0;strokeWidth=2;strokeColor=#82b366;fontSize=11" edge="1" parent="1" source="3" target="4">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Arrow: Admin API -> Customer DB -->
<mxCell id="10" value="Read Only" style="endArrow=classic;html=1;exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryDz=0;strokeWidth=2;strokeColor=#d6b656;dashed=1;fontSize=11" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Arrow: Admin API -> Customer API -->
<mxCell id="11" value="Internal API" style="endArrow=classic;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#b85450;fontSize=11" edge="1" parent="1" source="3" target="6">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Arrow: Admin API -> Cloudflare API -->
<mxCell id="12" value="Validate" style="endArrow=classic;html=1;exitX=0.75;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#d79b00;fontSize=11" edge="1" parent="1" source="3" target="7">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<!-- Title -->
<mxCell id="13" value="Admin Panel - System Architecture" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="200" y="40" width="400" height="30" as="geometry"/>
</mxCell>
<!-- Legend -->
<mxCell id="14" value="Frontend" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=10" vertex="1" parent="1">
<mxGeometry x="720" y="120" width="80" height="30" as="geometry"/>
</mxCell>
<mxCell id="15" value="Backend" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=10" vertex="1" parent="1">
<mxGeometry x="720" y="160" width="80" height="30" as="geometry"/>
</mxCell>
<mxCell id="16" value="Database" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=10" vertex="1" parent="1">
<mxGeometry x="720" y="200" width="80" height="30" as="geometry"/>
</mxCell>
<mxCell id="17" value="External" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=10" vertex="1" parent="1">
<mxGeometry x="720" y="240" width="80" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -0,0 +1,184 @@
<mxfile host="65bd71144e">
<diagram id="auth-flow" name="Authentication Flow">
<mxGraphModel dx="1200" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="800" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- Title -->
<mxCell id="2" value="Admin Login - Authentication Flow" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="250" y="20" width="500" height="30" as="geometry"/>
</mxCell>
<!-- Actors Header -->
<mxCell id="3" value="Admin" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="70" width="100" height="40" as="geometry"/>
</mxCell>
<mxCell id="4" value="Admin UI" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="240" y="70" width="100" height="40" as="geometry"/>
</mxCell>
<mxCell id="5" value="Admin API" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="400" y="70" width="100" height="40" as="geometry"/>
</mxCell>
<mxCell id="6" value="Database" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="560" y="70" width="100" height="40" as="geometry"/>
</mxCell>
<mxCell id="7" value="Audit Log" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="720" y="70" width="100" height="40" as="geometry"/>
</mxCell>
<!-- Vertical Lines -->
<mxCell id="8" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#6c8ebf;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="130" y="110" as="sourcePoint"/>
<mxPoint x="130" y="700" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="9" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#6c8ebf;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="290" y="110" as="sourcePoint"/>
<mxPoint x="290" y="700" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="10" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#82b366;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="450" y="110" as="sourcePoint"/>
<mxPoint x="450" y="700" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="11" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#9673a6;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="610" y="110" as="sourcePoint"/>
<mxPoint x="610" y="700" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="12" value="" style="endArrow=none;dashed=1;html=1;strokeWidth=2;strokeColor=#d6b656;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="770" y="110" as="sourcePoint"/>
<mxPoint x="770" y="700" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 1 -->
<mxCell id="13" value="1. Enter username + password" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#6c8ebf;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="130" y="150" as="sourcePoint"/>
<mxPoint x="290" y="150" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 2 -->
<mxCell id="14" value="2. POST /api/auth/login" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#82b366;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="290" y="190" as="sourcePoint"/>
<mxPoint x="450" y="190" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 3 -->
<mxCell id="15" value="3. Query admin_users" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#9673a6;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="450" y="230" as="sourcePoint"/>
<mxPoint x="610" y="230" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 4 -->
<mxCell id="16" value="4. Return admin data" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#9673a6;dashed=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="610" y="270" as="sourcePoint"/>
<mxPoint x="450" y="270" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 5 -->
<mxCell id="17" value="5. Verify password hash" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
<mxGeometry x="380" y="300" width="140" height="30" as="geometry"/>
</mxCell>
<!-- Step 6 -->
<mxCell id="18" value="6. Generate JWT token" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
<mxGeometry x="380" y="350" width="140" height="30" as="geometry"/>
</mxCell>
<!-- Step 7 -->
<mxCell id="19" value="7. Update last_login" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#9673a6;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="450" y="410" as="sourcePoint"/>
<mxPoint x="610" y="410" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 8 -->
<mxCell id="20" value="8. Log login action" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#d6b656;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="450" y="450" as="sourcePoint"/>
<mxPoint x="770" y="450" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 9 -->
<mxCell id="21" value="9. Return token + admin data" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#82b366;dashed=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="450" y="490" as="sourcePoint"/>
<mxPoint x="290" y="490" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Step 10 -->
<mxCell id="22" value="10. Store token in localStorage" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="220" y="520" width="140" height="30" as="geometry"/>
</mxCell>
<!-- Step 11 -->
<mxCell id="23" value="11. Redirect to dashboard" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#6c8ebf;dashed=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="290" y="570" as="sourcePoint"/>
<mxPoint x="130" y="570" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Success Box -->
<mxCell id="24" value="✓ SUCCESS" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=13;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="610" width="100" height="40" as="geometry"/>
</mxCell>
<!-- Error Section -->
<mxCell id="25" value="ERROR PATH" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1;fontColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="80" y="680" width="150" height="25" as="geometry"/>
</mxCell>
<!-- Error Arrow -->
<mxCell id="26" value="If password invalid → Return error" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#b85450;dashed=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="450" y="720" as="sourcePoint"/>
<mxPoint x="290" y="720" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Error Message -->
<mxCell id="27" value="Show error message" style="endArrow=classic;html=1;strokeWidth=2;strokeColor=#b85450;dashed=1;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="290" y="750" as="sourcePoint"/>
<mxPoint x="130" y="750" as="targetPoint"/>
</mxGeometry>
</mxCell>
<!-- Legend -->
<mxCell id="28" value="Legend:" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="850" y="150" width="80" height="20" as="geometry"/>
</mxCell>
<mxCell id="29" value="Request →" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
<mxGeometry x="850" y="180" width="100" height="20" as="geometry"/>
</mxCell>
<mxCell id="30" value="Response - - →" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11" vertex="1" parent="1">
<mxGeometry x="850" y="200" width="100" height="20" as="geometry"/>
</mxCell>
<mxCell id="31" value="Process" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11" vertex="1" parent="1">
<mxGeometry x="850" y="230" width="100" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -0,0 +1,126 @@
<mxfile host="65bd71144e">
<diagram id="database-schema" name="Database Schema">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="600" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- Title -->
<mxCell id="2" value="Database Schema - Admin Panel" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="250" y="20" width="500" height="30" as="geometry"/>
</mxCell>
<!-- admin_users -->
<mxCell id="3" value="admin_users" style="swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=13;" vertex="1" parent="1">
<mxGeometry x="80" y="80" width="180" height="156" as="geometry"/>
</mxCell>
<mxCell id="4" value="🔑 id" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="3">
<mxGeometry y="26" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="5" value="username" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="3">
<mxGeometry y="52" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="6" value="email" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="3">
<mxGeometry y="78" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="7" value="password_hash" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="3">
<mxGeometry y="104" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="8" value="role" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="3">
<mxGeometry y="130" width="180" height="26" as="geometry"/>
</mxCell>
<!-- subscription_plans -->
<mxCell id="9" value="subscription_plans" style="swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=13;" vertex="1" parent="1">
<mxGeometry x="320" y="80" width="180" height="182" as="geometry"/>
</mxCell>
<mxCell id="10" value="🔑 id" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="9">
<mxGeometry y="26" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="11" value="name" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="9">
<mxGeometry y="52" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="12" value="slug" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="9">
<mxGeometry y="78" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="13" value="price_monthly" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="9">
<mxGeometry y="104" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="14" value="max_domains" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="9">
<mxGeometry y="130" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="15" value="features (JSON)" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="9">
<mxGeometry y="156" width="180" height="26" as="geometry"/>
</mxCell>
<!-- cloudflare_accounts -->
<mxCell id="16" value="cloudflare_accounts" style="swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#ffe6cc;strokeColor=#d79b00;fontSize=13;" vertex="1" parent="1">
<mxGeometry x="560" y="80" width="180" height="182" as="geometry"/>
</mxCell>
<mxCell id="17" value="🔑 id" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="16">
<mxGeometry y="26" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="18" value="name" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="16">
<mxGeometry y="52" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="19" value="email" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="16">
<mxGeometry y="78" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="20" value="api_token_encrypted" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="16">
<mxGeometry y="104" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="21" value="max_domains" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="16">
<mxGeometry y="130" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="22" value="is_active" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="16">
<mxGeometry y="156" width="180" height="26" as="geometry"/>
</mxCell>
<!-- audit_logs -->
<mxCell id="23" value="audit_logs" style="swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=13;" vertex="1" parent="1">
<mxGeometry x="80" y="320" width="180" height="182" as="geometry"/>
</mxCell>
<mxCell id="24" value="🔑 id" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="23">
<mxGeometry y="26" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="25" value="🔗 admin_id (FK)" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11;fontColor=#b85450;fontStyle=1" vertex="1" parent="23">
<mxGeometry y="52" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="26" value="action" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="23">
<mxGeometry y="78" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="27" value="resource_type" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="23">
<mxGeometry y="104" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="28" value="resource_id" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="23">
<mxGeometry y="130" width="180" height="26" as="geometry"/>
</mxCell>
<mxCell id="29" value="created_at" style="text;align=left;verticalAlign=middle;spacingLeft=4;fontSize=11" vertex="1" parent="23">
<mxGeometry y="156" width="180" height="26" as="geometry"/>
</mxCell>
<!-- Relationship: audit_logs -> admin_users -->
<mxCell id="30" value="" style="endArrow=classic;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#b85450;" edge="1" parent="1" source="23" target="3">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="31" value="1:N" style="edgeLabel;html=1;align=center;verticalAlign=middle;fontSize=12;fontStyle=1;fontColor=#b85450;" vertex="1" connectable="0" parent="30">
<mxGeometry x="-0.1" y="1" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<!-- Legend -->
<mxCell id="32" value="Legend:" style="text;html=1;align=left;verticalAlign=middle;fontSize=12;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="320" y="350" width="80" height="20" as="geometry"/>
</mxCell>
<mxCell id="33" value="🔑 = Primary Key" style="text;html=1;align=left;verticalAlign=middle;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="375" width="150" height="20" as="geometry"/>
</mxCell>
<mxCell id="34" value="🔗 = Foreign Key" style="text;html=1;align=left;verticalAlign=middle;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="395" width="150" height="20" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -0,0 +1,114 @@
<mxfile host="65bd71144e">
<diagram id="api-endpoints" name="API Endpoints">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1000" pageHeight="700" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- Title -->
<mxCell id="2" value="API Endpoints - Admin Panel" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=18;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="250" y="20" width="500" height="30" as="geometry"/>
</mxCell>
<!-- Authentication -->
<mxCell id="3" value="🔐 Authentication" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="70" width="200" height="25" as="geometry"/>
</mxCell>
<mxCell id="4" value="POST /api/auth/login" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="100" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="GET /api/auth/me" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="140" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="POST /api/auth/logout" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="180" width="200" height="30" as="geometry"/>
</mxCell>
<!-- Plans -->
<mxCell id="7" value="📋 Subscription Plans" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="320" y="70" width="200" height="25" as="geometry"/>
</mxCell>
<mxCell id="8" value="GET /api/plans" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="100" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="9" value="POST /api/plans" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="140" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="PUT /api/plans/:id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="180" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="11" value="DELETE /api/plans/:id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="220" width="200" height="30" as="geometry"/>
</mxCell>
<!-- Cloudflare Accounts -->
<mxCell id="12" value="☁️ Cloudflare Accounts" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="560" y="70" width="200" height="25" as="geometry"/>
</mxCell>
<mxCell id="13" value="GET /api/cf-accounts" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="560" y="100" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="14" value="POST /api/cf-accounts" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
<mxGeometry x="560" y="140" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="15" value="PUT /api/cf-accounts/:id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11" vertex="1" parent="1">
<mxGeometry x="560" y="180" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="16" value="DELETE /api/cf-accounts/:id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11" vertex="1" parent="1">
<mxGeometry x="560" y="220" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="17" value="GET /api/cf-accounts/stats" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11" vertex="1" parent="1">
<mxGeometry x="560" y="260" width="200" height="30" as="geometry"/>
</mxCell>
<!-- Customers -->
<mxCell id="18" value="👥 Customers" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="280" width="200" height="25" as="geometry"/>
</mxCell>
<mxCell id="19" value="GET /api/customers" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="310" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="20" value="GET /api/customers/:id" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="350" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="21" value="PUT /api/customers/:id/plan" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="390" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="22" value="GET /api/customers/stats" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="430" width="200" height="30" as="geometry"/>
</mxCell>
<!-- Audit Logs -->
<mxCell id="23" value="📝 Audit Logs" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="320" y="280" width="200" height="25" as="geometry"/>
</mxCell>
<mxCell id="24" value="GET /api/audit" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="310" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="25" value="GET /api/audit?filter=..." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="320" y="350" width="200" height="30" as="geometry"/>
</mxCell>
<!-- Legend -->
<mxCell id="26" value="Legend:" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="500" width="100" height="25" as="geometry"/>
</mxCell>
<mxCell id="27" value="GET (Read)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11" vertex="1" parent="1">
<mxGeometry x="80" y="530" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="28" value="POST (Create)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=11" vertex="1" parent="1">
<mxGeometry x="220" y="530" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="29" value="PUT (Update)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11" vertex="1" parent="1">
<mxGeometry x="360" y="530" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="30" value="DELETE (Remove)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11" vertex="1" parent="1">
<mxGeometry x="500" y="530" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="31" value="Stats/Analytics" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11" vertex="1" parent="1">
<mxGeometry x="640" y="530" width="120" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

158
diagrams/README.md Normal file
View File

@ -0,0 +1,158 @@
# 📊 Admin Panel - Draw.io Diyagramları
Bu klasör Admin Panel'in düzenlenebilir Draw.io diyagramlarını içerir.
## 📁 Dosyalar
### 1. **01-system-architecture.drawio**
**Sistem Mimarisi**
- Frontend Layer (Admin UI)
- Backend Layer (Admin API, Auth, Audit)
- Database Layer (Admin DB, Customer DB)
- External Services (Customer API, Cloudflare)
### 2. **02-authentication-flow.drawio**
**Kimlik Doğrulama Akışı**
- Login süreci (14 adım)
- JWT token oluşturma
- Audit logging
- Success ve Error path'leri
### 3. **03-database-schema.drawio**
**Veritabanı Şeması**
- admin_users tablosu
- subscription_plans tablosu
- cloudflare_accounts tablosu
- audit_logs tablosu
- İlişkiler (1:N)
### 4. **04-api-endpoints.drawio**
**API Endpoint Yapısı**
- Authentication endpoints
- Plans Management endpoints
- CF Accounts endpoints
- Customers endpoints
- Audit Logs endpoints
- Renk kodlu legend
---
## 🎨 VS Code'da Kullanım
### Dosya Açma
1. VS Code'da `.drawio` dosyasına tıklayın
2. Draw.io eklentisi otomatik açılır
3. Düzenleme modunda açılır
### Düzenleme
- **Şekil Ekleme**: Sol panelden sürükle-bırak
- **Bağlantı**: Şekillerden ok çiz
- **Renk**: Sağ panelden renk seç
- **Metin**: Çift tıkla ve yaz
### Kaydetme
- `Cmd+S` veya `Ctrl+S`
- Otomatik kaydedilir
---
## 🎯 Renk Paleti
| Kategori | Renk | Hex Code |
|----------|------|----------|
| Admin Panel | Açık Kırmızı | #ffebee |
| Auth | Açık Mavi | #e1f5ff |
| Database | Açık Yeşil | #e8f5e9 |
| Plans | Açık Yeşil | #e8f5e9 |
| CF Accounts | Açık Turuncu | #fff3e0 |
| Customers | Açık Mor | #f3e5f5 |
| Audit | Açık Sarı | #fff9c4 |
---
## ✏️ Düzenleme İpuçları
### Yeni Şekil Ekleme
1. Sol panelden şekil seç
2. Canvas'a sürükle
3. Boyutlandır
### Bağlantı Ekleme
1. Şekilden ok çiz
2. Diğer şekle bağla
3. Ok tipini değiştir (sağ panel)
### Metin Düzenleme
1. Şekle çift tıkla
2. Metni yaz
3. Font/boyut ayarla (üst menü)
### Renk Değiştirme
1. Şekli seç
2. Sağ panelden renk seç
3. Fill ve Stroke ayarla
---
## 📤 Export
### PNG Olarak
1. File → Export as → PNG
2. Ayarları seç
3. Export
### SVG Olarak
1. File → Export as → SVG
2. Ayarları seç
3. Export
### PDF Olarak
1. File → Export as → PDF
2. Ayarları seç
3. Export
---
## 🔄 Mermaid ile Karşılaştırma
| Özellik | Mermaid | Draw.io |
|---------|---------|---------|
| Format | Kod (text) | Görsel (XML) |
| Düzenleme | VS Code text editor | VS Code Draw.io eklentisi |
| Versiyon Kontrolü | ✅ Kolay | ⚠️ XML diff |
| Görsel Özgürlük | ❌ Sınırlı | ✅ Tam kontrol |
| Hız | ✅ Hızlı | ⚠️ Orta |
| Öğrenme Eğrisi | ⚠️ Syntax öğren | ✅ Kolay |
---
## 💡 Kullanım Senaryoları
### Mermaid Kullan:
- Hızlı diyagram
- Kod-tabanlı dokümantasyon
- Basit akış şemaları
- Git diff önemli
### Draw.io Kullan:
- Detaylı diyagram
- Karmaşık yapılar
- Sunum için
- Görsel tasarım önemli
---
## 🚀 Sonraki Adımlar
1. ✅ Dosyaları VS Code'da açın
2. ✅ Draw.io eklentisinin çalıştığını kontrol edin
3. ✅ Diyagramları inceleyin
4. ✅ İhtiyacınıza göre düzenleyin
5. ✅ Kaydedin ve commit edin
---
**Son Güncelleme**: 2026-01-12
**Versiyon**: 1.0.0
**Yazar**: ARGE ICT