mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 07:41:02 +08:00
Update docs.
This commit is contained in:
parent
48f897ed63
commit
b8438f7f33
21
README.md
21
README.md
@ -2,11 +2,17 @@
|
||||
|
||||
   
|
||||
|
||||
A Neighborhood project.
|
||||
|
||||
App Design: [PDF Document](/design.pdf)
|
||||
|
||||
Reverse engineering documentation: [about](/about/)
|
||||
|
||||
Deploy: [via docker compose](/deploy);
|
||||
|
||||
## Demo:
|
||||
You can try out the platform RIGHT NOW via this link: https://yhw.tw/news?goto=desktop
|
||||
|
||||
## Before deploying, please know this:
|
||||
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.
|
||||
|
||||
@ -14,7 +20,7 @@ This code is absolutly NOT designed to be spinned up at Vercel or Netlify, it ha
|
||||
The desktop enviroment is super unstable when even using a beefy computer, even so, the desktop will lag when opening the newsView, like it's just hates being in a dev env. Prod app works tho, so you can demo it using `bun run build && bun run preview` for demoing. Please don't file a issue request for this matter. If you have the fix, please contribute using Github PRs.
|
||||
|
||||
## news.yuanhau.com is now back up and running!
|
||||
Why? Tailscale is changing the dns server to 100.100.100.100 and it just won't find the thing correct, so I just nuked it off my server :). It works now. (Also deploying to zeabur hurt my wallet, as my system is too costly there). oof
|
||||
Why? Tailscale is changing the dns server to 100.100.100.100 and it just won't find the thing ghcr.io dns correctly (although ping ghcr.io works?), so I just nuked it off my server :), since I don't even use it that much. It works now. (Also deploying to zeabur hurt my wallet (it's like 0.07 for a day for the memory), as my system that I built based on ram is too costly there). oof, so please just self host it.
|
||||
|
||||
## Why?
|
||||
|
||||
@ -64,12 +70,11 @@ Why? Tailscale is changing the dns server to 100.100.100.100 and it just won't f
|
||||
- Cheerio
|
||||
- Sentry
|
||||
- Umami Analytics
|
||||
- Prettier
|
||||
|
||||
## Mirrors:
|
||||
- [Gitea (Self Hosted)](https://git.yhw.tw/howard/news-analyze)
|
||||
|
||||
## Demo:
|
||||
You can try out the platform now via this link: https://yhw.tw/news?goto=desktop
|
||||
- [yhw.tw Gitea](https://git.yhw.tw/howard/news-analyze)
|
||||
- [Hackclub Forgejo](https://git.hackclub.app/yuanhau/news-analyze)
|
||||
|
||||
## Preview Images:
|
||||
### Home Page:
|
||||
@ -78,7 +83,7 @@ You can try out the platform now via this link: https://yhw.tw/news?goto=desktop
|
||||
### Desktop App:
|
||||

|
||||
|
||||
## 如何執行
|
||||
## 如何執行 How to preview the app on your local device machine?
|
||||
|
||||
1. First, rename `.env.example` to `.env` and fill in the blanks.
|
||||
2. Run `bun install` to install dependencies.
|
||||
@ -103,7 +108,7 @@ Use this form: <a href="https://yhw.tw/SaBta">https://yhw.tw/SaBta</a>
|
||||
## FREE APIs:
|
||||
API Info: https://news.yuanhau.com/apis
|
||||
|
||||
If you just want to throw to an LLM and tell it to do stuff, here is the endpoints (w/cors, but I (hpware) has given permission for you to use it for free.), you are welcome to build something better than mine. Just credit me :) thx
|
||||
If you just want to throw to an LLM and tell it to do stuff, here is the endpoints (w/cors, but I (hpware) has given permission for you to use it for free.), you are welcome to build something better than mine. Just credit me :) thanks.
|
||||
|
||||
https://news.yuanhau.com/api/tabs for fetching Tabs
|
||||
|
||||
@ -127,7 +132,7 @@ The API looks like this:
|
||||
}
|
||||
```
|
||||
|
||||
https://news.yuanhau.com/api/home/lt?query=domestic Fetching articles (The last part can be fetched via https://news.yuanhau.com/datainfo/linetodayjsondata.json and DONT remove the ?query=)
|
||||
https://news.yuanhau.com/api/home/lt?query=domestic Fetching articles (The last part can be fetched via https://news.yuanhau.com/datainfo/linetodayjsondata.json and DON'T remove the ?query=)
|
||||
|
||||
The API looks like this:
|
||||
```json
|
||||
|
49
deploy.md
Normal file
49
deploy.md
Normal file
@ -0,0 +1,49 @@
|
||||
# Deploying via Docker compose
|
||||
### Prerequisites
|
||||
NOTE: This guide only has Ubuntu / Debian way of doing things, if you are using other distros, please ignore the prerequisites.
|
||||
1. Install Docker & Docker Compose via the docker deb registry. (DON'T USE THE NATIVE docker compose, as it won't work.)
|
||||
You can check out the offical docs [here](https://docs.docker.com/engine/install/debian/)
|
||||
2. Run this to install the offical docker source:
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
```
|
||||
3. Run this to install docker & docker compose:
|
||||
```bash
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
```
|
||||
4. Download the docker-compose.yml and .env.example file to an dir & change the .env.example file to .env:
|
||||
```bash
|
||||
# Chahnge your_dir to your dir in your server!
|
||||
mkdir ./your_dir
|
||||
cd ./your_dir
|
||||
curl -O https://raw.githubusercontent.com/hpware/news-analyze/refs/heads/master/docker-compose.yml
|
||||
curl -O https://raw.githubusercontent.com/hpware/news-analyze/refs/heads/master/.env.example
|
||||
mv .env.example .env
|
||||
```
|
||||
5. Get Postgres on your server or via a docker container, this compose file doesn't have postgres in there, as my prod server already has a postgresql db, if you don't please just ask, I can maybe help (or just use the basic docker image on the docker hub.)
|
||||
6. Pull down the image & if you are using a proxy, enter 127.0.0.1:36694 into the proxy forward route, and update the docker compose to your own domain, (yes a domain is required), if you are in hackclub (under 18), using their nest cloud service, you can get a domain like your_account.hackclub.app :D
|
||||
```bash
|
||||
docker compose pull
|
||||
```
|
||||
7. After doing changes. you can run these commands:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
NOTE: By shutting down or just rebooting the server, will stop the app, you need to go to that directory, and luanch it via `docker compose up -d`, if you want to stop the app, you can run `docker compose down`
|
||||
|
||||
# For updates:
|
||||
For updates, you can run the commands below:
|
||||
```bash
|
||||
docker compose down
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user