···11# Hacker News Alerts
2233+
44+35<img src="https://cachet.dunkirk.sh/emojis/ycombinator/r" height="175" align="right" alt="ycombinator logo">
4655-> ### More deets coming soon ๐
66->
77-> A slack bot that tracks whether you made it to the front page of hn; made with ๐ @ [Hack Club](https://github.com/hackclub)
88->
99-> โ ๏ธ **Highly opinionated slack bot warning** - Project rapidly iterating
77+A Slack bot that tracks when you make it to the front page of Hacker News, made with ๐ @ [Hack Club](https://github.com/hackclub)
1081111-# ๐ง Dev
99+## ๐ Features
1010+1111+- **Front Page Tracking**: Get notified when your posts reach the Hacker News front page
1212+- **#1 Post Alerts**: Special notifications when your post reaches the coveted #1 position
1313+- **Leaderboard History**: Track how your posts perform over time with rank and point history
1414+- **Web Dashboard**: View all currently tracked stories and their stats
1515+- **User Verification**: Securely link your HN account with Slack using verification phrases
1616+1717+## ๐ง Development Setup
1818+1919+### Prerequisites
12201313-You can launch the bot locally with bun
2121+- [Bun](https://bun.sh/) (JavaScript runtime and package manager)
2222+- PostgreSQL database
2323+- Ngrok for local development with Slack
14241515-```bash
1616-bun install
1717-bun dev
1818-```
2525+### Local Development
19262020-you will also need to launch an ngrok tunnel and update your dev slack manifest to point to the ngrok tunnel
2727+1. Clone the repository:
21282229```bash
2323-bun ngrok
3030+git clone https://github.com/taciturnaxolotl/hn-alerts.git
3131+cd hn-alerts
2432```
25332626-also if you haven't worked with your postgres table yet then push the schema with
3434+2. Install dependencies:
27352836```bash
2929-bun db:push
3737+bun install
3038```
31393232-you also need to create a `.env` file with the following keys
4040+3. Create a `.env` file with the following variables:
33413442```bash
3543SLACK_BOT_TOKEN="xoxb-xxxxx-xxxxx-xxxxx-xxxxx"
···4048DATABASE_URL="postgres://user:password@host:5432/table_name"
4149```
42505151+4. Initialize the database schema:
5252+5353+```bash
5454+bun db:push
5555+```
5656+5757+5. Start the development server:
5858+5959+```bash
6060+bun dev
6161+```
6262+6363+6. In a separate terminal, launch ngrok to expose your local server:
6464+6565+```bash
6666+bun ngrok
6767+```
6868+6969+7. Update your Slack app's manifest in `manifest.dev.yaml` to point to your ngrok URL
7070+7171+## ๐ฑ Slack Commands
7272+7373+- `/hn-alerts-link your_username` - Link your Hacker News account
7474+- `/hn-alerts-link verify` - Verify your Hacker News account
7575+- `/hn-alerts-link unlink` - Remove your linked account
7676+- `/hn-alerts-link help` - Show command help
7777+7878+## ๐งฐ Tech Stack
7979+8080+- [Bun](https://bun.sh/) - JavaScript runtime and package manager
8181+- [Slack Edge](https://github.com/slack-edge/slack-edge) - Slack API client
8282+- [Drizzle ORM](https://orm.drizzle.team/) - Database ORM
8383+- [Sentry](https://sentry.io/) - Error tracking
8484+- [Cron](https://github.com/kelektiv/node-cron) - Scheduled tasks
8585+4386## ๐ License
44874545-The code is licensed under `AGPL 3.0`! That means AGPL 3.0 requires publishing source code changes when the software is used over a network, guaranteeing that users can access the code. All artwork and images are copyright reserved but may be used with proper attribution to the authors.
8888+The code is licensed under `MIT`! See the [LICENSE.md](LICENSE.md) file for more details.
46894790<p align="center">
4891 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />