hazzelnut / whoishiring

A job board app based off of the whoishiring posts on HN
https://whoishiring-app.fly.dev
MIT License
3 stars 1 forks source link

Feature request: negative filters #3

Open gushogg-blake opened 1 week ago

gushogg-blake commented 1 week ago

Negative filters would be great. If you don't do React, it filters out 95% of frontend positions. Would it be easy to implement this and would you be open to a PR for it?

hazzelnut commented 1 week ago

Hey @gushogg-blake, I'd be open to both! I'll have to go back to the drawing boards to see how we can fit this into the design. Because I still would love to keep it simple for desktop and mobile use too.

Yeah, if you have a PR I'd love to take a look, thanks :)

gushogg-blake commented 1 week ago

Great! I tried deploying to Fly but getting a 500 at https://whoishiring-cold-dawn-8792.fly.dev/:

$ fly logs -a whoishiring-cold-dawn-8792

Waiting for logs...

2024-11-04T17:47:45.890 app[d8dd997b06ed38] lhr [info] Error: connect ECONNREFUSED 127.0.0.1:5432

2024-11-04T17:47:45.890 app[d8dd997b06ed38] lhr [info] at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)

Do I need to set up Postgres or something?

hazzelnut commented 1 week ago

Good catch! I haven't updated the README for deployment, but yes you do need to set up Postgres. As I'm revisiting my codebase from a long time ago, I may miss on some details but here's to get it running:

To test locally with Postgres, you need to create a .env file in the root directory:

DATABASE_URL=postgres://localhost:5432/{insert_db_name}

Then run npm run migrate which should call Drizzle to set up the DB for you.

Next, you need to populate the DB with data. Under the /cron folder is where the data is fetched from HN and populated into the DB.

Create another .env file inside the /cron folder

DATABASE_URL=postgres://localhost:5432/{insert_db_name}

Running npm run schedule should suffice. It'll fetch every 5 minutes, but feel free to modify the frequency under cron.ts

That should get you up and running for local development.

For deployment to Fly.io, that involves a few more manual steps using flyctl - to setup postgres and cron job. If you feel so inclined I can explain more but I'll leave you with some high level steps to get it running.

Let me know how this goes for you!

gushogg-blake commented 1 week ago

Got it running, thanks!

gushogg-blake commented 1 week ago

I've made a PR just to show a possible approach, not ready to merge as it doesn't implement it on the backend: https://github.com/hazzelnut/whoishiring/pull/4

hazzelnut commented 2 days ago

Thanks for setting up the PR! I got it running locally and will play around with it to get the backend working. I've got some commitments for other work at the moment, but I will jump back to this when I get the chance.