[{"data":1,"prerenderedAt":236},["ShallowReactive",2],{"spice-article-\u002Fblog\u002Fwhy-i-built-taiwan-agriculture-price-tracker":3,"spice-surround-why-i-built-taiwan-agriculture-price-tracker":231},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"slug":10,"keywords":11,"body":17,"_type":225,"_id":226,"_source":227,"_file":228,"_stem":229,"_extension":230},"\u002Fblog\u002Fwhy-i-built-taiwan-agriculture-price-tracker","blog",false,"","為什麼開發這個菜價查詢網站？從省錢煮飯到免資料庫實作歷史菜價圖表","這是個聖誕節的夜晚...","why-i-built-taiwan-agriculture-price-tracker",[12,13,14,15,16],"台灣菜價查詢","農產品時價","靜態站實作","免資料庫圖表 (Chart)","買菜省錢",{"type":18,"children":19,"toc":211},"root",[20,29,35,40,45,50,56,61,66,82,87,92,97,102,107,113,118,123,129,139,144,150,155,161,166,171,176,181,186,192,197,202,207],{"type":21,"tag":22,"props":23,"children":25},"element","h2",{"id":24},"開發動機-20251225",[26],{"type":27,"value":28},"text","開發動機 2025.12.25",{"type":21,"tag":30,"props":31,"children":32},"p",{},[33],{"type":27,"value":34},"這是個聖誕節的夜晚，我是個不喜歡節慶的i人，所以在這個應該和親友聚在一起的日子我有一整晚的時間寫代碼。",{"type":21,"tag":30,"props":36,"children":37},{},[38],{"type":27,"value":39},"疫情解封後物價變貴，我開始變得在乎菜價菜錢，一樣的農產品，為什麼在全聯和菜市場，和菜市場另一邊的攤子價格完全不一樣? 例如九層塔、例如荔枝。",{"type":21,"tag":30,"props":41,"children":42},{},[43],{"type":27,"value":44},"在當季的荔枝，從潭子路邊阿北在他家門口賣一斤...沒寫價錢，再往北邊豐原一斤150台幣，再往郊區的神岡一斤100台幣，再往神岡的田野裡也是自宅門口販售荔枝的阿北是2斤100台幣 !!!",{"type":21,"tag":30,"props":46,"children":47},{},[48],{"type":27,"value":49},"在進行這專案時的我真的很窮，我相信很多人都有像我這樣斤斤計較的日子，當時的我一邊要付每月1萬3台幣的房租，同時還一邊存預售屋的工程款持續2年，還要養一個孩子，當時每月口袋只剩3仟台幣的零用錢，在不外食情況下，自己煮還真的有比較省。",{"type":21,"tag":51,"props":52,"children":54},"h3",{"id":53},"我打算省得更極緻",[55],{"type":27,"value":53},{"type":21,"tag":30,"props":57,"children":58},{},[59],{"type":27,"value":60},"我先fetch農糧署的菜價，因為我孩子喜歡吃高麗菜，我自己喜歡吃炒芥藍，這個站一開始只是我自己每天查詢菜價用，某天我到家裡附近的觀光型菜市場(北屯的一點利)買菜，發現只查詢單一菜價已經不能滿足我想省的靈魂。所以我決定把台灣農產品時價查詢做成自己順眼的介面，並進一步 fetch 了蛋價、米價與各類蔬果資料，方便我比對批發價與市場零售價的差異。",{"type":21,"tag":30,"props":62,"children":63},{},[64],{"type":27,"value":65},"目前發現煮起來很平價的料理有：麻婆豆腐、高麗菜炒飯、咖哩(不放肉更平價)、三杯雞、空心菜羊肉、客家風味炒茄子、絲瓜蛤蜊、打拋豬、蔥爆豬肉",{"type":21,"tag":30,"props":67,"children":68},{},[69,71,75,77,80],{"type":27,"value":70},"然後，自己煮飯。",{"type":21,"tag":72,"props":73,"children":74},"br",{},[],{"type":27,"value":76},"\n目前買過最便宜的米在鹿港，一斗台幣300，西螺米。",{"type":21,"tag":72,"props":78,"children":79},{},[],{"type":27,"value":81},"\n目前買過最貴的米在北屯昌平路N段，一斗台幣390，西螺米。",{"type":21,"tag":30,"props":83,"children":84},{},[85],{"type":27,"value":86},"如果你也剛好有需要在財務上省一波或許可以考慮減少外食改自己烹飪。",{"type":21,"tag":22,"props":88,"children":90},{"id":89},"查詢每日菜價已經不能滿足我",[91],{"type":27,"value":89},{"type":21,"tag":30,"props":93,"children":94},{},[95],{"type":27,"value":96},"我想要看歷史菜價，看歷史菜價能幫我瞭解什麼呢? 過去就過去了，今天要買菜就是這樣的價格了，難道不買嗎?",{"type":21,"tag":30,"props":98,"children":99},{},[100],{"type":27,"value":101},"我只是想實作在沒有資料庫的情況下如何實現chart。\n這幾年已經不敢用也不想用wordpress了，之前上班聽隔壁運維的同事天天在圍堵wordpress主機被攻擊，半夜被cue起來整主機，我在一旁默默切版覺得 : 好吧~這是高薪人的日常凡爾賽",{"type":21,"tag":30,"props":103,"children":104},{},[105],{"type":27,"value":106},"這不是高薪人的日常凡爾賽，他真的很想離職。",{"type":21,"tag":51,"props":108,"children":110},{"id":109},"無資料庫架構-database-free-如何實現高效能歷史圖表",[111],{"type":27,"value":112},"無資料庫架構 (Database-free) 如何實現高效能歷史圖表？",{"type":21,"tag":30,"props":114,"children":115},{},[116],{"type":27,"value":117},"答案是建構專屬的靜態資料流 (Static Data Pipeline)。",{"type":21,"tag":30,"props":119,"children":120},{},[121],{"type":27,"value":122},"我寫了一套自動化腳本直接編譯成前端圖表套件，例如：「葡萄」生成專屬的歷史價格陣列，當使用者查詢時，網頁不需要經歷任何伺服器端的資料庫查詢等待時間，歷史價格與折線圖就能瞬間渲染在眼前。",{"type":21,"tag":22,"props":124,"children":126},{"id":125},"網站的uiux靈感來自浮世繪",[127],{"type":27,"value":128},"網站的UIUX靈感來自浮世繪",{"type":21,"tag":30,"props":130,"children":131},{},[132,134,137],{"type":27,"value":133},"某天下午我忽然很想逛浮世繪，於是我看到這張圖，我沉浸在這張圖的氛圍裡，\n有即視感，",{"type":21,"tag":72,"props":135,"children":136},{},[],{"type":27,"value":138},"\n《隱田水車》，選自《富嶽三十六景》系列",{"type":21,"tag":30,"props":140,"children":141},{},[142],{"type":27,"value":143},"作者：葛飾北齋",{"type":21,"tag":145,"props":146,"children":149},"article-image",{"src":147,"alt":148},"https:\u002F\u002Fedo-narratives.com\u002Fimages\u002Ffukei\u002Fmet-56131.webp","隱田水車 ",[],{"type":21,"tag":30,"props":151,"children":152},{},[153],{"type":27,"value":154},"隱田村（Onden）： 畫中的地點「隱田」位於當時江戶（今東京）的西南郊外，大約是現今東京最繁華、時尚的澀谷區原宿至青山、神宮前一帶。 當時此地有一條「澀谷川」（又稱隱田川）流經。當地農民利用水利，在河流支流上建造了許多水車，用來為穀物進行碾米和製粉。然而，這條河流在1964年東京奧運會前夕，因為都市建設道路被改造成了地下暗渠（即今天的原宿「貓街」Cat Street下方）。",{"type":21,"tag":156,"props":157,"children":160},"aff-link",{"text":158,"url":159},"隱田水車","https:\u002F\u002Fedo-narratives.com\u002Ffukei\u002Fmet-56131\u002F",[],{"type":21,"tag":30,"props":162,"children":163},{},[164],{"type":27,"value":165},"若你有興趣也可點擊鏈結查看更多此畫作更多敍事，是英文，請按右鍵翻譯繁體中文。",{"type":21,"tag":22,"props":167,"children":169},{"id":168},"後記",[170],{"type":27,"value":168},{"type":21,"tag":30,"props":172,"children":173},{},[174],{"type":27,"value":175},"我其實不太喜歡用AI生成UI，不致於討厭，但並不是100%喜歡，原因如下:",{"type":21,"tag":30,"props":177,"children":178},{},[179],{"type":27,"value":180},"AI的UI很常在不需要設定絕對位置的元素用absolute，如果沒有生成相對應的position:relative，那就會跑版；然後你就會花更多時間在調版面，原本很快樂一秒生成的一套UI你可以直接用，但默默你發現自己竟然耗費比原本手刻時間甚至再多1.5倍時間在優化你的html.....",{"type":21,"tag":145,"props":182,"children":185},{"src":183,"alt":184},"\u002Fimages\u002Fblog\u002Fimage_1791809622698.webp","absolute",[],{"type":21,"tag":51,"props":187,"children":189},{"id":188},"問那請問你自己手刻嗎",[190],{"type":27,"value":191},"問:那請問你自己手刻嗎?",{"type":21,"tag":30,"props":193,"children":194},{},[195],{"type":27,"value":196},"答:我一半自己手刻，另一半請AI生成，它生成完的我再逐行看完直到我滿意，",{"type":21,"tag":30,"props":198,"children":199},{},[200],{"type":27,"value":201},"若你認真看AI生成的html，會發現有很多div包著更多的div，很多div層層包著會怎樣嗎? 在自己的專案不會怎樣，但在公司多人協力的專案會被討厭、被駡，如果你想培養自己被討厭的勇氣，我是覺得可以提交專案上去沒關係。",{"type":21,"tag":145,"props":203,"children":206},{"src":204,":alt":205},"\u002Fimages\u002Fblog\u002Fimage_1791809725198.webp","true",[],{"type":21,"tag":145,"props":208,"children":210},{"src":209,":alt":205},"\u002Fimages\u002Fblog\u002Fimage_1791809542477.webp",[],{"title":7,"searchDepth":212,"depth":212,"links":213},2,[214,218,221,222],{"id":24,"depth":212,"text":28,"children":215},[216],{"id":53,"depth":217,"text":53},3,{"id":89,"depth":212,"text":89,"children":219},[220],{"id":109,"depth":217,"text":112},{"id":125,"depth":212,"text":128},{"id":168,"depth":212,"text":168,"children":223},[224],{"id":188,"depth":217,"text":191},"markdown","content:blog:why-i-built-taiwan-agriculture-price-tracker.md","content","blog\u002Fwhy-i-built-taiwan-agriculture-price-tracker.md","blog\u002Fwhy-i-built-taiwan-agriculture-price-tracker","md",[232,235],{"_path":233,"title":234},"\u002Fblog\u002Fi-dropped-something","這時代還有人自己手刻HTML和SCSS?",null,1794846161986]