<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by ChrisSu on Medium]]></title>
        <description><![CDATA[Stories by ChrisSu on Medium]]></description>
        <link>https://medium.com/@killpmite?source=rss-22bd9f807a1f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kNe6iNACZWKVcM9T</url>
            <title>Stories by ChrisSu on Medium</title>
            <link>https://medium.com/@killpmite?source=rss-22bd9f807a1f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 19:36:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@killpmite/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[36 歲這年，我拿到了加拿大 Working Holiday]]></title>
            <link>https://medium.com/@killpmite/36-%E6%AD%B2%E9%80%99%E5%B9%B4-%E6%88%91%E6%8B%BF%E5%88%B0%E4%BA%86%E5%8A%A0%E6%8B%BF%E5%A4%A7-working-holiday-255a0e6b4312?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/255a0e6b4312</guid>
            <category><![CDATA[workingholiday]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 08:03:27 GMT</pubDate>
            <atom:updated>2026-10-01T08:03:27.292Z</atom:updated>
            <content:encoded><![CDATA[<p>2026 年 9 月 29 日，我收到了一封來自加拿大移民局的通知。</p><p>登入 IRCC，打開那份文件，上面寫著：</p><blockquote><strong><em>Your application to work in Canada has been initially approved.</em></strong></blockquote><p>我的加拿大 Working Holiday，核准了。</p><p>看到這句話的時候，我其實沒有想像中那種「夢想終於實現了」的感覺。</p><p>比較像是 — —</p><p><strong>所以，我真的走到這裡了。</strong></p><p>因為如果把時間往前拉一年多，2025 年 6 月的我，大概很難想像現在會坐在這裡，手上拿著一張可以前往加拿大工作的入場券。</p><p>那時候的我，甚至還不是一個軟體工程師。</p><h3>2025 年，我重新選了一次自己的職業</h3><p>2025 年 6 月，我進入全端工程師就業養成班，開始學 C#。</p><p>這不是我大學畢業後順順走下來的職涯。</p><p>對我來說，它比較接近一次重新開始。</p><p>我要重新學一個專業、重新找工作，也重新回答一個以前可能沒有認真回答過的問題：</p><p><strong>「接下來，我到底想過什麼樣的人生？」</strong></p><p>剛開始學程式的時候，很多東西其實都很陌生。</p><p>C#、物件、Class、Method、ASP.NET、SQL、Database、Git……</p><p>上課的時候好像聽懂了，真正要自己寫的時候，又是另外一回事。</p><p>而且年紀也不再是二十出頭。</p><p>你會知道自己沒有那麼多時間可以一直試。</p><p>如果這次轉職失敗，我要怎麼辦？</p><p>如果真的轉成功了，我又可以走到哪裡？</p><p>就是在這樣的狀態下，我的人生出現了另外一條線。</p><p><strong>加拿大。</strong></p><h3>如果都已經重新開始了，那要不要走得更遠一點？</h3><p>加拿大這件事情，一開始其實跟「成為軟體工程師」是兩件不同的事。</p><p>一邊是我的工作。</p><p>一邊是我想看看，自己的人生還有沒有其他可能。</p><p>我申請了加拿大 IEC Working Holiday。</p><p>2025 年 12 月 22 日，我收到 IEC Welcome to Pool。</p><p>但進 Pool 不代表你拿到簽證。</p><p>甚至連「加拿大願不願意讓你申請」都還不知道。</p><p>所以那時候的加拿大，對我來說還只是一個：</p><p><strong>「也許」</strong></p><p>也許會抽到。</p><p>也許不會。</p><p>也許真的可以去。</p><p>也許最後什麼事情都不會發生。</p><p>所以生活還是繼續。</p><h3>然後，我真的成為了一個 Software Developer</h3><p>2026 年，我進入軟體業。</p><p>以前在課堂上看到的那些東西，突然全部變成真的。</p><p>不再只是練習題。</p><p>而是公司的系統真的在跑。</p><p>我要開始碰 C#、ASP.NET、SQL Server、IIS、NuGet、Git，維護既有系統，處理政府單位的差勤、請假、加班等功能。</p><p>以前看到一段：</p><pre>if (...)<br>{<br>    ...<br>}</pre><p>是在想：</p><p>「這個語法是什麼？」</p><p>進公司以後看到它，問題變成：</p><p><strong>「為什麼這個人的假算錯了？」</strong></p><p>然後開始一路往下追。</p><p>前端。</p><p>後端。</p><p>Service。</p><p>SQL。</p><p>Database。</p><p>資料到底從哪裡來？</p><p>哪一個條件判斷錯了？</p><p>為什麼 Production 上會發生這個問題？</p><p>我當然沒有突然變成一個很厲害的工程師。</p><p>相反地，真正開始工作之後，我才發現自己不知道的東西有多少。</p><p>但至少有一件事情不一樣了。</p><p>以前我說：</p><blockquote><em>「我想轉職當工程師。」</em></blockquote><p>現在我終於可以說：</p><blockquote><strong><em>「我是 Software Developer。」</em></strong></blockquote><p>也就在這個時候，加拿大那條線又動了。</p><h3>2026 年 6 月，我收到加拿大的 Invitation</h3><p>2026 年 6 月 8 日。</p><p>IEC Invitation to Apply。</p><p>我被抽中了。</p><p>這次不是 Welcome to Pool。</p><p>而是加拿大正式邀請我提出 Working Holiday Work Permit 申請。</p><p>接下來開始準備一大堆東西。</p><p>護照。</p><p>照片。</p><p>履歷。</p><p>家庭資料。</p><p>過去的旅行與居住紀錄。</p><p>Schedule 1。</p><p>台灣警察刑事紀錄證明。</p><p>申請費。</p><p>Biometrics。</p><p>我去換了護照、申請良民證、整理過去十幾年的旅行與居住紀錄，也收到 Biometrics Instruction Letter，再到加拿大簽證申請中心完成指紋與照片。</p><p>這時候我其實開始覺得：</p><p><strong>應該差不多了吧？</strong></p><p>該交的交了。</p><p>指紋也按了。</p><p>接下來就是等加拿大審查。</p><p>結果完全不是。</p><p>真正麻煩的事情，才正要開始。</p><h3>2026 年 8 月 13 日，加拿大叫我補件</h3><p>IRCC 寄來新的要求。</p><p>因為我以前曾經在澳洲 Queensland 居住，所以加拿大要求我補：</p><p><strong>Australian Federal Police National Police Certificate。</strong></p><p>這個還不是普通版本，申請用途必須符合加拿大移民要求。</p><p>除此之外，還有：</p><p><strong>Queensland Traffic History Report。</strong></p><p>看到這個要求的時候，問題來了。</p><p>我以前確實住過 Queensland。</p><p>但是 — —</p><p><strong>我根本沒有 Queensland Driver Licence。</strong></p><p>沒有駕照，要怎麼提供駕照的 Traffic History？</p><p>這件事情後來成為整個 IEC 申請裡，我花最多時間處理的一關。</p><h3>我開始想辦法證明一件「不存在的事情」</h3><p>我去問 Queensland Department of Transport and Main Roads。</p><p>來回確認之後，TMR 告訴我：</p><p>因為我是加拿大簽證用途，而且從來沒有持有 Queensland Driver Licence，可以透過 <strong>F2121 Release of Information Application</strong> 申請 Driver Licence History。</p><p>聽起來問題解決了。</p><p>結果下一關馬上出現。</p><p>因為我沒有 Queensland licence，也沒有當地的 Customer Reference Number，所以 TMR 要我提供 <strong>三份經過認證的身分證明</strong>。</p><p>最後準備的是：</p><p><strong>台灣護照。</strong></p><p><strong>國泰世華銀行卡。</strong></p><p><strong>玉山銀行卡。</strong></p><p>問題又來了。</p><p>不是影印三份寄過去就好。</p><p>它們必須是：</p><p><strong>Certified Copy。</strong></p><p>也就是必須由 TMR 接受資格的人證明：</p><blockquote><em>「我確認這份影本與我看到的正本相符。」</em></blockquote><p>於是我開始找：</p><p><strong>在台灣，到底誰可以幫我做 Queensland Government 接受的 Certified Copy？</strong></p><h3>三張影本，在台灣突然變得非常困難</h3><p>我開始跟 Queensland TMR 往返信件。</p><p>TMR 告訴我，符合條件的台灣銀行職員，在特定條件下可以協助認證。</p><p>理論上有路。</p><p>實際去問之後才發現：</p><p><strong>理論上可以，不代表現實世界有人願意幫你做。</strong></p><p>銀行沒有這種日常業務。</p><p>一般公證的處理方式也不一定符合 Queensland TMR 的要求。</p><p>尤其我的身分證明裡還包含銀行卡。</p><p>我不敢隨便找一個地方蓋章，因為如果 Queensland 不接受，我失去的不只是認證費。</p><p>還有時間。</p><p>而 IRCC 的補件是有 Deadline 的。</p><p>最後我找到另外一條路：</p><p><strong>Australian Office in Taipei。</strong></p><p>但我還是不敢直接去。</p><p>我先把認證方式、文字、文件用途一個一個寫信確認。</p><p>問 Queensland TMR：</p><blockquote><em>澳洲政府 DFAT 的 certified copy，你們接受嗎？</em></blockquote><p>確認。</p><p>再問澳洲辦事處：</p><blockquote><em>我的文件不是拿去辦澳洲 Visa，而是直接提交給 Queensland Government，可以辦嗎？</em></blockquote><p>確認。</p><p>兩邊都確認以後，我才預約。</p><h3>為了證明「我沒有 Queensland 駕照」，我跑了一趟台北</h3><p>2026 年 9 月。</p><p>我帶著：</p><p>護照正本。</p><p>國泰世華銀行卡。</p><p>玉山銀行卡。</p><p>到 Australian Office in Taipei。</p><p>三份文件。</p><p>一份認證 <strong>AUD 90</strong>。</p><p>三份就是：<strong>AUD 270。</strong></p><p>做完 Certified Copy 之後，我再填 F2121，把所有資料送給 Queensland TMR。</p><p>但這時候，原本 IRCC 給我的補件期限已經快到了。</p><p>Queensland Government 不可能因為我的加拿大簽證 Deadline 就突然加速。</p><p>所以我只好再回頭跟加拿大解釋：</p><p><strong>文件已經申請，但 Queensland Government 還沒有核發。</strong></p><p>我需要更多時間。</p><h3>9 月 9 日，加拿大同意延期</h3><p>IRCC 最後同意把期限延長到：</p><p><strong>2026 年 10 月 9 日。</strong></p><p>看到延期的時候，我終於稍微鬆了一口氣。</p><p>至少不會因為 Queensland 文件還沒下來，整個申請直接死在這裡。</p><p>接下來繼續等。</p><p>Queensland TMR 後來寄來付款通知。</p><p>我再付了：</p><p><strong>AUD 29.04。</strong></p><p>然後繼續等。</p><p>直到 2026 年 9 月 29 日。</p><p>文件終於來了。</p><p>我打開 Queensland Government 寄來的結果。</p><p>繞了這麼大一圈，最後得到的答案其實非常簡單。</p><p>他們的紀錄顯示：</p><p><strong>沒有我的 Driver Licence History。</strong></p><p><strong>也沒有我的 Traffic History。</strong></p><p>也就是說 — —</p><p>我花了這麼多時間、寫了這麼多 Email、找認證人、跑了一趟台北、付了 AUD 270 的認證費，再付 AUD 29.04 給 Queensland Government。</p><p>最後是為了得到一份官方文件證明：</p><blockquote><strong><em>「對，這個人真的沒有 Queensland 駕照紀錄。」</em></strong></blockquote><p>現在回頭看很好笑。</p><p>但當時一點都不好笑。</p><h3>因為那段時間，我煩惱的其實不只有加拿大</h3><p>如果只是申請文件麻煩，也許還沒有那麼累。</p><p>真正讓我壓力大的，是所有事情都發生在同一段時間。</p><p>我才剛轉職軟體工程師。</p><p>C# 還有很多不會。</p><p>工作上還有很多東西要學。</p><p>英文不好。</p><p>加拿大找工作一定要英文面試。</p><p>而且還有錢。</p><p>貸款。</p><p>卡費。</p><p>房租。</p><p>保險。</p><p>生活費。</p><p>如果真的要去加拿大，我還必須另外準備一筆可以讓自己活幾個月的錢。</p><p>然後我也已經 36 歲了。</p><p>所以有時候我會想：</p><p><strong>我到底在幹嘛？</strong></p><p>好不容易轉職成功，現在又要準備去一個英文環境重新找工作。</p><p>在台灣，我至少開始熟悉現在的工作了。</p><p>去了加拿大，我可能又重新變成那個什麼都不知道的人。</p><p>英文不夠。</p><p>加拿大工作經驗是零。</p><p>沒有當地人脈。</p><p>存款也不是多到可以慢慢玩。</p><p>所以這不是一個：</p><blockquote><em>「我辭掉工作，勇敢追夢！」</em></blockquote><p>的故事。</p><p>我根本沒有那麼瀟灑。</p><p>我只是一直在算：</p><p><strong>我到底怎麼做，才能讓這件事情真的發生？</strong></p><h3>2026 年 9 月 29 日，我把最後一份文件交出去</h3><p>Queensland 文件拿到後，我立刻回到 IRCC。</p><p>上傳。</p><p>填資料。</p><p>確認。</p><p>電子簽名。</p><p>Sign and Transmit。</p><p>畫面出現：</p><p><strong>Congratulations! You have successfully submitted your application or profile.</strong></p><p>好。</p><p>終於。</p><p>接下來又是等。</p><p>結果同一天，我收到 IRCC 的 Email：</p><p><strong>Your application status has changed.</strong></p><p>登入帳號。</p><p>裡面出現一份新的 PDF。</p><p>我打開它。</p><p>第一頁寫著：</p><blockquote><strong><em>Your application to work in Canada has been initially approved.</em></strong></blockquote><p>我的申請核准了。 IMM5812_1–17OVK25B</p><p>Letter of Introduction 的有效期限是：</p><p><strong>2027 年 9 月 29 日。</strong> IMM5812_1–17OVK25B</p><p>從 2025 年開始進 IEC Pool，到 2026 年重新申請、收到 Invitation、準備文件、Biometrics、澳洲警察證明、Queensland 補件、Certified Copy、延期……</p><p>終於結束了。</p><h3>但我後來發現，真正的問題現在才開始</h3><p>拿到 POE Letter，不代表我已經拿到加拿大人生。</p><p>甚至嚴格來說，這封信本身還不是最終 Work Permit。</p><p>我要實際抵達加拿大，在 Port of Entry 接受最後審查，符合條件後，才會取得真正的 Work Permit。 IMM5812_1–17OVK25B</p><p>所以 9 月 29 日之後，我開始問的問題完全變了。</p><p>以前是：</p><blockquote><strong><em>「加拿大會不會讓我去？」</em></strong></blockquote><p>現在變成：</p><blockquote><strong><em>「我要怎麼去？」</em></strong></blockquote><p>我要存多少錢？</p><p>第一站去哪裡？</p><p>Vancouver？</p><p>Calgary？</p><p>工作怎麼找？</p><p>加拿大的 .NET Developer 薪水多少？</p><p>房租多少？</p><p>一個月生活費多少？</p><p>英文面試怎麼辦？</p><p>我的 C# 程度夠不夠？</p><h3>我不想只是去加拿大打工度假</h3><p>這也是這一年裡，我自己最大的改變之一。</p><p>剛開始 IEC 對我來說是：</p><p><strong>加拿大 Working Holiday。</strong></p><p>可是當我真的成為 Software Developer 之後，我開始有另外一個想法。</p><p>我不想到了加拿大以後，把現在累積的東西全部丟掉。</p><p>我希望自己在台灣累積的 C#、ASP.NET、SQL Server、企業系統維護經驗，可以繼續接下去。</p><p>所以我的目標慢慢從：</p><blockquote><strong><em>「去加拿大。」</em></strong></blockquote><p>變成：</p><blockquote><strong><em>「以 Software Developer 的身分去加拿大生活。」</em></strong></blockquote><p>這兩句話看起來很像。</p><p>對我而言，卻是完全不同的事情。</p><h3>所以我沒有馬上出發</h3><p>我的 POE 可以到 2027 年 9 月 29 日以前入境。 IMM5812_1–17OVK25B</p><p>而我目前的計畫，是先繼續工作。</p><p>把現在這份 Software Developer 的經驗累積下去。</p><p>每天繼續學英文。</p><p>每天繼續補 C#。</p><p>準備英文面試。</p><p>存錢。</p><p>然後再決定我的第一站。</p><p>我現在比較傾向 Calgary，也還在考慮 Vancouver。</p><p>Vancouver 有朋友。</p><p>但我知道，真正到了加拿大以後，生活終究還是得靠自己。</p><p>所以我現在不是在等 2027 年到來。</p><p>我是想利用這段時間，讓明年出發的那個自己，比現在更有能力一點。</p><h3>從 2025 年 6 月到現在</h3><p>如果只看結果，其實一句話就講完了：</p><blockquote><strong><em>我轉職成為軟體工程師，然後拿到了加拿大 Working Holiday。</em></strong></blockquote><p>但真正活過這段時間，就知道中間不是一句話。</p><p>有很多：</p><p><strong>「我真的可以嗎？」</strong></p><p>有很多：</p><p><strong>「這到底要怎麼處理？」</strong></p><p>也有很多次只是把眼前的事情做完，再處理下一件。</p><p>我沒有突然變得很厲害。</p><p>英文現在還是要學。</p><p>C# 還是要學。</p><p>錢還是要存。</p><p>加拿大也還沒有工作在等我。</p><p>我甚至不知道 2027 年真的站在加拿大的時候，事情會不會跟我現在想的一樣。</p><p>但有一件事情，我現在可以確定。</p><p>2025 年 6 月，我開始重新學習怎麼成為一個工程師。</p><p>2026 年 9 月，我拿到了一張可以前往加拿大工作的入場券。</p><p>接下來，我想試試看能不能把這兩條原本不同的路，走成同一條。</p><p><strong>不是因為我已經準備好了才出發。</strong></p><p>而是這一年多，我慢慢明白：</p><p><strong>很多事情，本來就是在還沒準備好的時候開始的。</strong></p><p>而現在的我，至少已經比 2025 年 6 月的自己，多走了一段路。</p><p>還有你現在在澳洲或其他國家，準備下一個地方是加拿大，那就乖乖去換駕照，你可以免去一大堆麻煩，甚至是有年限的文件，可以在當地先申請就先去申請，講真的這些過程之前我真的好幾度想放棄…..。</p><p>希望這文章可以幫助到其他人。</p><p>最後是這過程的所有費用，給大家作為參考。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*2nphw3wddjuPSycYsx0NtQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=255a0e6b4312" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[我有個大膽的想法？]]></title>
            <link>https://medium.com/@killpmite/%E6%88%91%E6%9C%89%E5%80%8B%E5%A4%A7%E8%86%BD%E7%9A%84%E6%83%B3%E6%B3%95-aca8e00211d0?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/aca8e00211d0</guid>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[hand-coded]]></category>
            <category><![CDATA[c-sharp-development]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 06:05:27 GMT</pubDate>
            <atom:updated>2026-09-20T06:50:22.577Z</atom:updated>
            <content:encoded><![CDATA[<p>當今現在AI的模型日新月異的進步速度快得驚人，我想要做一個完全相反的事情，也是做一種壓力輸出，不管是不是現在工作中會用到的 C#/ASP.NET 還是以前想玩的Swift的等等等等，Go？Rust? Ruby ? (py我目前還好，這個我目前沒有太多想法)，但這些都不是重點，重點是我想要就是純手工手打coding (hand-coded) ，有些人也會說：那你就去參加鐵人賽啊，以目前的我一定會失敗，根據我對我自己的認識的XDDD，所以這個逆風想法，感覺是吃力不討好…。</p><p>hand-coded 找一個有興趣的項目去長期實作（不是長崎蛋糕），希望可以轉移目標去做任何事，但好笑的是怎麼開始是一個問題，光是上一段就已經有顯現出一個問題，選擇困難的問題，到底要選什麼？ 通常這個問題的問題本身就是答案，應該要是哪個可以解決我的「問題」，無論是生活上的還是工作上輔助的都可以，生活貼近的應該是Swift，如我是工作應該是C#，畢竟最近code review被釘在牆壁上，但在釘在牆壁上之前，我就有想過這跟是，即時我把程式碼拆開看，看得懂了，但別人在問的時候我卻一句話都說不出來，感覺就跟學英文一樣，我整個信心有點挫敗。</p><p>也是想說要不要參加Toocon當講師，玩玩看（？）（但我何德何能）</p><p>那，今天發完之後，我應該就會想要知道我的Hand-coded 要玩什麼？</p><ol><li>我想要Hand-coded的目的是什麼？</li><li>要到成什麼程度？</li><li>怎麼保持？ （因為很容易取得AI的便利誘因）</li></ol><p>大概這三點，根據現在的自己，要達標都很難。</p><p>所以先有個什麼，我在繼續看怎麼進行吧，拋下過度計畫，造成延遲拖延。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aca8e00211d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Side Project DDD — PM進度 WebAPP-Day06 CI/CD/Dockerize(先行版)]]></title>
            <link>https://medium.com/@killpmite/side-project-ddd-pm%E9%80%B2%E5%BA%A6-webapp-day06-ci-cd-dockerize-%E5%85%88%E8%A1%8C%E7%89%88-81251b3fae7b?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/81251b3fae7b</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[ci-cd-devops]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 05:25:02 GMT</pubDate>
            <atom:updated>2026-04-07T05:25:02.369Z</atom:updated>
            <content:encoded><![CDATA[<p>接下來要做的就是 Github(我有聽沒有懂的項目，嘗試用更簡單的方式去理解這些事) -&gt; CI/CD 持續整合更新腳本，然後容器化之後，反代理直接上架。</p><ol><li>但目前架構有個<strong>致命點</strong>就是當我部屬好了以後，我的SQL在伺服器上是沒有的，所以可能要搞一個Docker版本的SQL Server (mcr.microsoft.com.mssql/sever)的容器。</li><li>弄好之後還要去修正Appsetting.json的連線要指向伺服器IP。</li><li>因為偷吃步讓HTTPS去繞過憑證，部屬後會讓手機相機無法運作，所以我還要一個方式讓我的IP 變成 Domain。</li></ol><p>所以現在就是要進行</p><p><strong>A.版本控制</strong>: GitHub <br><strong>B.CI/CD 工具</strong>: <strong>GitHub Actions</strong> (免費且與 GitHub 整合度最高)<br><strong>C.容器化</strong>: <strong>Docker</strong> (這是微服務的靈魂，把每一塊功能打包成獨立容器)</p><p><strong>D.部署環境</strong>: (但感覺先地端-之前在弄Rpi to Ubuntu + Docker 是有成功的而且還可以反代理直接連線)<br><strong>地端方案</strong>: 自己的 Linux 伺服器 (Ubuntu + Docker Compose)。</p><p>那這邊先把專案容器化</p><p>Step01.後端 Dockerfile (Identity.API 專案下)</p><pre># 使用 .NET 8 執行環境<br>FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base<br>WORKDIR /app<br>EXPOSE 8080<br>EXPOSE 8081<br><br># 使用 SDK 進行編譯<br>FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build<br>WORKDIR /src<br>COPY [&quot;Identity.API/Identity.API.csproj&quot;, &quot;Identity.API/&quot;]<br>COPY [&quot;Identity.Domain/Identity.Domain.csproj&quot;, &quot;Identity.Domain/&quot;]<br>COPY [&quot;Identity.Infrastructure/Identity.Infrastructure.csproj&quot;, &quot;Identity.Infrastructure/&quot;]<br>RUN dotnet restore &quot;Identity.API/Identity.API.csproj&quot;<br>COPY . .<br>RUN dotnet build &quot;Identity.API/Identity.API.csproj&quot; -c Release -o /app/build<br><br>FROM build AS publish<br>RUN dotnet publish &quot;Identity.API/Identity.API.csproj&quot; -c Release -o /app/publish<br><br>FROM base AS final<br>WORKDIR /app<br>COPY --from=publish /app/publish .<br>ENTRYPOINT [&quot;dotnet&quot;, &quot;Identity.API.dll&quot;]</pre><p>Step02.後端 Dockerfile (Identity.API 專案下)</p><pre># 1. 編譯階段<br>FROM node:20 AS build-stage<br>WORKDIR /app<br>COPY package*.json ./<br>RUN npm install<br>COPY . .<br>RUN npm run build<br><br># 2. 運行階段 (使用 Nginx 啟動)<br>FROM nginx:stable-alpine AS production-stage<br>COPY --from=build-stage /app/dist /usr/share/nginx/html<br>EXPOSE 80<br>CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]</pre><p>Step03.編寫 CI/CD 腳本 (GitHub Actions)</p><pre>name: Deploy PM System<br><br>on:<br>  push:<br>    branches: [ main ] # 只有推送到 main 分支時才啟動<br><br>jobs:<br>  build-and-deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: 檢出程式碼<br>        uses: actions/checkout@v3<br><br>      - name: 登入 Docker Hub<br>        uses: docker/login-action@v2<br>        with:<br>          username: ${{ secrets.DOCKER_USERNAME }}<br>          password: ${{ secrets.DOCKER_PASSWORD }}<br><br>      - name: 打包並推送後端鏡像<br>        run: |<br>          docker build -t my-username/pm-backend:latest -f Identity.API/Dockerfile .<br>          docker push my-username/pm-backend:latest<br><br>      - name: 打包並推送前端鏡像<br>        run: |<br>          docker build -t my-username/pm-frontend:latest -f my-pm-web/Dockerfile .<br>          docker push my-username/pm-frontend:latest<br><br>      # 這裡可以加入部署到伺服器的指令 (SSH 遠端更新)</pre><p>Step04.解決資料庫問題 (SQL Server)</p><p><strong>LocalDB 限制</strong>：部署後，剛剛有提到因為伺服器裡沒有(localdb)\mssqllocaldb無法使用 。<br><strong>Docker 版 SQL Server</strong>：在部署環境啟動一個 mcr.microsoft.com/mssql/server 容器。<br><strong>修改連線字串</strong>：將 appsettings.json 的連線指向正式伺服器的 IP。</p><p>Step05.HTTPS (相機與 OCR 的原先方法無效)</p><p>部署到正式環境後，你<strong>絕對需要一個正式的 HTTPS 憑證</strong>，否則手機相機無法運作。</p><p><strong>推薦做法</strong>: 使用 <strong>Cloudflare</strong> 或 <strong>Let’s Encrypt (Nginx Proxy Manager)</strong>。該雲可以幫我把 IP 變成 domain。</p><p>在這幾天做的過程，我會陸續更新，目前先把大概藍圖做好，希望可以成功，也希望大家看得習慣。</p><p>一起努力變成軟體工程師吧。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81251b3fae7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Side Project DDD — PM進度 WebAPP-Day05 (基本架構完成)]]></title>
            <link>https://medium.com/@killpmite/side-project-ddd-pm%E9%80%B2%E5%BA%A6-webapp-day05-%E5%9F%BA%E6%9C%AC%E6%9E%B6%E6%A7%8B%E5%AE%8C%E6%88%90-46c780d24b60?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/46c780d24b60</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[ocr-tesseract]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 11:57:36 GMT</pubDate>
            <atom:updated>2026-04-06T13:08:14.391Z</atom:updated>
            <content:encoded><![CDATA[<h3>邁向智慧工廠 ：整合 Gemini 2.5 AI 辨識與影像預處理實戰</h3><h4>1. 前言：讓 AI 成為工程師的眼睛</h4><p>在產線維修或品管查驗時，手動輸入長串的序號或備註不僅沒效率，更容易出錯。Day 05 的目標是實作 <strong>AI OCR (光學字元辨識)</strong>，讓作業員拍一張照，系統自動讀出文字並填入備註。這不僅是「科技感」，更是實實在在的「生產力」，一開始使用內建的Tesseract，辨識出來真得慘不忍睹(如圖)。chi_tra.traineddata / eng.traineddata 這個下去辨識。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*gaaKSvFKNbFSkNne6OPJ3Q.jpeg" /><figcaption>就是有點慘不忍睹，目前還沒考慮要訓練。</figcaption></figure><h4>2. 算是被震撼教育了：與 Google API 的攻防戰</h4><p>今天遇到的 404 與 429 挑戰，這是今天最有價值的「問題」：<strong>404 Not Found 的真相</strong>：我們發現 API Key 的權限是有「代溝」的。強行呼叫舊版 1.5 模型會導致路徑失效，途中換成2.0就覺得會變成429 Too many Requests，我的直覺就是1.5不能用，再重新去檢查我的C#跟Vue的Code，再問問AI再三檢查發現，是沒什麼問題，而且API key 是新建立的，不可能不行，有問題的話我的對話也應該會被拒絕。<br>最終透過連線自己的<a href="https://generativelanguage.googleapis.com/v1beta/models?key=">https://generativelanguage.googleapis.com/v1beta/models?key=</a>(自己的Key)) 清單看看權限到哪，發現了可以使用最強大的 <strong>Gemini 2.5 Flash</strong> 權限。</p><p><strong>429 Too Many Requests 的死穴</strong>：<br><strong>痛點</strong>：手機拍出來的 4K 照片（4032px）對於免費版 AI 來說太過沉重，Token 消耗瞬間爆表。<br><strong>體悟</strong>：不要把雲端 AI 當成無限資源，要學會「勤儉持家」。所以我在程式中加了SixLaborsImageSharp：(Powershell)</p><pre>Install-Package SixLabors.ImageSharp -ProjectName Identity.API</pre><pre>using SixLabors.ImageSharp;<br>using SixLabors.ImageSharp.Processing;</pre><pre>using (var image = Image.Load(imageBytes))<br>{<br>    // 將4K照片縮小到1024p，文字依然極度清晰，但Token消耗減少10倍<br>    image.Mutate(x =&gt; x.Resize(new ResizeOptions { Size = new Size(1024, 1024), Mode = ResizeMode.Max }));<br>    using (var ms = new MemoryStream())<br>    {<br>        image.SaveAsJpeg(ms, new SixLabors.ImageSharp.Formats.Jpeg.JpegEncoder { Quality = 80 });<br>        base64Image = Convert.ToBase64String(ms.ToArray());<br>    }<br>}</pre><p>然後看到成功辨識之後，感動滿分。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*o7TgyD5d2jve9XirwOgPaQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s54j6nRMbkg9sbsjkm6H3Q.jpeg" /><figcaption>(左邊成功之後，右邊為原本照片，箭頭是發現點開照片沒有XX可以關閉，會造成操作異常而新增X)</figcaption></figure><h4>6. 結語：結束是另一個開始</h4><p>這不是一個結束，而是一個可以無限擴張的平台。未來我們可以加入 Google Sheets 同步(C#裡面有程式碼了)、大數據預測良率，甚至是更強大的 PWA 離線操作功能。</p><blockquote><strong><em>技術金句</em></strong><em>：「一名優秀的開發者，不僅要會寫邏輯，更要學會與雲端世界的規則優雅共存。」<br>(請AI給的，聽起來挺囂張的)</em></blockquote><p>但這只是開始，後續還有很多東西可以玩，像是更完整的微服務，如果可以的話我會打包上Github (最不擅長的也是要練習一下)</p><h4>專案總結：這 5 天我們學到了什麼？</h4><p>回顧這場從零開始的冒險：<br><strong>Day 01</strong>：建立了前後端分離的 <strong>DDD 微服務架構</strong>。<br><strong>Day 02</strong>：實作了 <strong>QR Code 掃描登入與 JWT 安全通行證</strong>。<br><strong>Day 03</strong>：開發了 <strong>動態生產看板與 Excel 報表自動生成</strong>。<br><strong>Day 04</strong>：設計了 <strong>5 大角色權限鏈與 6 格照片追蹤系統</strong>。<br><strong>Day 05</strong>：成功導入 <strong>Gemini 2.5 Flash AI 辨識</strong>，實現自動化報工。<br>接下來就是一些小需求或功能的新增而已，比方說各列表的進度總表之類的。</p><p>目前就這樣，這一關卡了好久好久，還好有先去吃個晚餐再回來就順利完成了，果然是Debug才會學得多啊，所幸有再持續想做一些功能~。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46c780d24b60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Side Project DDD — PM進度 WebAPP-Day04]]></title>
            <link>https://medium.com/@killpmite/side-project-ddd-pm%E9%80%B2%E5%BA%A6-webapp-day04-69cf20706e41?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/69cf20706e41</guid>
            <category><![CDATA[pp]]></category>
            <category><![CDATA[ddd]]></category>
            <category><![CDATA[pm]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[csharp]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 09:43:35 GMT</pubDate>
            <atom:updated>2026-04-05T09:43:35.892Z</atom:updated>
            <content:encoded><![CDATA[<h3>工業級 Workflow 實踐 — — 打造多角色權限鏈與案情追蹤系統</h3><p>感覺搞得好像要寫書一樣XD</p><h4>1. 前言：當 App 遇上真實的生產流程</h4><p>在實驗室開發 App 時，我們習慣「所有人都能做所有事」。<br>但在真實工廠：工程師只負責修，不能隨便結案。<br>品管負責驗收，不能改生產排程。<br>PP/PM 負責調度，必須知道是誰要求「插單」。<br>今天，我們將這套 <strong>權限等級 (Role 0–4)</strong> 注入系統，實現真正的數位轉型。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1lGPCOKd7DcGdTAUMNvu7w.png" /><figcaption>記事本寫下權限使用內容或需要更新內容，故不先用Figma去化架構</figcaption></figure><h4>2. 權限矩陣：誰才是老大？</h4><p>分享我們設計的五大角色權限：</p><p><strong>Role 0 (訪客/主管)</strong>：純「看板員」，只能在 Dashboard 看大數值。<br><strong>Role 1 (工程師)</strong>：第一線修復，具備 3 張完修拍照權限。<br><strong>Role 2 (品管)</strong>：把關者，可查看維修照，並上傳 3 張出貨照。<br><strong>Role 3 (PP/PM)</strong>：大總管，負責新增案件、緊急插單、強制取消與結案。<strong>Role 4 (系統管理員)</strong>：上帝視角，擁有所有功能 + 稽核日誌 (Audit Log) 查詢。</p><blockquote><strong><em>技術金句</em></strong><em>：<br>「權限不是限制，是為了確保每一筆數據的真實性與不可否認性。」</em></blockquote><h4>3. 核心業務邏輯：多階段案情追蹤</h4><p>詳細介紹這次的兩大流程進化：</p><p><strong>1.維修接手制</strong>：維修查看後，上傳照片記錄進度（上限 3 張），系統自動標記「維修中」。<br>2.<strong>品管接手制</strong>：維修結案後由 PP 啟動品管流程，品管上傳出貨照片（上限 3 張）。</p><p><strong>資料庫實體擴充 (C# snippet)：</strong></p><pre>public class JobOrder {<br>    public string? RepairImg1 { get; set; } // 維修快照<br>    public string? QCImg1 { get; set; }     // 出貨快照<br>    public bool IsQATriggered { get; set; } // 流程連鎖開關<br>    public string? CancelReason { get; set; } // 50字取消鐵證<br>}</pre><h4>4. 安全性與透明度：行為日誌 (Audit Log)</h4><p>系統中任何「插單」或「取消」都必須留下痕跡：</p><p><strong>插單責任制</strong>：按下緊急插單按鈕時，必須輸入「要求人工號」<br><strong>取消理由書</strong>：取消任務必須輸入 50 字簡述，防止隨意刪單。<br><strong>日誌搜尋頁</strong>：為 Role 4 打造的專屬後台，可自訂時間範圍搜尋所有人的「黑歷史」。</p><h4>5. 開發筆記：那些讓我們頭痛的細節 (Debug 經驗)</h4><p>這部分可以分享這兩天解決的坑：</p><p><strong>白底白字的視覺陷阱</strong>：在實作深色模式時，斑馬紋背景與文字顏色的優先級衝突（ lesson: 永遠要有備用背景色設定）。<br><strong>415 格式衝突</strong>：Axios 傳送 JSON 字串與 C# [FromBody] 接收物件的配對問題（lesson: 建立 DTO 是解決溝通障礙的最好良藥）。<br><strong>3 天到期預警</strong>：利用 Vue 的計算邏輯，當 ExpectedDate &lt;= 3 天時，讓卡片變紅並閃爍，實現自動催稿功能。(PP跟PM最怕的提示)</p><h4>6. 結語：App 的靈魂在於「流程」</h4><p>Day 04 的更新，讓 App 從「記錄器」變成了「執行者」。透過權限的分級，我們保護了數據；透過 Log 的紀錄，我們建立了信任。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*_QI3-CBzHNe0VjcMNPFiXw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*YqqzG004pGctTqY0CI9dNA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*EitpSFR-V2ffybQt1OXDfg.jpeg" /><figcaption>目前的頁面長這樣，真的改了一些，並且也新增了部分東西，但是日夜轉換畫面我有先做，但做完會有干涉，之後有其他想法我在修正。</figcaption></figure><h3>第二部分：Day 04 技術深挖 — — 「3 天到期警告」的 JS 邏輯</h3><p>這部分你可以直接放進部落格的「技術專題」區塊，解釋你如何用程式碼落實管理規則。</p><h4>1. 業務需求描述</h4><p>管理端希望系統能自動「催稿」。如果一張工單的預計完成日距離今天<strong>小於等於 3 天</strong>，且該工單<strong>尚未結案</strong>，系統必須發出強烈的視覺警告。</p><h4>2. 代碼實作解析 (Vue 3)</h4><p>我們在 Dispatch.vue 寫了一個「智慧判定函數」：</p><pre>// date: 預計完成日, status: 目前工單狀態<br>const isWarning = (date, status) =&gt; {<br>  // 1. 如果已經結案了，就不需要警告<br>  if (status === &#39;結案&#39; || !date || date.startsWith(&#39;0001&#39;)) return false;<br><br>  // 2. 取得今天與目標日期的毫秒差<br>  const targetDate = new Date(date);<br>  const today = new Date();<br>  <br>  // 3. 計算天數差距 (毫秒 / 一天的毫秒數)<br>  const diffTime = targetDate - today;<br>  const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));<br><br>  // 4. 回傳是否進入「危險期」(&lt;= 3天)<br>  return diffDays &lt;= 3;<br>};</pre><h4>3. 視覺層的聯動 (CSS Binding)</h4><p>在 Template 裡，我們利用 Vue 的動態類別綁定，達成「變紅、閃爍」的效果：</p><pre>&lt;!-- 如果 isWarning 為 true，就掛上 warning-border 這個 class --&gt;<br>&lt;van-cell-group <br>  inset <br>  class=&quot;order-card&quot; <br>  :class=&quot;{ &#39;warning-border&#39;: isWarning(item.expectedDate, item.status) }&quot;<br>&gt;<br>  &lt;!-- 內容 --&gt;<br>&lt;/van-cell-group&gt;</pre><p>「這段邏輯看似簡單，卻是 MES 系統中 <strong>『主動式管理』</strong> 的核心。與其讓 PM 每天翻報表看誰快逾期，不如讓系統直接把逾期的單子『燒起來』。這就是數位化管理從『紀錄』轉向『提醒』的重要分水嶺。」</p><p><strong>C# 核心實作 (Audit Log Service):</strong></p><pre>[HttpPost(&quot;cancel/{id}&quot;)]<br>public async Task&lt;IActionResult&gt; CancelOrder(Guid id, [FromBody] CancelReq req) {<br>    var order = await _context.JobOrders.FindAsync(id);<br>    <br>    // 寫入 ActionLog 表<br>    _context.ActionLogs.Add(new ActionLog {<br>        Account = GetCurrentUserAccount(), // 從 JWT 抓人<br>        Action = &quot;工單取消&quot;,<br>        Detail = $&quot;單號:{order.OrderNo}, 原因:{req.Reason}&quot;, // 這裡存入那 50 字<br>        Timestamp = DateTime.Now<br>    });<br><br>    order.Status = &quot;已取消&quot;;<br>    await _context.SaveChangesAsync();<br>    return Ok();<br>}</pre><p>「今天的開發讓我體會到，一個好的 PM 系統，不僅僅是把資料存進資料庫，更是要定義 <strong>『誰在什麼時候、憑什麼證據 (照片)、做了什麼決定』</strong>。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69cf20706e41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Side Project DDD — PM進度 WebAPP-Day02+03]]></title>
            <link>https://medium.com/@killpmite/side-project-ddd-pm%E9%80%B2%E5%BA%A6-webapp-day02-03-38cfd2f1e068?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/38cfd2f1e068</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[vue]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 15:24:43 GMT</pubDate>
            <atom:updated>2026-04-04T15:26:46.805Z</atom:updated>
            <content:encoded><![CDATA[<p>前情提要，前天搞定了iOS/iPadOS的相機權限與憑證問題，改成Https的方式，讓QRcode可以正常運作，並且可以讓QRcode存入SQL裡面</p><p>Day02的部分就是把登入做進來吧~</p><p>1. 前言：為什麼選擇 QR Code 登入？<br><strong>痛點</strong>：在產線環境下，作業員戴手套或頻繁走動，輸入長密碼非常不便。<br><strong>解決方案</strong>：利用識別證上的固定 QR Code 作為身分憑證，結合手機鏡頭，達成「秒級登入」。<br><strong>安全考慮</strong>：雖然 QR Code 是固定的，但後端採用 <strong>BCrypt 加鹽雜湊</strong> 與 <strong>JWT (JSON Web Token)</strong>，確保傳輸過程與資料庫安全。</p><p>2. 後端核心：DDD 架構下的登入邏輯 (C# .NET 8)<br><strong>Domain 層</strong>：定義 User 實體與 IPasswordHasher 介面。<br><strong>Application 層</strong>：實作 LoginAsync 業務邏輯，驗證帳號是否存在。<br>使用 BCrypt.Verify 比對掃描到的內容與資料庫雜湊值。<br>核發 JWT 通行證。</p><p><strong>API 層</strong>：暴露 POST /api/Auth/login 接口。</p><blockquote><strong><em>技術<br>金句</em></strong><em>：「後端不存密碼明文，只存雜湊，這是一個開發者的基本修養。</em></blockquote><h4>3. 前端實戰：行動端優先的掃描體驗 (Vue 3)</h4><p>分享如何使用 Vant UI 打造極簡界面：<br><strong>元件選型</strong>：使用 van-field 輸入工號，html5-qrcode 驅動相機。<br><strong>HTTPS 門檻</strong>：分享你在開發過程中遇到的「iOS 相機必須要有 HTTPS」的坑，以及如何用 basic-ssl 繞過它。<br><strong>路由守衛</strong>：登入成功後，利用 localStorage 存儲 Token，並使用 router.push(‘/dashboard’) 跳轉。</p><p>4. 遇到的挑戰與解決 (這是讀者最愛看的部分)<br><strong>CORS 跨域問題</strong>：後端必須配置 app.UseCors(“AllowAll”)，前端才能順利敲門。<br><strong>SSL 憑證信任</strong>：在開發環境下，手機必須手動點擊「進階 -&gt; 繼續前往」來信任本機 IP。</p><p><strong>後端登入邏輯:</strong></p><pre>// Login.vue <br>const handleLogin = async () =&gt; {<br>  const res = await axios.post(&#39;/api/Auth/login&#39;, { account, qrCodeContent });<br>  if (res.data.token) {<br>    localStorage.setItem(&#39;token&#39;, res.data.token); // 存入通行證<br>    router.push(&#39;/dashboard&#39;); // 進入系統<br>  }<br>};</pre><h3>補充:技術專題：為什麼微服務都愛 JWT？</h3><h3>數位通行證的奧秘</h3><p>在 Day 02 的實作中，我們完成登入後，後端會回傳一串以 eyJ… 開頭的超長字串。這就是 <strong>JWT (JSON Web Token)</strong>。</p><h4>1. 什麼是 JWT？（生活化比喻）</h4><p>想像你進去一間大型遊樂園（你的系統）：</p><p><strong>傳統 Session 登入</strong>：就像你在入口處登記名字，領一個號碼牌。樂園的後台電腦必須「記住」你的號碼牌對應是誰。如果樂園太大（微服務），每個分館都要連回後台問「這個號碼牌是誰的？」，效率會很低。</p><p><strong>JWT 登入</strong>：就像入口處發給你一張「經過特殊蓋章的數位通行證」。這張紙上寫著你的名字、到期時間，而且印有樂園的「防偽印章」。不論你走到哪個場館，管理員只要看到印章是真的，就直接讓你進去，<strong>不需要再去問後台</strong>。</p><h4>2. JWT 的構造：三位一體</h4><p>JWT 由三個部分組成，中間用「點 .」隔開：</p><p><strong>Header (標頭)</strong>：<br>告訴系統這是一個 JWT，以及它是用什麼算法加密的（例如 HS256）。<strong>Payload (負載)</strong>：<br>這是最關鍵的部分。裡面放的是<strong>使用者的資料</strong>（例如：工號 J0570、使用者 ID、權限）。</p><p><strong>注意</strong>：這部分只是 Base64 編碼，任何人都能解碼看內容，所以<strong>絕對不能放密碼或身分證字號</strong>！</p><p><strong>Signature (簽名)</strong>：<br>這是防偽的核心。後端會拿「Header + Payload + <strong>私鑰 (Secret Key)</strong>」進行雜湊。如果駭客改了 Payload 裡的權限，簽名就會對不上，伺服器會立刻發現這張票是偽造的。</p><h4>3. JWT 的運作流程</h4><p><strong>用戶登入</strong>：手機掃描識別證 QR Code 傳給後端。<br><strong>核發通行證</strong>：後端確認身分正確，把「工號、過期時間」包成 Payload，用私鑰簽名，產生 JWT 回傳。<br><strong>前端儲存</strong>：Vue 將這串 eyJ… 存入手機的 localStorage。<br><strong>後續呼叫</strong>：之後當你要「下載 Excel」或「緊急插單」時，前端會在 HTTP Header 加入 Authorization: Bearer &lt;Token&gt;。<br><strong>後端驗證</strong>：後端只需要用私鑰「算一下」簽名對不對，就能確定你的身分。</p><h4>4. 在本專案 (DDD 架構) 中的優勢</h4><p>為什麼我們在微服務中使用它？</p><p><strong>無狀態 (Stateless)</strong>：後端資料庫不需要儲存 Session。這對於我們未來要切成「生產微服務」、「報表微服務」非常方便，因為每個服務只要有私鑰，就能自己核對身分，不需要互相詢問。<br><strong>跨域友善</strong>：我們的手機 Vue (Port 5173) 和 C# API (Port 7208) 是不同網域，JWT 處理起來比 Cookie 簡單得多。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WjLhcBY6ScKvRl7sKSCO1g.png" /><figcaption>登入後，Console會顯示JWT (錯誤示範WWW這樣非常有資安問題)</figcaption></figure><p><strong>關於照片的問題，修改方法是 將前端的Login.vue的程式碼：<br></strong>第一層：初級隱蔽，刪除 console.log</p><pre>// 直接執行儲存與跳轉：<br>localStorage.setItem(&#39;token&#39;, res.data.token);<br>router.push(&#39;/dashboard&#39;);</pre><p>基本的效果就是使用者F12看控制台，也不會看到字串。<br>第二層：進階管理 ，使用 Axios 攔截器 (Interceptor)</p><p><strong>1.建立 src/api/axios.js</strong></p><pre>import axios from &#39;axios&#39;;<br><br>const instance = axios.create({<br>  baseURL: &#39;https://Your IP Address&#39;<br>});<br><br>// 自動「隱形」注入 Token<br>instance.interceptors.request.use(config =&gt; {<br>  const token = localStorage.getItem(&#39;token&#39;);<br>  if (token) {<br>    config.headers.Authorization = `Bearer ${token}`; // 在背後默默塞入 Header<br>  }<br>  return config;<br>});<br><br>export default instance;</pre><p>2<strong>. 在 Dashboard.vue 使用時：</strong></p><pre>import api from &#39;@/api/axios&#39;; // 引入自定義的隱形 api 工具<br><br>const fetchOrders = async () =&gt; {<br>  const res = await api.get(&#39;/api/Dispatch/list&#39;); // 這裡完全不用管 Token<br>  orders.value = res.data;<br>};</pre><p><strong>效果</strong>：程式碼變乾淨了，Token 像空氣一樣存在，但你看不到它被處理的過程。</p><p><strong>第三層：終極隱蔽 — — HttpOnly Cookie (業界最高規範)</strong></p><p>銀行或大型電商工作，他們連 localStorage 都不准你存，因為 localStorage 可以被惡意的 JavaScript 腳本讀取（XSS 攻擊）。</p><p>他們會使用 <strong>HttpOnly Cookie</strong>：</p><ol><li><strong>後端 C# 修改</strong>：登入成功後，不把 Token 放進 JSON 回傳，而是塞進一個特殊的 Cookie：</li></ol><pre>Response.Cookies.Append(&quot;token&quot;, token, new CookieOptions {<br>    HttpOnly = true, // 核心：前端 JavaScript 完、全、拿、不、到，連 console.log 都印不出來<br>    Secure = true,   // 只在 HTTPS 下傳輸<br>    SameSite = SameSiteMode.Strict<br>});</pre><p><strong>2. 前端 Vue 修改</strong>：前端完全不需要 localStorage.setItem。</p><p><strong>3. 自動傳送</strong>：瀏覽器只要發現有這個 Cookie，每次呼叫 API 時會「自動且隱形」地帶上它，前端工程師甚至不用寫任何程式碼去處理。</p><p><strong>效果</strong>：這才是真正的「隱形」。JavaScript 拿不到，駭客偷不到，只有瀏覽器跟伺服器知道鑰匙在哪。</p><p>與其在每個頁面都手動寫一次「拿 Token、塞 Header」，業界會把這件事「隱藏」在設定檔裡。這樣你的業務代碼中完全不會出現 Token 字眼。</p><h3><strong>Day 03 的主題：讓數據說話 — — 打造動態生產看板、緊急插單系統與 Excel 報表輸出</strong></h3><p>從單純的「身分驗證」跨入「核心業務邏輯」。我們會分享如何用最直觀的方式，讓產線人員在手機上完成複雜的排程與報表工作。</p><h4>1. 前言：從「我是誰」到「我要做什麼」</h4><p>完成了 Day 02 的安全門禁後，我們今天的目標是解決產線管理的三大核心需求：</p><p><strong>可視化</strong>：一眼看出產量與良率趨勢。<br><strong>機動性</strong>：面對緊急訂單，如何「秒速插單」。<br><strong>報表力</strong>：隨時產出 Excel 數據報表。</p><h4>2. 視覺化大看板：ECharts 與動態控制</h4><p>分享你最自豪的「個別勾選」折線圖功能：<br><strong>技術亮點</strong>：使用 echarts 結合 Vue 3 的響應式變數。<br><strong>使用者體驗 (UX)</strong>：使用者可以透過開關（Switch）決定要看「產量」、「NG 數」還是「過期數」。<br><strong>代碼精華</strong>：展示 updateChart 函數如何根據 ref 的狀態動態重組 series 陣列。</p><h4>3. 核心業務邏輯：優先級排程 (Priority Dispatching)</h4><p>這是專案的靈魂，也是 PP 派工的縮影：<br><strong>資料庫設計</strong>：在 JobOrders 表中引入 Priority 欄位。<br><strong>插單演算法</strong>：當「緊急插單」按下時，後端將該單的 Priority 設為 0，並在讀取清單時使用 .OrderBy(o =&gt; o.Priority)。<br><strong>前端實現</strong>：使用 Vant UI 的卡片式佈局，讓工單在手機螢幕上一目了然。</p><h4>4. 基礎建設升級：用 C# 產生 Excel (ClosedXML)</h4><p>為什麼不讓前端產報表，而是交給後端？<br><strong>優勢</strong>：後端處理大數據更穩定，且格式完全可控。<br><strong>技術選型</strong>：介紹 ClosedXML，它是操作 .xlsx 檔案最優雅的 .NET 庫。<br><strong>前端處理二進位流</strong>：分享如何用 axios 的 responseType: ‘blob’ 接收檔案並觸發下載。</p><h4>5. 開發筆記：那些讓我們頭痛的「坑」</h4><p><strong>EF Core Migration 衝突</strong>：在多專案架構下，記得要指名 -Project 和 -StartupProject，否則工頭（EF）會找不到工地。<br><strong>響應式比例調整</strong>：為了讓 PC 版也能看得舒適，我們使用了 zoom 縮放與 media query 手動調整圖表高度。</p><p><strong>前端動態圖表過濾 (Vue):</strong></p><pre>const updateChart = () =&gt; {<br>  const series = [];<br>  if (showOutput.value) series.push({ name: &#39;產量&#39;, data: outputData, color: &#39;#1989fa&#39; });<br>  if (showNg.value) series.push({ name: &#39;NG&#39;, data: ngData, color: &#39;#ee0a24&#39; });<br>  // 這就是「個別勾選」的神奇之處<br>  myChart.setOption({ series: series }, true);<br>};</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bcPM3BCtkInLtnTNSWZCGg.png" /><figcaption>PC的樣子</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*FHlicg7ePuL_SPuFQC1Uww.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*LFveF4xFqfk68sNAg21oMg.jpeg" /><figcaption>手機上的樣子</figcaption></figure><p>進度就一步一步的更新，希望它會越來越完整。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38cfd2f1e068" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Side Project DDD - PM進度 WebAPP-Day01]]></title>
            <link>https://medium.com/@killpmite/side-project-ddd-pm%E9%80%B2%E5%BA%A6-webapp-part01-329175288f0f?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/329175288f0f</guid>
            <category><![CDATA[ddd]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[qrcodegenerator]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-apps]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 10:04:44 GMT</pubDate>
            <atom:updated>2026-04-03T15:10:58.170Z</atom:updated>
            <content:encoded><![CDATA[<p>這是一個想要取代Notion，可以給生產製造業或追進度的PM作為使用，並且還可以擁有靈活筆記，還有其他夥伴的進度更進，截圖上傳等頁籤功能。</p><p>使用 <strong>DDD (Domain-Driven Design)</strong> 來設計架構，能確保未來功能擴展（如插單邏輯、產量計算）時，業務邏輯不會與技術細節（如 JWT、QR Code 掃描)</p><pre>Domain Layer (領域層):<br>Entities: User (使用者), LoginLog (登入日誌), Whitelist (白名單)。<br>Value Objects: Password (包含雜湊後的 QR Code ID), Location (經緯度或廠區地點)。<br>Domain Services: PasswordHasher (加鹽雜湊服務)。<br>Application Layer (應用層):<br>Commands: RegisterUserCommand, LoginWithQrCommand。<br>Services: 處理註冊流程（檢查白名單 -&gt; 雜湊 -&gt; 存檔）、處理 JWT 發放。<br>Infrastructure Layer (基礎建設層):<br>Repository 實作 (EF Core / Dapper)。<br>JWT Token 產生器。<br>Interface Layer (API 層):<br>暴露 RESTful API 給 Vue.js 調用。</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*SzOizlQAZflKpszLRVK5NA.png" /><figcaption>目前Part1的進度</figcaption></figure><pre>IdentityService/<br>├── src/<br>│   ├── Identity.Domain/           # 核心業務邏輯 (Entities, Value Objects, Repository Interfaces)<br>│   ├── Identity.Application/      # 應用層 (DTOs, Commands, Services)<br>│   ├── Identity.Infrastructure/   # 基礎建設 (DB Context, Repository Impl, Auth Provider)<br>│   └── Identity.API/              # 入口點 (Controllers, Configurations)</pre><p>1.先建立WebApp = Identity.API再陸續新增Class Library的Identity.Domain、Identity.Application，Identity.Infrastructure</p><p>再陸續將Class Library 進行Add Project Reference。</p><p>然後Identity.Infrastructure 安裝管理 NuGet 套件(N) =&gt; 讓C# 能讀寫 SQL Server 的套件 =&gt;<strong>Microsoft.EntityFrameworkCore.SqlServer 並安裝。<br></strong>接著再搜<strong>Microsoft.EntityFrameworkCore.Tools 並安裝</strong></p><p>在 Data 資料夾內，建立一個新類別 (Class)，命名為 <strong>AppDbContext.cs</strong></p><pre>using Microsoft.EntityFrameworkCore;<br>using Identity.Domain.Entities; // 讓它認識我們剛才建立的 User 和 WhitelistItem<br><br>namespace Identity.Infrastructure.Data;<br><br>public class AppDbContext : DbContext<br>{<br>    // 這是固定寫法，負責接收連線資訊<br>    public AppDbContext(DbContextOptions&lt;AppDbContext&gt; options) : base(options)<br>    {<br>    }<br><br>    // 這兩行代表在資料庫中要建立的「資料表」<br>    public DbSet&lt;User&gt; Users { get; set; }<br>    public DbSet&lt;WhitelistItem&gt; Whitelist { get; set; }<br><br>    protected override void OnModelCreating(ModelBuilder modelBuilder)<br>    {<br>        base.OnModelCreating(modelBuilder);<br><br>        // 設定：Account (帳號) 欄位在資料庫中不可重複 (唯一索引)<br>        modelBuilder.Entity&lt;User&gt;().HasIndex(u =&gt; u.Account).IsUnique();<br>        modelBuilder.Entity&lt;WhitelistItem&gt;().HasIndex(w =&gt; w.Account).IsUnique();<br>    }<br>}</pre><p>Infrastructure 定義了資料庫，但<strong>真正執行程式的是 Identity.API</strong>，所以我們要告訴 API 怎麼連到資料庫。</p><ol><li>在 <strong>Identity.API</strong> 專案下的 <strong>「相依性」</strong> 點 <strong>右鍵</strong> -&gt; <strong>新增專案參考</strong>。</li><li>勾選 <strong>Identity.Infrastructure</strong>，點確定。</li><li>打開 <strong>Identity.API</strong> 專案裡的 <strong>appsettings.json</strong>。</li><li>在 “AllowedHosts”: “*” 的上方，加入這段連線設定（這是指向你電腦內建的簡易 SQL Server）：</li></ol><pre>&quot;ConnectionStrings&quot;: {<br>    &quot;DefaultConnection&quot;: &quot;Server=(localdb)\\mssqllocaldb;Database=IdentityDb;Trusted_Connection=True;MultipleActiveResultSets=true&quot;<br>  },</pre><h3>在 API 專案安裝必要的工具</h3><p>再來<strong>Identity.API =&gt; </strong>也需要安裝 Entity Framework 的工具套件，搜<strong>Microsoft.EntityFrameworkCore.Design</strong></p><h3>設定連線字串 (appsettings.json)</h3><p>我們要告訴程式 SQL Server 的地址。</p><ol><li>打開 <strong>Identity.API</strong> 專案裡的 <strong>appsettings.json</strong>。</li><li>把內容修改成這樣（注意逗點）：</li></ol><pre>{<br>  &quot;Logging&quot;: {<br>    &quot;LogLevel&quot;: {<br>      &quot;Default&quot;: &quot;Information&quot;,<br>      &quot;Microsoft.AspNetCore&quot;: &quot;Warning&quot;<br>    }<br>  },<br>  &quot;AllowedHosts&quot;: &quot;*&quot;,<br>  &quot;ConnectionStrings&quot;: {<br>    &quot;DefaultConnection&quot;: &quot;Server=(localdb)\\mssqllocaldb;Database=IdentityDb;Trusted_Connection=True;MultipleActiveResultSets=true&quot;<br>  }<br>}</pre><h3>第三步：註冊資料庫服務 (Program.cs)</h3><ol><li>打開 <strong>Identity.API</strong> 專案裡的 <strong>Program.cs</strong>。</li><li>在 var builder = WebApplication.CreateBuilder(args); 的<strong>下方</strong>，加入這段程式碼：</li></ol><pre>using Microsoft.EntityFrameworkCore; <br>using Identity.Infrastructure.Data; <br><br>// 註冊 DbContext，並讀取剛才設定的連線字串<br>builder.Services.AddDbContext&lt;AppDbContext&gt;(options =&gt;<br>    options.UseSqlServer(builder.Configuration.GetConnectionString(&quot;DefaultConnection&quot;)));</pre><h3>第四步：產生資料庫 (執行 Migration)</h3><ol><li>點擊 VS 2022 最上方的選單：<strong>「工具 (Tools)」</strong> -&gt; <strong>「NuGet 套件管理員」</strong> -&gt; <strong>「套件管理員主控台 (Package Manager Console)」</strong>。</li><li>在畫面下方會出現一個小視窗，請先確認 <strong>「預設專案」</strong> 下拉選單選的是 <strong>Identity.Infrastructure</strong>。</li><li>指令列輸入 =&gt; Add-Migration InitialCreate</li><li>顯示Build Success 再輸入Update-Database</li><li>如果最後顯示 <strong>「Done」</strong>即完成。</li></ol><h3>現在我們要進入 Step 2：</h3><p>寫入「大腦」邏輯 (Application Layer)。<br>這個階段我們要處理：「檢查白名單 -&gt; 掃描 QR Code -&gt; 加鹽雜湊密碼 -&gt; 存入資料庫」。</p><h4>1. 安裝加密套件 (Infrastructure 層)</h4><p>我們需要一個強大的加密工具來幫 QR Code 字串「加鹽雜湊 (Hash)」。</p><ol><li>在 <strong>Identity.Infrastructure</strong> 上點 <strong>右鍵</strong> -&gt; <strong>管理 NuGet 套件</strong>。</li><li>搜尋並安裝：<strong>BCrypt.Net-Next</strong>。</li></ol><h4>2. 定義「規則」 (Domain 層的介面)</h4><p>在 DDD 中，我們不希望大腦直接管資料庫，而是先定義「合約 (Interface)」。</p><ol><li>在 <strong>Identity.Domain</strong> 專案下，建立一個新資料夾：<strong>Interfaces</strong>。</li><li>在裡面建立一個介面檔案：<strong>IUserRepository.cs</strong>。</li></ol><pre>using Identity.Domain.Entities;<br>namespace Identity.Domain.Interfaces;<br><br>public interface IUserRepository {<br>    Task AddAsync(User user);<br>    Task&lt;User?&gt; GetByAccountAsync(string account);<br>}</pre><p>3.再建立一個介面檔案：<strong>IWhitelistRepository.cs</strong>。</p><pre>namespace Identity.Domain.Interfaces;<br><br>public interface IWhitelistRepository {<br>    Task&lt;bool&gt; IsInWhitelistAsync(string account);<br>}</pre><h4>3. 實作「存取動作」 (Infrastructure 層的 Repository)</h4><p>現在我們要在基礎建設層真正去寫 SQL 語法（透過 EF Core）。</p><ol><li>在 <strong>Identity.Infrastructure</strong> 專案下，建立一個新資料夾：<strong>Repositories</strong>。</li><li>建立 <strong>UserRepository.cs</strong>：</li></ol><pre>using Identity.Domain.Entities;<br>using Identity.Domain.Interfaces;<br>using Identity.Infrastructure.Data;<br>using Microsoft.EntityFrameworkCore;<br><br>namespace Identity.Infrastructure.Repositories;<br><br>public class UserRepository(AppDbContext context) : IUserRepository {<br>    public async Task AddAsync(User user) {<br>        context.Users.Add(user);<br>        await context.SaveChangesAsync();<br>    }<br>    public async Task&lt;User?&gt; GetByAccountAsync(string account) =&gt; <br>        await context.Users.FirstOrDefaultAsync(u =&gt; u.Account == account);<br>}</pre><p>3.建立 <strong>WhitelistRepository.cs</strong>：</p><pre>using Identity.Domain.Interfaces;<br>using Identity.Infrastructure.Data;<br>using Microsoft.EntityFrameworkCore;<br><br>namespace Identity.Infrastructure.Repositories;<br><br>public class WhitelistRepository(AppDbContext context) : IWhitelistRepository {<br>    public async Task&lt;bool&gt; IsInWhitelistAsync(string account) =&gt; <br>        await context.Whitelist.AnyAsync(w =&gt; w.Account == account);<br>}</pre><h3>4. 實作「註冊邏輯」 (Application 層)</h3><p>這是你的微服務心臟。</p><ol><li>先讓 <strong>Identity.Application</strong> 認識 <strong>Identity.Domain</strong> (如果之前沒加過專案參考的話)。</li><li>在 <strong>Identity.Application</strong> 下，建立一個新資料夾：<strong>Services</strong>。</li><li>建立 <strong>IdentityService.cs</strong>：</li></ol><pre>using Identity.Domain.Entities;<br>using Identity.Domain.Interfaces;<br>using BCrypt.Net;<br><br>namespace Identity.Application.Services;<br><br>public class IdentityService(IUserRepository userRepo, IWhitelistRepository whitelistRepo)<br>{<br>    public async Task&lt;string&gt; RegisterAsync(string account, string qrCodeContent)<br>    {<br>        // 1. 檢查是否在白名單<br>        var isWhite = await whitelistRepo.IsInWhitelistAsync(account);<br>        if (!isWhite) return &quot;錯誤：此帳號不在白名單中&quot;;<br><br>        // 2. 檢查是否已經註冊過<br>        var existingUser = await userRepo.GetByAccountAsync(account);<br>        if (existingUser != null) return &quot;錯誤：帳號已註冊&quot;;<br><br>        // 3. 把 QR Code 內容加鹽雜湊 (這是密碼)<br>        var passwordHash = BCrypt.Net.BCrypt.HashPassword(qrCodeContent);<br><br>        // 4. 存入資料庫<br>        var newUser = new User {<br>            Id = Guid.NewGuid(),<br>            Account = account,<br>            PasswordHash = passwordHash,<br>            CreatedAt = DateTime.UtcNow<br>        };<br><br>        await userRepo.AddAsync(newUser);<br>        return &quot;註冊成功！&quot;;<br>    }<br>}</pre><h4>5. 在 Program.cs 註冊這些新積木</h4><p>回到 <strong>Identity.API</strong> 的 <strong>Program.cs</strong>，在 AddDbContext 下方加入這些註冊資訊：</p><pre>using Identity.Domain.Interfaces;<br>using Identity.Infrastructure.Repositories;<br>using Identity.Application.Services;<br><br>// 註冊 Repository (對接資料庫)<br>builder.Services.AddScoped&lt;IUserRepository, UserRepository&gt;();<br>builder.Services.AddScoped&lt;IWhitelistRepository, WhitelistRepository&gt;();<br><br>// 註冊 Application Service (對接邏輯)<br>builder.Services.AddScoped&lt;IdentityService&gt;();</pre><p>目前的狀態是：<strong>工廠蓋好了，機器也接好電了，現在我們需要一個「櫃台 (Controller)」來接收客人的請求。</strong></p><p>請跟著以下步驟完成 <strong>Step 3：建立註冊 API 並進行測試</strong>。</p><h3>第一步：手動在「白名單」加一筆資料</h3><p>因為你的邏輯是「只有白名單的人才能註冊」，如果資料庫是空的，誰都註冊不了。</p><ol><li>在 VS 2022 選單點選 <strong>「檢視 (View)」</strong> -&gt; <strong>「SQL Server 物件總管」</strong>。</li><li>找到 (localdb)\mssqllocaldb -&gt; Databases -&gt; <strong>IdentityDb</strong> -&gt; <strong>Tables</strong>。</li><li>在 <strong>dbo.Whitelist</strong> 上按 <strong>右鍵</strong> -&gt; <strong>「檢視資料 (View Data)」</strong>。</li><li>在表格裡手動輸入一筆資料：<br><strong>Id</strong>: (不用填，會自動跳)<br><strong>Account</strong>: EMP001 (這是你的工號)<br>按 Enter 存檔。</li></ol><h3>第二步：建立傳輸用的 DTO (資料小盒子)</h3><p>在 API 層，我們習慣用 DTO 來接收前端傳來的資料。</p><ol><li>在 <strong>Identity.API</strong> 專案下，建立一個新資料夾：<strong>Models</strong>。</li><li>在裡面建立一個類別：<strong>RegisterDto.cs</strong>。</li><li>內容如下：</li></ol><pre>namespace Identity.API.Models;<br><br>public class RegisterDto<br>{<br>    public string Account { get; set; }      // 工號<br>    public string QrCodeContent { get; set; } // 掃描到的 QR Code ID<br>}</pre><h3>第三步：建立 AuthController (櫃台)</h3><p>這就是前端 Vue 之後要呼叫的 API 入口。</p><ol><li>在 <strong>Identity.API</strong> 專案下的 <strong>Controllers</strong> 資料夾，按 <strong>右鍵 -&gt; 加入 -&gt; 控制器</strong>。</li><li>選擇 <strong>「API 控制器 — 空」</strong>。</li><li>名稱輸入：<strong>AuthController.cs</strong>。</li><li>貼上以下程式碼：</li></ol><pre>using Microsoft.AspNetCore.Mvc;<br>using Identity.Application.Services;<br>using Identity.API.Models;<br><br>namespace Identity.API.Controllers;<br><br>[ApiController]<br>[Route(&quot;api/[controller]&quot;)]<br>public class AuthController : ControllerBase<br>{<br>    private readonly IdentityService _identityService;<br><br>    // 這裡 VS 會自動幫你把剛才在 Program.cs 註冊的服務注入進來<br>    public AuthController(IdentityService identityService)<br>    {<br>        _identityService = identityService;<br>    }<br><br>    [HttpPost(&quot;register&quot;)]<br>    public async Task&lt;IActionResult&gt; Register([FromBody] RegisterDto dto)<br>    {<br>        // 呼叫大腦 (Service) 進行註冊邏輯<br>        var result = await _identityService.RegisterAsync(dto.Account, dto.QrCodeContent);<br><br>        if (result.Contains(&quot;錯誤&quot;))<br>        {<br>            return BadRequest(new { message = result });<br>        }<br><br>        return Ok(new { message = result });<br>    }<br>}</pre><h3>第四步：啟動專案並進行測試 (Swagger)</h3><ol><li>按下鍵盤的 <strong>F5</strong> (或點選上方綠色的啟動按鈕)。</li><li>瀏覽器會自動彈出一個 <strong>Swagger</strong> 頁面（如果沒彈出，網址通常是 https://localhost:xxxx/swagger）。</li><li>找到 <strong>POST /api/Auth/register</strong>，點開它。</li><li>點擊右邊的 <strong>「Try it out」</strong>。</li><li>在 Request body 修改內容進行兩次測試：</li></ol><p><strong>測試 A (白名單內的人)：</strong></p><pre>{<br>  &quot;account&quot;: &quot;EMP001&quot;,<br>  &quot;qrCodeContent&quot;: &quot;MY_SECRET_QR_123&quot;<br>}</pre><p><em>預期結果：回傳「註冊成功！」。</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*6p82FY7pDtx60Y7MdJ3kmg.png" /><figcaption>註冊成功</figcaption></figure><p><strong>測試 B (隨便亂輸的帳號)：</strong></p><pre>{<br>  &quot;account&quot;: &quot;STRANGER&quot;,<br>  &quot;qrCodeContent&quot;: &quot;123&quot;<br>}</pre><p><em>預期結果：回傳「錯誤：此帳號不在白名單中」。</em></p><p>如果測試 A 成功了，你可以回到剛才的 <strong>SQL Server 物件總管</strong>，在 <strong>dbo.Users</strong> 表上點右鍵 -&gt; 檢視資料。<br>你會發現 EMP001 已經存進去了，而且 <strong>PasswordHash 是一串亂碼</strong>（這就是加鹽雜湊過的 QR Code，沒人看得出原碼是什麼）。</p><ol><li><strong>繼續完成後端「登入 (Login)」功能</strong>（產生 JWT Token，這就像是發給手機的一張通行證）。</li><li><strong>開始寫 Vue.js 前端</strong>（實作手機鏡頭掃描 QR Code 並呼叫剛才寫好的註冊 API）。</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cz57d9UfubT5FsB1GWaFwQ.png" /><figcaption>PC的畫面</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*sNF0cPutK391wivnN64mxA.png" /><figcaption>按下掃描識別證QRcode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5IJzJ1VgpRA7oPSQ6KekA.png" /><figcaption>掃描成功就會顯示 已讀取QR-Code</figcaption></figure><p><strong>這邊設定的是如果是非IT人員幫忙新增白名單帳號會顯示：</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yf-KNdLo-8dfQC5QBZR38A.png" /><figcaption>此帳號不再白名單中</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*NWc_v2VSulBSfd8dPU3F9A.png" /><figcaption>即使是自己偷偷跑去SQL上新增也是會被強制告知不行。</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nUUWV8NkAmXeQyub1HZQA.png" /><figcaption>利用Swagger 也不行~</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*S917LpYYNToSgzn7T9hAbg.png" /><figcaption>只能用檢視-&gt;的SQL Server物件總管去新增-1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*NUuGviFBkoR3vsk0vFq_Lg.png" /><figcaption>只能用檢視-&gt;的SQL Server物件總管去新增-2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PgWyalgt29acNqZhcVbNrQ.png" /><figcaption>只能用檢視-&gt;的SQL Server物件總管去新增-3 (註冊成功)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*bQozCjpf88c6t89vRiB8eg.png" /><figcaption>只能用檢視-&gt;的SQL Server物件總管去新增-4 (SQL列表呈現)</figcaption></figure><h3>Step 4：完成身份驗證的最後一塊拼圖 — — JWT 登入</h3><p>太棒了！後端註冊功能成功，代表你的 <strong>DDD 架構（Domain -&gt; Infrastructure -&gt; Application -&gt; API）</strong> 已經完全通車了。</p><p>現在我們正處於一個分叉路口：</p><ol><li><strong>繼續完成後端「登入 (Login)」功能</strong>（產生 JWT Token，這就像是發給手機的一張通行證）。</li><li><strong>開始寫 Vue.js 前端</strong>（實作手機鏡頭掃描 QR Code 並呼叫剛才寫好的註冊 API）。</li></ol><p>為了讓你更有成就感，我建議我們先把 <strong>「登入 API (JWT)」</strong> 做完，這樣等下進 Vue 的時候，我們就可以一次把「掃描註冊」和「掃描登入」全部接起來！</p><h3>Step 4：完成身份驗證的最後一塊拼圖 — — JWT 登入</h3><p>這部分我們要產生一個加密的 <strong>JWT (JSON Web Token)</strong>，前端拿到後會存起來，之後所有的「追蹤案情」、「插單」功能都要檢查這張通行證。</p><h4>1. 安裝 JWT 套件 (API 層)</h4><p>在 <strong>Identity.API</strong> 專案上點 <strong>右鍵</strong> -&gt; <strong>管理 NuGet 套件</strong>，安裝：</p><ul><li>Microsoft.AspNetCore.Authentication.JwtBearer (版本 <strong>8.0.x</strong>)</li></ul><h4>2. 在 appsettings.json 設定金鑰</h4><p>打開 <strong>Identity.API/appsettings.json</strong>，在 ConnectionStrings 下方加入 JWT 設定：</p><pre>&quot;Jwt&quot;: {<br>  &quot;Key&quot;: &quot;YourSecretKeyForMyPMSystem2024ByMe!KeepItLong&quot;, <br>  &quot;Issuer&quot;: &quot;MyPMSystem&quot;,<br>  &quot;Audience&quot;: &quot;MyPMUsers&quot;<br>}</pre><h4>3. 實作登入邏輯 (Application 層)</h4><p>打開 <strong>Identity.Application/Services/IdentityService.cs</strong>，在 RegisterAsync 下方加入 LoginAsync：</p><pre>// 這裡需要修改一下，讓 Service 能拿到 JWT 設定（等等在建構子加）<br>public async Task&lt;(string token, string message)&gt; LoginAsync(string account, string qrCodeContent, string jwtKey, string issuer, string audience)<br>{<br>    // 1. 找使用者<br>    var user = await userRepo.GetByAccountAsync(account);<br>    if (user == null) return (null, &quot;錯誤：帳號不存在&quot;);<br><br>    // 2. 驗證 QR Code (密碼)<br>    bool isValid = BCrypt.Net.BCrypt.Verify(qrCodeContent, user.PasswordHash);<br>    if (!isValid) return (null, &quot;錯誤：QR Code 驗證失敗&quot;);<br><br>    // 3. 驗證成功，產生 JWT Token (這段邏輯之後可以抽出來，現在先寫在這)<br>    var claims = new[] {<br>        new System.Security.Claims.Claim(&quot;Account&quot;, user.Account),<br>        new System.Security.Claims.Claim(&quot;UserId&quot;, user.Id.ToString())<br>    };<br><br>    var key = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(System.Text.Encoding.UTF8.GetBytes(jwtKey));<br>    var creds = new Microsoft.IdentityModel.Tokens.SigningCredentials(key, Microsoft.IdentityModel.Tokens.SecurityAlgorithms.HmacSha256);<br><br>    var token = new System.IdentityModel.Tokens.Jwt.JwtSecurityToken(<br>        issuer: issuer,<br>        audience: audience,<br>        claims: claims,<br>        expires: DateTime.Now.AddDays(7), // 七天免登入<br>        signingCredentials: creds<br>    );<br><br>    return (new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler().WriteToken(token), &quot;登入成功&quot;);<br>}</pre><h4>4. 在 AuthController 加入登入接口</h4><p>打開 <strong>Identity.API/Controllers/AuthController.cs</strong>，加入登入功能：</p><pre>private readonly IConfiguration _config; // 注入設定檔<br><br>public AuthController(IdentityService identityService, IConfiguration config)<br>{<br>    _identityService = identityService;<br>    _config = config;<br>}<br><br>[HttpPost(&quot;login&quot;)]<br>public async Task&lt;IActionResult&gt; Login([FromBody] RegisterDto dto)<br>{<br>    var (token, message) = await _identityService.LoginAsync(<br>        dto.Account, <br>        dto.QrCodeContent,<br>        _config[&quot;Jwt:Key&quot;],<br>        _config[&quot;Jwt:Issuer&quot;],<br>        _config[&quot;Jwt:Audience&quot;]<br>    );<br><br>    if (token == null) return BadRequest(new { message });<br><br>    return Ok(new { token, message });<br>}</pre><h3>Step 5：準備進入 Vue.js (前端環境搭建)</h3><p>現在後端已經有 register 和 login 了。就可以準備開始寫 Vue 前端。</p><h3>Vue 第一步：安裝前端工具箱 (Vant UI &amp; Axios)</h3><p>請在你的 <strong>Vue 專案資料夾</strong> 開啟終端機（CMD 或 PowerShell），輸入：</p><pre># 安裝 Vant (手機端 UI 庫) 和 Axios (呼叫 API 用)<br>npm install vant axios html5-qrcode</pre><h3>第二步：在 main.js 引入 Vant</h3><p>打開 src/main.js，把內容替換成這樣（為了讓手機版組件生效）：</p><pre>import { createApp } from &#39;vue&#39;<br>import App from &#39;./App.vue&#39;<br><br>// 引入 Vant 組件與樣式<br>import Vant from &#39;vant&#39;;<br>import &#39;vant/lib/index.css&#39;;<br><br>const app = createApp(App);<br>app.use(Vant);<br>app.mount(&#39;#app&#39;);</pre><h3>第三步：撰寫註冊頁面 (App.vue)</h3><p>請打開 src/App.vue，把裡面原本的內容<strong>全部刪除</strong>，貼上這段代碼。這段代碼包含了：<strong>帳號輸入、相機掃描、呼叫 C# API</strong>。</p><p><strong>注意：</strong> 請把代碼中 const API_URL = “https://localhost:xxxx&quot; 的 xxxx 改成你 C# Swagger 啟動時的 <strong>Port 號</strong>。</p><pre>&lt;template&gt;<br>  &lt;div class=&quot;mobile-container&quot;&gt;<br>    &lt;van-nav-bar title=&quot;員工註冊系統&quot; /&gt;<br><br>    &lt;!-- 1. 帳號輸入 --&gt;<br>    &lt;van-cell-group inset style=&quot;margin-top: 20px;&quot;&gt;<br>      &lt;van-field<br>        v-model=&quot;account&quot;<br>        label=&quot;工號&quot;<br>        placeholder=&quot;請輸入工號 (例: EMP001)&quot;<br>        left-icon=&quot;user-o&quot;<br>      /&gt;<br>    &lt;/van-cell-group&gt;<br><br>    &lt;!-- 2. QR Code 掃描區塊 --&gt;<br>    &lt;div class=&quot;scan-section&quot;&gt;<br>      &lt;div id=&quot;reader&quot; v-show=&quot;isScanning&quot;&gt;&lt;/div&gt;<br>      &lt;van-button <br>        v-if=&quot;!isScanning&quot; <br>        icon=&quot;photograph&quot; <br>        type=&quot;primary&quot; <br>        block <br>        @click=&quot;startScan&quot;<br>      &gt;<br>        掃描識別證 QR Code<br>      &lt;/van-button&gt;<br>      &lt;van-button <br>        v-else <br>        type=&quot;danger&quot; <br>        block <br>        @click=&quot;stopScan&quot;<br>      &gt;<br>        關閉相機<br>      &lt;/van-button&gt;<br>    &lt;/div&gt;<br><br>    &lt;!-- 3. 註冊按鈕 --&gt;<br>    &lt;div style=&quot;margin: 16px;&quot;&gt;<br>      &lt;van-button <br>        round <br>        block <br>        type=&quot;success&quot; <br>        @click=&quot;handleRegister&quot;<br>        :disabled=&quot;!account || !qrContent&quot;<br>      &gt;<br>        確認註冊<br>      &lt;/van-button&gt;<br>    &lt;/div&gt;<br><br>    &lt;!-- 顯示掃描結果 --&gt;<br>    &lt;van-divider v-if=&quot;qrContent&quot;&gt;已讀取 QR Code: {{ qrContent }}&lt;/van-divider&gt;<br>  &lt;/div&gt;<br>&lt;/template&gt;<br><br>&lt;script setup&gt;<br>import { ref } from &#39;vue&#39;;<br>import { showToast, showSuccessToast, showFailToast } from &#39;vant&#39;;<br>import { Html5Qrcode } from &quot;html5-qrcode&quot;;<br>import axios from &#39;axios&#39;;<br><br>// --- 設定區 ---<br>const API_URL = &quot;https://localhost:7195&quot;; // &lt;-- *** 請改為你的 C# API 網址 ***<br>const account = ref(&#39;&#39;);<br>const qrContent = ref(&#39;&#39;);<br>const isScanning = ref(false);<br>let html5QrCode = null;<br><br>// --- 啟動相機掃描 ---<br>const startScan = () =&gt; {<br>  isScanning.value = true;<br>  html5QrCode = new Html5Qrcode(&quot;reader&quot;);<br>  <br>  html5QrCode.start(<br>    { facingMode: &quot;environment&quot; }, // 使用後鏡頭<br>    { fps: 10, qrbox: { width: 250, height: 250 } },<br>    (decodedText) =&gt; {<br>      qrContent.value = decodedText;<br>      showToast(&#39;讀取成功&#39;);<br>      stopScan();<br>    },<br>    (errorMessage) =&gt; { /* 忽略掃描中的錯誤訊息 */ }<br>  ).catch(err =&gt; {<br>    showFailToast(&#39;無法開啟相機&#39;);<br>    isScanning.value = false;<br>  });<br>};<br><br>const stopScan = () =&gt; {<br>  if (html5QrCode) {<br>    html5QrCode.stop().then(() =&gt; {<br>      isScanning.value = false;<br>    });<br>  }<br>};<br><br>// --- 呼叫 C# API 註冊 ---<br>const handleRegister = async () =&gt; {<br>  try {<br>    const response = await axios.post(`${API_URL}/api/Auth/register`, {<br>      account: account.value,<br>      qrCodeContent: qrContent.value<br>    });<br>    showSuccessToast(response.data.message);<br>  } catch (error) {<br>    const msg = error.response?.data?.message || &#39;註冊失敗&#39;;<br>    showFailToast(msg);<br>  }<br>};<br>&lt;/script&gt;<br><br>&lt;style scoped&gt;<br>.mobile-container {<br>  min-height: 100vh;<br>  background-color: #f7f8fa;<br>}<br>.scan-section {<br>  padding: 20px;<br>}<br>#reader {<br>  width: 100%;<br>  border-radius: 10px;<br>  overflow: hidden;<br>  margin-bottom: 10px;<br>}<br>&lt;/style&gt;</pre><h3>第四步：測試一下！</h3><ol><li><strong>確保 C# 後端正在執行 (F5)</strong>。</li><li><strong>確保 Vue 專案也在執行 (npm run dev)</strong>。</li><li>打開瀏覽器，按下 <strong>F12</strong> 開啟開發者工具，並點擊左上角的 <strong>「手機圖示」</strong> (Device Toolbar) 模擬手機畫面。</li><li><strong>測試流程</strong>：</li></ol><ul><li>在工號輸入：EMP001 (這是你之前在資料庫手動加的那筆)。</li><li>點擊「掃描」按鈕（瀏覽器會詢問是否允許開啟相機）。</li><li>你可以拿手機對著螢幕上隨便一個 QR Code 掃描，或是直接手動把 qrContent 寫死在代碼裡測試。</li><li>點擊「確認註冊」。</li></ul><p>接下來就是手機連線測試，這邊先不用反代理所以我先從Vue下手，基本上他npm run dev 會產出Http的連結，這一項會導致iOS/iPadOS系列的瀏覽器不能開啟，所以要在Vue裝外掛</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*ueMWVT6qms_KIJewyjNXVg.jpeg" /><figcaption>HTTP會有的狀況。</figcaption></figure><h3>讓 Vue 支援 HTTPS (為了解放相機功能)</h3><p>為了讓手機能掃碼，我們要讓 Vue 也跑在 https 上。請在你的 <strong>Vue 專案資料夾</strong> 執行以下動作：</p><ol><li><strong>安裝外掛</strong>：在終端機輸入：</li></ol><pre>npm install @vitejs/plugin-basic-ssl</pre><p><strong>修改設定檔</strong>：打開專案根目錄的 <strong>vite.config.js</strong>，修改成這樣：</p><pre>import { defineConfig } from &#39;vite&#39;<br>import vue from &#39;@vitejs/plugin-vue&#39;<br>import basicSsl from &#39;@vitejs/plugin-basic-ssl&#39; // 1. 引入外掛<br><br>export default defineConfig({<br>  plugins: [<br>    vue(),<br>    basicSsl() // 2. 啟用 HTTPS 輸出<br>  ],<br>  server: {<br>    host: true, // 允許透過 IP 連線<br>    port: 5173,<br>    https: true // 3. 強制開啟 HTTPS 模式<br>  }<br>})</pre><p>在重新啟動npm run dev，就會看到連結會變成Https://</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*FoKCQk9aGY87yzdsjyD-YQ.jpeg" /></figure><p>即可完成掃描。</p><p>剩下的步驟跟內容還有多，然後今天就只為了讓掃描註冊QRcode跟除錯就搞了有點久，真的是讓一件事情變得好複雜，目前想做的客製化的功能都還沒做到，這幾天我會陸陸續續的完成這個專案。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=329175288f0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Window Forms 拉麵點餐機]]></title>
            <link>https://medium.com/@killpmite/window-forms-%E6%8B%89%E9%BA%B5%E9%BB%9E%E9%A4%90%E6%A9%9F-a4eb60991b72?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4eb60991b72</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[ms-sql-server]]></category>
            <category><![CDATA[sms-service]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[pos]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 16:56:33 GMT</pubDate>
            <atom:updated>2026-03-06T16:59:50.740Z</atom:updated>
            <content:encoded><![CDATA[<p>當時背景是剛學基礎的C# + SQL/北風資料庫 + Google Studio Ai協作。</p><p>這是一個拉麵店的點餐機，自己也蠻喜歡吃拉麵的。</p><p>首先我們先來展示畫面，並且還有部分功能的Code分享。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*X7M2g32zx4HlBxuWKulAgQ.png" /><figcaption>點餐機的首頁</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*Ts0UFgniI9vK2a5f3PCrgA.png" /><figcaption>右手邊的單點/炸物呈現</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*mZm-_t0624eHleSAueZpsw.png" /><figcaption>餐點畫面</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*dqKsU5gyiN9S9N2tD8sZ2g.png" /><figcaption>會員登入頁面</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*u68o3oyo4UE4GkatOlbqiA.png" /><figcaption>沒有會員，點選會員申請</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*tQxREuWdah4ZGvvKal8MvA.png" /><figcaption>點帳號後會跳出虛擬鍵盤</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*bFJTM76oWQ3B2zzTMgb9tQ.png" /><figcaption>會員的日曆功能</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*ffqueBEtkDxdAgF322GZ-g.png" /><figcaption>帳號限制，會跳出警告。</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*MJrsMbOVbv93dK09Bmn-fg.png" /><figcaption>申請成功。</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*cv92Nt5JFBtWUHXg_TCJUg.png" /><figcaption>登入帳號輸入有誤</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*nRbt-MJcmDXE0BtrtgORRA.png" /><figcaption>登入成功會跳出成功視窗</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*DswGu6IymavhX3YY-AQgkw.png" /><figcaption>會跳出會員等級跟點數，新會員送五十點。</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*iK4esxC_4GiSWlQ5XMmQBg.png" /><figcaption>開始點餐</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*21gSaK6avXb6kf5zj7k36Q.png" /><figcaption>家入購物車後會告知是否要加購?</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*kPYlC987OMyuftnAVTrFbQ.png" /><figcaption>加購後會再確定是否要加購及金額</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*KtrdXtGf6V9oGeIAJ8IKJw.png" /><figcaption>查詢購物車可看見以點餐畫面(且內容皆有CRUD，包含可使用點數)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*QfIbIloPjMzBr6cJTQSwTg.png" /><figcaption>結帳通知</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*n1qlFNp2X8rH2PmQtz0VBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*SyvrGR9DUjV3vrlGSVPoaQ.png" /><figcaption>會列印出該單的日期時間 (也可以更新會員末三碼 或 桌號 或 點餐該號)</figcaption></figure><pre>using System;<br>using System.Collections.Generic;<br>using System.Drawing;<br>using System.Linq;<br>using System.Text;<br>using System.Threading.Tasks;<br><br>namespace WindowsFormsRamen<br>{<br>    public class ReceiptGenerator<br>    {<br>        public static Image GenerateReceipt(List&lt;OrderItem&gt; items, int originalTotal, int pointsUsed, int pointsEarned)<br>        {<br>            // --- 1. 設定畫布與字體 ---<br>            int receiptWidth = 400; // 收據圖片的寬度<br>            int receiptHeight = 300 + (items.Count * 25); // 基礎高度 + 每個品項的高度<br><br>            // 建立一張空白的畫布 (Bitmap)，背景為白色<br>            Bitmap receiptImage = new Bitmap(receiptWidth, receiptHeight);<br><br>            // 取得這張畫布的「畫筆」工具<br>            using (Graphics g = Graphics.FromImage(receiptImage))<br>            {<br>                g.Clear(Color.White); // 將背景填滿白色<br><br>                // 設定字體 (如果系統有微軟正黑體，就用它)<br>                Font titleFont = new Font(&quot;微軟正黑體&quot;, 18, FontStyle.Bold);<br>                Font headerFont = new Font(&quot;微軟正黑體&quot;, 10, FontStyle.Bold);<br>                Font bodyFont = new Font(&quot;微軟正黑體&quot;, 10);<br><br>                // 設定畫刷 (字的顏色)<br>                Brush textBrush = Brushes.Black;<br><br>                // 設定畫筆 (線的顏色)<br>                Pen linePen = new Pen(Color.Black, 1);<br><br>                // --- 2. 開始在畫布上畫畫 (座標系統從左上角 (0,0) 開始) ---<br>                int currentY = 10; // 目前畫到的 Y 軸位置<br><br>                // 畫標題<br>                g.DrawString(&quot;拉麵小屋 消費明細&quot;, titleFont, textBrush, new PointF(70, currentY));<br>                currentY += 40;<br><br>                // 畫訂單時間<br>                g.DrawString($&quot;訂單時間: {DateTime.Now:yyyy/MM/dd HH:mm:ss}&quot;, bodyFont, textBrush, new PointF(10, currentY));<br>                currentY += 25;<br><br>                // 畫分隔線<br>                g.DrawLine(linePen, 10, currentY, receiptWidth - 10, currentY);<br>                currentY += 10;<br><br>                // 畫品項標頭<br>                g.DrawString(&quot;品項&quot;, headerFont, textBrush, new PointF(10, currentY));<br>                g.DrawString(&quot;單價&quot;, headerFont, textBrush, new PointF(330, currentY));<br>                currentY += 20;<br><br>                // 畫每一個訂購的品項<br>                foreach (OrderItem item in items)<br>                {<br>                    // 為了避免品項名稱太長，我們做個簡單的換行處理<br>                    string itemText = $&quot;{item.Quantity} x {item.ProductName} ({item.Customization})&quot;;<br>                    SizeF textSize = g.MeasureString(itemText, bodyFont, 300); // 測量文字在300寬度內的高度<br><br>                    g.DrawString(itemText, bodyFont, textBrush, new RectangleF(new PointF(10, currentY), textSize));<br>                    g.DrawString($&quot;{item.UnitPrice:C0}&quot;, bodyFont, textBrush, new PointF(330, currentY));<br>                    currentY += (int)textSize.Height + 5; // 根據文字高度來增加 Y 軸位置<br>                }<br><br>                // 畫分隔線<br>                currentY += 10;<br>                g.DrawLine(linePen, 10, currentY, receiptWidth - 10, currentY);<br>                currentY += 10;<br><br>                // 畫總金額相關資訊<br>                g.DrawString($&quot;金額: {originalTotal:C0}&quot;, bodyFont, textBrush, new PointF(250, currentY));<br>                currentY += 20;<br>                g.DrawString($&quot;使用點數: - {pointsUsed}&quot;, bodyFont, textBrush, new PointF(250, currentY));<br>                currentY += 25;<br><br>                // 畫最終應付金額<br>                g.DrawString($&quot;應付總額: {(originalTotal - pointsUsed):C0}&quot;, headerFont, textBrush, new PointF(250, currentY));<br>                currentY += 25;<br><br>                // 畫獲得點數<br>                g.DrawString($&quot;本次獲得點數: + {pointsEarned}&quot;, bodyFont, textBrush, new PointF(10, currentY));<br><br>            } // 在這裡，畫筆工具會被自動釋放<br><br>            return receiptImage;<br>        }<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*L6zSBm90JP4mpvuAg7_xag.png" /><figcaption>商家隱藏頁面(長按某空區三秒以上，也可以只給主POS機使用)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*7hKY0073It2kAM2FohNItA.png" /><figcaption>可以搜尋末三碼</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*a8WwI_K-S-o6mtb_CNPJKg.png" /><figcaption>全搜尋</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*zgJcIpdRAll6cGvrhE6WbQ.png" /><figcaption>可以輸入電話</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*Coo6myZDjbfqZn_-QVByRw.jpeg" /><figcaption>簡訊找尋密碼，只有電話本人可以知道密碼是多少(確保隱私資安)。(使用Twilio 虛擬電話發簡訊)，店家不會知道密碼。</figcaption></figure><pre>using System;<br>using System.Collections.Generic;<br>using System.ComponentModel;<br>using System.Data;<br>using System.Drawing;<br>using System.Linq;<br>using System.Text;<br>using System.Threading.Tasks;<br>using System.Windows.Forms;<br>using Twilio;<br>using Twilio.Exceptions;<br>using Twilio.Rest.Api.V2010.Account;<br>using WindowsFormsRamen;<br><br>namespace WindowsFormsRamen<br>{<br>    public partial class SendSMS : Form<br>    {<br>        public SendSMS(string phoneNumber, string message)<br>        {<br>            InitializeComponent();<br>            txtToPhoneNumber.Text = phoneNumber;<br>            txtMessage.Text = message;<br><br>            // 為了簡化，讓「收件人電話」欄位變成唯讀，防止使用者修改<br>            txtToPhoneNumber.ReadOnly = true;<br>            // 「簡訊內容」也變成唯讀<br>            txtMessage.ReadOnly = true;<br>        }<br><br>        public SendSMS()<br>        {<br>            InitializeComponent();<br>        }<br><br>        private void SendSMS_Load(object sender, EventArgs e)<br>        {<br><br>        }<br><br>        private void btnOK_Click(object sender, EventArgs e)<br>        {<br>            // --- 填入您在 Twilio 儀表板複製的三把鑰匙 ---<br>            const string accountSid = &quot;AC57dd4ea1bec07ed0552b4ec4e7296624&quot;; // Twilio Account SID<br>            const string authToken = &quot;1786f1ae3f8890b5e24fda0731521427&quot;;    // Twilio Auth Token<br>            const string twilioPhoneNumber = &quot;+19383560912&quot;;                // Twilio 電話號碼 (虛擬號碼)<br>            try<br>            {<br>                // 因為資料是從主視窗傳來的，我們可以信任它，簡化驗證<br>                string e164PhoneNumber = FormatToE164(txtToPhoneNumber.Text);<br><br>                TwilioClient.Init(accountSid, authToken);<br><br>                MessageResource.Create(<br>                    body: txtMessage.Text,<br>                    from: new Twilio.Types.PhoneNumber(twilioPhoneNumber),<br>                    to: new Twilio.Types.PhoneNumber(e164PhoneNumber)<br>                );<br><br>                MessageBox.Show(&quot;簡訊已成功發送！&quot;, &quot;發送成功&quot;, MessageBoxButtons.OK, MessageBoxIcon.Information);<br>                this.DialogResult = DialogResult.OK; // 設定成功結果<br>                this.Close(); // 發送成功後自動關閉視窗<br>            }<br>            catch (ApiException ex)<br>            {<br>                MessageBox.Show($&quot;發送失敗，Twilio 錯誤：\n{ex.Message}&quot;, &quot;錯誤&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);<br>                this.DialogResult = DialogResult.Abort; // 設定失敗結果<br>                this.Close();<br>            }<br>            catch (Exception ex)<br>            {<br>                MessageBox.Show($&quot;發生未知錯誤：\n{ex.Message}&quot;, &quot;錯誤&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);<br>                this.DialogResult = DialogResult.Abort; // 設定失敗結果<br>                this.Close();<br>            }<br>        }<br><br>        // 一個非常簡化的電話格式轉換工具<br>        private string FormatToE164(string number)<br>        {<br>            // 先移除非數字字元<br>            var digitsOnly = new string(number.Where(char.IsDigit).ToArray());<br><br>            // 假設是台灣手機，移除 &#39;0&#39; 開頭<br>            if (digitsOnly.Length == 10 &amp;&amp; digitsOnly.StartsWith(&quot;0&quot;))<br>            {<br>                return &quot;+886&quot; + digitsOnly.Substring(1);<br>            }<br><br>            // 如果已經是 E.164 格式，直接回傳<br>            if (number.StartsWith(&quot;+&quot;))<br>            {<br>                return number;<br>            }<br><br>            // 其他情況，我們假設是美國/加拿大號碼並加上 +1 (或做其他預設處理)<br>            if (digitsOnly.Length == 10)<br>            {<br>                return &quot;+1&quot; + digitsOnly;<br>            }<br><br>            return number; // 回傳原始值，讓 Twilio 自己去判斷<br><br>        }<br><br>        private void txtMessage_TextChanged(object sender, EventArgs e)<br>        {<br><br>        }<br><br>        private void txtToPhoneNumber_TextChanged(object sender, EventArgs e)<br>        {<br><br>        }<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*3VFrG5QxjJUv7UXUGng-mw.png" /><figcaption>這是另外做的需求功能Mail找回密碼</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*sqi47AjphWC8mvwEG3U64Q.png" /><figcaption>收到的Mail會獲得該信件內容，店家不會知道密碼。</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HWqTo6-ZZlN3zRCkaxBSlw.png" /><figcaption>mail發送需要與Google申請網域</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*2aaKMRvdO7942F3rKeondQ.png" /><figcaption>Mail的程式</figcaption></figure><pre>using System;<br>using System.Collections.Generic;<br>using System.ComponentModel;<br>using System.Data;<br>using System.Drawing;<br>using System.Linq;<br>using System.Text;<br>using System.Threading.Tasks;<br>using System.Windows.Forms;<br><br>namespace WindowsFormsRamen<br>{<br>    public partial class sendmail : Form<br>    {<br>        public string UserInputEmail { get; private set; }<br>        public sendmail()<br>        {<br>            InitializeComponent();<br>        }<br><br>        private void sendmail_Load(object sender, EventArgs e)<br>        {<br><br>        }<br><br>        private void btnOK_Click(object sender, EventArgs e)<br>        {<br>            if (string.IsNullOrWhiteSpace(txtInputEmail.Text.Trim()))<br>            {<br>                MessageBox.Show(&quot;請務必輸入 Email 地址！&quot;, &quot;錯誤&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);<br>                return; // 停在原處，不關閉視窗<br>            }<br>            if (!txtInputEmail.Text.Contains(&quot;@&quot;) || !txtInputEmail.Text.Contains(&quot;.&quot;))<br>            {<br>                MessageBox.Show(&quot;請輸入有效的 Email 格式！&quot;, &quot;錯誤&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error);<br>                return; // 格式不對，也停留在這裡<br>            }<br><br>            // 1. 把輸入格的內容，存進我們公開的「信箱」裡<br>            this.UserInputEmail = txtInputEmail.Text;<br><br>            // 2. 告訴主視窗，使用者按了「確定」<br>            this.DialogResult = DialogResult.OK;<br><br>            // 3. 關閉自己這個小視窗<br>            this.Close();<br>        }<br><br>        private void btnCancel_Click(object sender, EventArgs e)<br>        {<br>            // 1. 告訴主視窗，使用者按了「取消」<br>            this.DialogResult = DialogResult.Cancel;<br><br>            // 2. 關閉自己這個小視窗<br>            this.Close();<br>        }<br>    }<br>}</pre><p>以上大概是這樣，這是我的個人專題分享，感謝你的收看~。<br>後續會在更新團隊的程式。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I95VMeuo1PbpovT5cEBFHw.png" /><figcaption>最後附上我在Figma的流程架構。</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4eb60991b72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[照著文獻跑Part01]]></title>
            <link>https://medium.com/@killpmite/%E7%85%A7%E8%91%97%E6%96%87%E7%8D%BB%E8%B7%91part01-419fdd4b3bf8?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/419fdd4b3bf8</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[aspnet-mvc]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 07:46:44 GMT</pubDate>
            <atom:updated>2026-03-06T07:46:44.516Z</atom:updated>
            <content:encoded><![CDATA[<p>當Error出現了</p><p>這次從零開始的回顧C#MVC的部分開始執行，書籍說裝8.0就8.0，10就10。<br>這次在蠻前面的地方發生狀況：</p><p>首先Nuget工具管理要安裝：</p><p>所以我出現狀況，他會直接幫我安裝穩定最新版本 （Ver 10.0.2），直接抱錯， 所以我改安裝 Install-Package Microsoft.EntityFrameworkCore.Tools -Version 8.0.0 (限制版本很重要，安裝成功很看你的版本，所以要先確定好版本)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h6877QEe7nJiOypL4-xtFg.png" /><figcaption>結果安裝好了卻跳出這個了(有成功執行Entity ver8.0.0) 執行 update-database 還出現新的錯誤</figcaption></figure><p>下圖是原因：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbQEqKxa1aXxe8JnNrYoDQ.png" /><figcaption>聰明的你猜到了嗎？</figcaption></figure><p>再來是我在appsettings.Json檔案的程式</p><p>“AllowedHosts”: “*”, 對，“*”後面的沒有加上, 。這是我第二個問題，那成功之後，去查案MS-SQL有沒有新的資料庫出現，我的這個是新增TeaTimeDemoDb。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*ijlzwAM3HqoKf5v3L39rCQ.png" /><figcaption>TeaTimeDemoDb 就出現惹~</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sl70GmxibaGHRbeJL3T8hw.png" /><figcaption>新增ApplicationDbContext.cs的內容</figcaption></figure><p>輸入完畢之後發現Update-database後發現SQL沒有動靜，開始四處找原因，後來問一下Ai，他跟我說可以試試看執行Add-Migration AddCategoryTableAndSeedData，執行完後我又執行一次Update-database，再回去看SQL就出現惹。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nR0c8noZxZQVnq-XwUUZ3g.png" /><figcaption>也確定我在ApplicationDbContext.cs所更新的品項。</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=419fdd4b3bf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[要做一個小型電商，用Vue.JS+DDD架構會不會很奇怪？]]></title>
            <link>https://medium.com/@killpmite/%E8%A6%81%E5%81%9A%E4%B8%80%E5%80%8B%E5%B0%8F%E5%9E%8B%E9%9B%BB%E5%95%86-%E7%94%A8vue-js-ddd%E6%9E%B6%E6%A7%8B%E6%9C%83%E4%B8%8D%E6%9C%83%E5%BE%88%E5%A5%87%E6%80%AA-8816269a665d?source=rss-22bd9f807a1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8816269a665d</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[ChrisSu]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 08:59:50 GMT</pubDate>
            <atom:updated>2026-01-21T08:59:50.513Z</atom:updated>
            <content:encoded><![CDATA[<p>其實不會也做得到，但也很常見，常聽到老闆說：「客戶要怎樣」。<br>在這個情況之下就其實跟DDD最一開始的業務導向其實就有點擦邊。<br>以上是我個人認為，不是真的這樣嘿。</p><p>首先打開VScode在Terminal打上該指令，建立專案（my-shop是專案名稱，自己改嘿）</p><pre>npm create vite@latest my-shop</pre><p>接著一樣在終端機裡面輸入 (這步驟是到該資料夾，裝一些API等工具)</p><pre>cd my-shop<br>npm install<br>npm install pinia axios lucide-vue-next </pre><p>我的起手式Prompt :</p><pre>我如果想要做一個Vue.JS的架構的 小型買賣網站。<br>架構是DDD設計，並且還要可以符合手機UI跟電腦UI的響應式設計<br>1.會員，基本的電話就好，基本的CRUD，第三方登入。<br>2.商品的展示，數量，購物車，訂單，台灣物流，台灣超商及MAP的API串接。<br>3.商品的上下架 (CRUD，軟刪，上下架停售按鈕，顯示目前沒庫存)。<br>4.後台的方便直覺的整理。<br>5.商品折券扣及第三方付費。<br>6.客服系統。<br>如果可以就一個一個，一段一段來。</pre><p>據說這是一鍵建立資料夾，但我是手動建立：</p><pre>mkdir -p src/{core,shared,modules,assets} &amp;&amp; \<br>mkdir -p src/shared/{components,layouts,hooks} &amp;&amp; \<br>mkdir -p src/modules/{Auth,Product,Order,Marketing}/{domain,application,infra,ui}</pre><p>所以基本的架構如下圖：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D5VevtAQtkDQ2-PmYlM62A.png" /><figcaption>這是初步的架構，還少Service(客服但可有可無，可以用EMAIL方式做申訴，QnA可以另外一頁說明)</figcaption></figure><p>過程幾乎是Vibe Coding就不用詳談，我認為該改的我都改完了，其餘貼貼補補這樣。</p><p>基本上要注意的是(在Vide Coding要另外修正的)<br>1. <strong>會員功能</strong>：登入帳號(OTP)，第三方登入(API)，個人後台的個資維護，過往訂單內容，過往客訴內容等。<br>2. <strong>商品的詳細資訊</strong>。<br>3. 下單的「超商地圖」API／「第三方交易」的API／<br>4. 客服的Websocket設計。<br>5. 營運方的需求（商品管理，訂單管理(範圍搜尋，或匯款手動確認等)，客訴或變更管理等）<br>6. 折扣碼 ＝ 負金額的商品（還有幾折），所以一開始有想過這件事的人，要先記得Double,int 的問題。<br>7. 最後當日留檔紀錄。<br>8. 一鍵日夜UI。<br>9. 還有不要直接讓前端串SQL，這是一件非常危險的事情。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZMzAYq4lc0Gew4PN95-CA.png" /><figcaption>登入畫面</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ilwp45mQu0pb2Ny13sTz6Q.png" /><figcaption>大概首頁長這樣</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R3zc3vgTx7B3PIBHP2De0A.png" /><figcaption>購物車的金額可以CRUD的數量計算</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*blMwPcgw4HvhiPx7eSXcxQ.png" /><figcaption>哪個沒寫好就會跳出警告。</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*uVs-3YKUg-MeAli9zkTY7g.png" /><figcaption>客戶 給 官方</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YWAu717BawIoUFbnTizC0A.png" /><figcaption>商品管理 (刪除品項會另外警告)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*CiOMveJRto2ESgU7eBqlIQ.png" /><figcaption>可以自行新增商品，內容也是CRUD，可以選電腦或手機的相簿檔案。</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VS2uhZcbSXOpr8Zg5FI_wg.png" /><figcaption>訂單的內容</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBSsnsmwSLLJ-aevGbQ8AA.png" /><figcaption>可列印</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4-9uP2X9ZCsIQffzmMP2A.png" /><figcaption>客服 對 客戶</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*z6ssgDAjRXmRQ5mu912C_A.png" /></figure><p>這一切的一切，功能算健全的情況約3小時就可以完成了，最後還有Bulid打包，接著是比較需要嚴謹的資料處理。</p><h3><strong>Local Storage / IndexedDB</strong></h3><p><strong>優點：</strong> 快速、免錢、不用寫後端。<br><strong>缺點：</strong> 換一台電腦資料就沒了；清除瀏覽器快取後資料會消失。<br><strong>適合：</strong> 筆記軟體、個人設定（如深色模式）、待辦事項清單。</p><h3>Firebase / Supabase (BaaS 後端即服務)</h3><p>這是現在「無後端」開發者的最愛。它們提供現成的資料庫，你只需要在 Vue 裡面用它們提供的函式（SDK）來存取資料。</p><h3>靜態 JSON 檔案</h3><p>如果你的資料是「固定的」（例如：餐廳菜單、個人簡歷），你可以直接把 JSON 檔放在 Vue 專案裡。<br><strong>限制：</strong> 使用者沒辦法「新增」或「修改」這些資料。</p><p>後續我還要去問問業界或朋友，哪個比較好。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFNgsFJpgUo6cCiNpG10Cw.png" /><figcaption>簡單的比較圖</figcaption></figure><p>還有打包的Electron 或 Tauri，目前打算Tauri 雖然一開始比較辛苦，但他吃RAM就很尷尬，Tauri是屬於Rust (金融業也常會聽到的一個語言)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3SlPSOaYVBCnkKigFSaezg.png" /><figcaption>Electron VS Tauri 比較</figcaption></figure><p>Tauri這個部分安裝什麼的我還沒進行，我只是先把前端的雛形跟基本功能搞出來。先評估一下我要做什麼，最後打包好了，其他還要什麼License，訂閱制啦或開發票API等等，都可以做後續追蹤，看來還要另外做一個官網。<br>至於程式碼的部分，我應該會再完成8成的時候，在分享到Github上面吧。</p><p>我是想把這件事變成開源，畢竟程式對現今的Vibe coding（除了有關智慧財產或API外），都已經是大家都會，剩下的就是點子怎麼吸引客戶，怎麼解決痛點才是重點，畢竟不會使用AI的人就是不會，最好這樣的族群存在，這樣才會有商機，並且不是中文系會prompt就知道怎麼搞，會這樣說的人其實蠻不尊重任何一個學程式的人。</p><p>以上大概這樣，我有想到我在補充吧。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8816269a665d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>