···45<img src="https://cachet.dunkirk.sh/emojis/ycombinator/r" height="175" align="right" alt="ycombinator logo">
67-A Slack bot that tracks when you make it to the front page of Hacker News, made with 💖 @ [Hack Club](https://github.com/hackclub)
00089-## 🚀 Features
1011-- **Front Page Tracking**: Get notified when your posts reach the Hacker News front page
12-- **#1 Post Alerts**: Special notifications when your post reaches the coveted #1 position
13-- **Leaderboard History**: Track how your posts perform over time with rank and point history
14-- **Web Dashboard**: View all currently tracked stories and their stats
15-- **Individual Story Pages**: View detailed information about any story using HN-compatible URLs
16-- **User Verification**: Securely link your HN account with Slack using verification phrases
1718-## 🚧 Development Setup
0001920-### Prerequisites
21-22-- [Bun](https://bun.sh/) (JavaScript runtime and package manager)
23-- PostgreSQL database
24-- Ngrok for local development with Slack
02526-### Local Development
2728-1. Clone the repository:
2930```bash
31-git clone https://github.com/taciturnaxolotl/hn-alerts.git
32-cd hn-alerts
33```
3435-2. Install dependencies:
3637```bash
38-bun install
39```
4041-3. Create a `.env` file with the following variables:
4243```bash
44SLACK_BOT_TOKEN="xoxb-xxxxx-xxxxx-xxxxx-xxxxx"
···46SLACK_CHANNEL="C08KX2YNN87"
47NODE_ENV="dev"
48SENTRY_DSN="https://xxxxxx@xxxxxx.ingest.us.sentry.io/xxxx"
49-DATABASE_URL="postgres://user:password@host:5432/table_name"
50```
5152-4. Initialize the database schema:
5354```bash
55bun db:push
56```
5758-5. Start the development server:
59-60-```bash
61-bun dev
62-```
63-64-6. In a separate terminal, launch ngrok to expose your local server:
65-66-```bash
67-bun ngrok
68-```
69-70-7. Update your Slack app's manifest in `manifest.dev.yaml` to point to your ngrok URL
71-72## 📱 Slack Commands
7374- `/hn-alerts-link your_username` - Link your Hacker News account
75-- `/hn-alerts-link verify` - Verify your Hacker News account
76- `/hn-alerts-link unlink` - Remove your linked account
77- `/hn-alerts-link help` - Show command help
7879-## 🧰 Tech Stack
80-81-- [Bun](https://bun.sh/) - JavaScript runtime and package manager
82-- [Slack Edge](https://github.com/slack-edge/slack-edge) - Slack API client
83-- [Drizzle ORM](https://orm.drizzle.team/) - Database ORM
84-- [Sentry](https://sentry.io/) - Error tracking
85-- [Cron](https://github.com/kelektiv/node-cron) - Scheduled tasks
86-87## 📜 License
8889-The code is licensed under `MIT`! See the [LICENSE.md](LICENSE.md) file for more details.
9091<p align="center">
92 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
···45<img src="https://cachet.dunkirk.sh/emojis/ycombinator/r" height="175" align="right" alt="ycombinator logo">
67+> ### Your personal Hacker News success tracker 📈 🔔 🚀
8+> A slack bot that tracks when you make it to the front page of Hacker News; developed with 💖 @ [Hack Club](https://github.com/hackclub)
9+>
10+> ⚠️ **Highly optionated / mad teenager rants at computer warning** - From "I wish I had this" to "now we all do"
1112+## 🔥 What it does
1314+HN Alerts watches Hacker News for you and anyone else that chooses to trust your instructions to run `/hn-alerts-link`, notifying you through Slack when:
000001516+- Your posts appear on the front page (top 30)
17+- Your posts climb the rankings
18+- Your posts reach the coveted #1 position 🏆
19+- Any significant changes to your post's performance
2021+The dashboard provides:
22+- Real-time position tracking with historical graphs
23+- Performance metrics (peak position, time on front page, comment activity)
24+- Leaderboard of all tracked stories
25+- Detailed analytics for each post's journey
26+- An excellent caching mechanism (this took me so very long to implement)
2728+## 🚧 Dev
2930+You can launch the bot locally with bun
3132```bash
33+bun install
34+bun dev
35```
3637+you will also need to launch an ngrok tunnel and update your dev slack manifest to point to the ngrok tunnel
3839```bash
40+bun ngrok
41```
4243+you also need to create a `.env` file with the following keys
4445```bash
46SLACK_BOT_TOKEN="xoxb-xxxxx-xxxxx-xxxxx-xxxxx"
···48SLACK_CHANNEL="C08KX2YNN87"
49NODE_ENV="dev"
50SENTRY_DSN="https://xxxxxx@xxxxxx.ingest.us.sentry.io/xxxx"
051```
5253+Don't forget to initialize your database:
5455```bash
56bun db:push
57```
580000000000000059## 📱 Slack Commands
6061- `/hn-alerts-link your_username` - Link your Hacker News account
62+- `/hn-alerts-link verify` - Verify your Hacker News account (post the challenge code to your HN profile)
63- `/hn-alerts-link unlink` - Remove your linked account
64- `/hn-alerts-link help` - Show command help
650000000066## 📜 License
6768+The code is licensed under `MIT`! That means MIT allows for free use, modification, and distribution of the software, requiring only that the original copyright notice and disclaimer are included in copies.
6970<p align="center">
71 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
···50 <meta property="og:title" content="HN Alerts Dashboard" />
51 <meta
52 property="og:description"
53+ content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!"
54 />
55 <meta property="og:image" content="/public/og.png" />
56 <meta
57 property="og:image:alt"
58+ content="a screenshot of the app with graphs for my friend cyao's ice pi!"
59 />
60 <meta property="og:image:width" content="1200" />
61 <meta property="og:image:height" content="630" />
···66 <meta name="twitter:title" content="HN Alerts Dashboard" />
67 <meta
68 name="twitter:description"
69+ content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!"
70 />
71 <meta name="twitter:image" content="/public/og.png" />
72 <meta
73 name="twitter:image:alt"
74+ content="a screenshot of the app with graphs for my friend cyao's ice pi!"
75 />
7677 <link
···62 />
63 <meta
64 property="og:description"
65+ content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts."
66+ content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!"
67 />
68 <meta property="og:image" content="/public/og.png" />
69 <meta
70 property="og:image:alt"
71+ content="a screenshot of the app with graphs for my friend cyao's ice pi!"
072 />
73 <meta property="og:image:width" content="1200" />
74 <meta property="og:image:height" content="630" />
···83 />
84 <meta
85 name="twitter:description"
86+ content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts."
87+ content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!"
88 />
89 <meta name="twitter:image" content="/public/og.png" />
90 <meta
91 name="twitter:image:alt"
92+ content="a screenshot of the app with graphs for my friend cyao's ice pi!"
093 />
9495 <link