Self-hosted sources with AI
Updated
Choose a prompt to deploy NewsNow or OmniTrends with AI, then enter your deployed news API URL in TrendRadar’s configuration.
Recommended: Cloudflare Pages + D1. No server to rent; personal use can start on the Free plan. Deployment guide
A quick review makes deployment more reassuring
Ask AI to review code and dependencies before installing; review cannot guarantee safety.
1. Choose a prompt
How can your AI help?
AI edits files and runs commands; you handle account login and required authorization.
Choose a project, copy its prompt and fill in the brackets. Say “unsure” where needed.
Based on the maintainer’s NewsNow deployment; manual setup may be missing. Ask AI to adapt the steps to your version and environment.
NewsNow
OmniTrends
TrendRadar’s default trending-news source; also deployable as your own news website.
NewsNow · AI operates your computer
Help me deploy NewsNow: https://github.com/newsnext/newsnow
Use Cloudflare Pages + D1 on Free plans, with the free pages.dev address by default.
My details: OS [ ]; Cloudflare account [ ]; custom domain [none / domain]; login/sync [needed / not needed]; chosen sources [ ]; Mainland China access [needed / not needed].
Complete authorized file edits and checks yourself; I handle account login. Reuse existing authorization and report actual results.
1. Review before installing
Read the actual repository and record its revision. Review dependencies, install hooks, deployment scripts, backend requests and any fork changes. Report material issues with file evidence and review gaps; AI review cannot guarantee safety. Explain the deployment plan and wait for my confirmation before executing project code.
NewsNow: check nitro.config.ts, example.wrangler.toml and build scripts against the selected version.
2. Build and deploy
Use current Cloudflare documentation and the project's lockfile to choose compatible Node.js, package-manager and Wrangler versions.
Default to local build + Wrangler upload. If I need Git auto-deployment, choose Git integration before project creation; Direct Upload cannot switch to it in place.
Prefer wrangler login with login completed by me. If a token is needed, use a scoped CLOUDFLARE_API_TOKEN stored locally; never read its value into chat, logs or Git.
Configure my Pages project, D1 binding (NEWSNOW_DB if required), ENABLE_CACHE and INIT_TABLE. Build with CF_PAGES=1; verify dist/output/public contains the complete _worker.js backend and frontend, then deploy to the agreed project. Follow the selected version if paths differ.
Keep the full website and default API path. Frontend removal and custom paths are separate optional tasks.
Bind a custom domain only if requested; preserve existing DNS records and confirm changes to them or Nameservers. Check HTTPS and actual network access. Explain Free quotas; ask before paid services, data deletion or service disruption.
3. Verify and hand over
Check the homepage and two chosen sources at the actual endpoint, normally /api/s?id=<source-id>&latest. Require success/cache JSON with usable items, not just HTTP 200. Verify production D1 behavior and report failed checks.
Deliver the URL for TrendRadar's platforms.api_url without query parameters, the deployed revision, and brief update, backup and rollback commands. A Pages rollback does not restore D1 data.
References:
https://developers.cloudflare.com/pages/get-started/direct-upload/
https://developers.cloudflare.com/pages/configuration/custom-domains/
https://developers.cloudflare.com/pages/functions/pricing/
https://developers.cloudflare.com/d1/platform/pricing/2. Cloudflare deployment and your domain
Use the maintainer’s NewsNow approach: build locally, upload with Wrangler and store data in D1. Let AI choose compatible tool versions.
- Review the code, authorize Wrangler and configure D1.
- Build with CF_PAGES=1 and upload with Wrangler.
- Verify website/API access, bind a custom domain if needed, and save backup and maintenance instructions.
For automatic Git deployments, choose Git integration at project creation; an existing Direct Upload project cannot be converted to Git integration. Cloudflare upload guide
Authorize Wrangler
Wrangler is Cloudflare’s deployment tool. Its authorization is separate from your model API key.
- Recommended: Run wrangler login and complete the login yourself.
- API Token:If needed, create a scoped, expiring token and set CLOUDFLARE_API_TOKEN locally. Give AI only the variable name or storage location.
Avoid the Global API Key. Keep tokens out of chat and tool output, and revoke them when no longer needed. Token guide
Choose your AI service carefully for account operations
Prefer an official provider such as the official DeepSeek API with a trusted tool-enabled client. Before using a third-party service, check how it handles and retains data. Keep credentials local regardless of provider.
Using the Free plan
Cloudflare runs within Free plan quotas; exceeding them may cause request failures. Current limits: Pages Functions / D1
Your own domain and Mainland China access
The free pages.dev address can be used directly. If you want a custom domain, follow the steps below. Test access on your users’ networks, especially in Mainland China.
- Use an existing domain, or register one if needed with a registrar that supports Nameserver changes.
- Add it to Cloudflare DNS on Free; preserve existing records and let AI check DNSSEC.
- Set the registrar’s Nameservers to Cloudflare’s assigned values and wait for activation.
- Add the domain you want to use (for example, news.example.com) under Pages → Custom domains, then verify HTTPS and API access.
HTTPS certificates are free. Cloudflare issues and renews certificates after domain validation. Wait for activation, then verify HTTPS. Certificate details
You can keep your current registrar when moving DNS hosting to Cloudflare. Root domains require Cloudflare nameservers; for a subdomain, you can instead keep your current DNS provider and add a CNAME after linking the subdomain in Pages. Domain binding / DNS migration
Test the networks you actually use
A custom domain cannot guarantee reliable access across Mainland China. Test both visitor access and upstream news fetching. Cloudflare network notes
3. Connect to TrendRadar
Set
config/config.yaml → platforms.api_url to your verified API URL:platforms:
api_url: "https://news.example.com/api/s"
# Keep existing enabled, sources and other settingsReplace the example domain and path with yours. Omit ?id= and &latest; check any PLATFORMS_API_URL environment override. Test two sources from the environment where TrendRadar runs.
Optional settings
Choose either option independently. Send its prompt to the same AI conversation; it uses the working mode selected above.
Hide the frontend, keep the API
For deployments used only by TrendRadar. The maintainer’s NewsNow setup removes generated frontend files before upload and keeps the backend. The homepage returns 404; the API remains available.
AI prompt · hide the frontend
Hide the public frontend of my deployed news source and keep the API at its current path.
Check my version first. For the reference NewsNow build, remove generated index.html, assets/ and icons/ from dist/output/public after building with CF_PAGES=1. Verify cleanup paths stay inside that output; preserve source files, D1 data, the complete _worker.js artifact and _routes.json.
Use the build → cleanup → upload order. Deploy within existing authorization; otherwise prepare the changes for review. Verify the homepage returns 404 and two sources still return usable JSON.
Complete authorized file edits and checks yourself; I handle account login. Reuse existing authorization and report actual results.Change the API path
Let AI generate a random prefix and change /api/s to /<random-prefix>/s. Once deployed, enter the new API URL in TrendRadar using step 3. A custom path is not authentication.
AI prompt · change the API path
Generate a random 12-character prefix using lowercase letters and digits, and change my deployed news API from /api/s to /<random-prefix>/s. Keep the current frontend choice and use the deployment details from this conversation.
Check the actual version. The reference fork uses API_PREFIX in shared/consts.ts and server/routes/<prefix>/; adapt backend routes, middleware, client requests and any OAuth callbacks together.
Generate _routes.json using the same prefix, preserving other required Worker routes. This controls Worker invocation; it does not rewrite URLs.
Build and deploy within authorization, then verify two sources and that the old path no longer returns news. Keep old-path compatibility only if agreed. Return the complete new API URL without query parameters so I can enter it in TrendRadar using step 3. A custom path is not authentication.
Complete authorized file edits and checks yourself; I handle account login. Reuse existing authorization and report actual results.