- A self-hostable project that generates weekly movie recommendations and sends them via email using Cloudflare Workers.
- Bun (JS Runtime), A Cloudflare account, Google AI and Resend API keys.
- Cloudflare Workers, Google's Generative AI (Model: Gemini 1.5 Pro), Resend (to send emails), and Cloudflare KV (to store previous responses and improve the new ones).
- 
Clone the repository: git clone https://github.com/zxcodes/Suggestify.git
- 
Install dependencies: bun install
- 
Create a .dev.varsfile in the root and store your API secrets there. An.envfile won't work here since workers don't run in a typical Node environment.
- RESEND_API_KEY: Your Resend API key
- API_KEY: Your Google AI API key
- Create a KV namespace called SUGGESTIONS_STOREusing Wrangler or CF Dashboard.
- Configure your wrangler.tomlfile with the necessary bindings and environment variables (Refer CF Docs).
- Start the dev server by running bun devand hit the cron bycurl http://localhost:8787/__scheduled
- Authenticate with Cloudflare: wrangler login
- Deploy the worker: bun deploy
- To View logs from the deployed worker, do bun logs
- The .dev.varsfile is only for local dev. Use wrangler to upload your secrets to CF so that they're available when you deploy your worker. You can add secrets by runningwrangler secret put <KEY>