The News

Host this site on Vercel yourself.

This website is made to be hosted on Vercel. That makes it easy if you want to deploy it yourself! This guide leads you through all the steps of deploying the website and API through Vercel.

Requirements

.env

Use the .env.example as a reference. Add environmental labels through the official Vercel dashboard. If you want your key leaked, you can also just put them publicly on GitHub. (dont sue me if it goes wrong tho)

VariablePurpose
HACK_CLUB_AI_API_KEYUsed to search for news.
GROQ_API_KEYAI provider for generating summaries.
GROQ_MODELOptional. The name of the model you want to use.
GROQ_TEMPERATUREOptional. Generation temperature.
NEWS_SUBJECTSOptional. List of what subjects there should be news about. Default: Technology, Business, Science, Health, Climate, Sports, Entertainment, and AI.
CRON_SECRETOptional. Bearer secret checked by the scheduled refresh endpoint.
BLOB_READ_WRITE_TOKENNeeded to store the news when hosting on Vercel.
USE_BLOB_STORAGESet this to true when using blob storage outside of Vercel.
REFRESH_INTERVAL_HOURSOptional. Defines how long it takes untill the next refresh.

Deploy to Vercel

  1. Add the environmental labels in Vercel
  2. Make a blob storage thing so your data gets saved every refresh.
  3. Deploy the project.
  4. Try using /api/health and /api/news after the first refresh.

Local

Make a .env following the example from .env.example. Then, run npm install and npm run dev