diff --git a/.dev.env b/.dev.env new file mode 100644 index 0000000..c7fb410 --- /dev/null +++ b/.dev.env @@ -0,0 +1,29 @@ +# For prod use please use the .env.example file. +# Please use .dev.env as an starting point. Rename it to .env and fill in the values, the application needs it. + +# This is the developmemnt use .env file. + +# S3 INFO +S3_ACCESS_KEY="" +S3_SECRET_KEY="" +S3_BUCKETNAME="" +S3_ENDPOINT="" + +# GITHUB OAUTH (NOT WORKING 4n) +NUXT_GITHUB_CLIENT_ID="" +NUXT_GITHUB_CLIENT_SECRET="" + +# GLOBAL DATABASE +POSTGRES_URL="" + +# GROQ API KEY +GROQ_API_KEY="" + +# PASSWORD SALT +PASSWORD_HASH_SALT="" + +# CF TURNSTILE +NUXT_CF_TURNSTILE_SITE_KEY="" +NUXT_CF_TURNSTILE_SECRET_KEY="" + +NUXT_DEV_ENV=true diff --git a/.env.example b/.env.example index c597a30..49bbe1c 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ -# Please use .env.exmaple as an starting point. Rename it to .env and fill in the values, the application requrires it. +# For development use, please use the .dev.env file. +# Please use .env.exmaple as an starting point. Rename it to .env and fill in the values, the application needs it. # This is the default .env file. diff --git a/.github/OTHER/ig_story_58m.png b/.github/OTHER/ig_story_58m.png index cd92966..2f21858 100644 Binary files a/.github/OTHER/ig_story_58m.png and b/.github/OTHER/ig_story_58m.png differ diff --git a/README.md b/README.md index 1b5a3e4..0cb006e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ https://yhw.tw/news ## Issues: ### Onboarding: -Onboarding is a must for most people that are using the app for the first time, but I want to do to via a non-video like system, however implementing the function in a already large repo is kinda hard. So later this week, I will just add a basic video onboarding system. +Onboarding is a must for most people that are using the app for the first time, but I want to do to via a non-video like system, however implemnting the function in a already large repo is kinda hard. So later this week, I will just add a basic video onboading system. ### User actions via the API: Currently, user actions are broken. @@ -36,7 +36,7 @@ Chatbot, which is chatbot for chatting about news articles, is currently not ava ### Server Downtime Use https://status.yhw.tw/ for checking down time, most of the time it will be up, but sometimes it just won't updated to the latest feature & update. -#### Archive: +Archive: I fixed most issues of the server, including the nameserver stuff, if you want to know how I fixed it, you can view how I fixed it [here](/server_fixes.md) or on [My broken blog](https://4-1-2.yuanhau.com/posts/) ### Scraping restrictions: @@ -51,12 +51,9 @@ A few pages now contains translations, like the news, aboutNewsOrg and newsView ### Deploying: This code is absolutly NOT designed to be spinned up at Vercel or Netlify, it has the scraping system now inside of the main website code, oh also the entire "caching feature" is based in memory, so please don't use those platforms, for Zeabur your cost might be expensive. idk, I haven't tried hit yet. The web url: https://news.yuanhau.com is hosted on my own infra, you should too. Please get a server off of yahoo 拍賣, 蝦皮 or eBay to do so. -### The API returning outdated data from more than 5+ years: -Here is the GitHub Issue: https://github.com/hpware/news-analyze/issues/2 - ## Why? -We'll use this news article from May 7th 2025 as an example: +We'll use this news article as an example: ``` Zhu Lilun criticizes the government for being like Hitler German Institute in Taiwan: History should not be distorted for politics | Politics - CNA diff --git a/components/app/windows/hotnews.vue b/components/app/windows/hotnews.vue new file mode 100644 index 0000000..6fe8534 --- /dev/null +++ b/components/app/windows/hotnews.vue @@ -0,0 +1,70 @@ + + diff --git a/components/app/windows/settings.vue b/components/app/windows/settings.vue index b2a5a12..b5a4ee1 100644 --- a/components/app/windows/settings.vue +++ b/components/app/windows/settings.vue @@ -62,24 +62,6 @@ const submitCustomApiKey = async () => { return; } } - try { - const req = await fetch("/api/user/submitGroqKey", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - value: customApiKey.value, - }), - }); - - const response = await req.json(); - if (response.error) { - console.error("Error updating user data:", response.error); - } - } catch (error) { - console.error("Failed to submit change:", error); - } }; const checkValidApiKey = () => { @@ -98,6 +80,11 @@ const confirmDelete = async () => { showDeleteDialog.value = false; }; +const deleteAccount = async () => { + const req = await fetch("/api/user/action", { + method: "DELETE", + }); +}; const apiKey = customApiKey.value; try { const sendApi = await fetch("/api/ai/loadCustomGroqApi", { diff --git a/components/blurPageBeforeLogin.vue b/components/blurPageBeforeLogin.vue index ceaa20d..07bcaa7 100644 --- a/components/blurPageBeforeLogin.vue +++ b/components/blurPageBeforeLogin.vue @@ -1,4 +1,5 @@