Coder Social home page Coder Social logo

job-board's People

Contributors

aaronarduino avatar alok-38 avatar cassonmars avatar cjprieb avatar kevinfalting avatar sethetter avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

job-board's Issues

Run the worker immediately at startup

I figured out how to address the problem of the worker waiting an hour to run at startup that I raised here: #17 (comment)

It was bothering me, so I thought about it a little bit and came up with this. I really like it. 😄

wg.Add(1)
go func() {
	defer wg.Done()
	ticker := time.NewTicker(time.Hour)
	defer ticker.Stop()

	for {
		_, err := db.Exec("DELETE FROM jobs WHERE published_at < NOW() - INTERVAL '30 DAYS'")
		if err != nil {
			log.Println(fmt.Errorf("error clearing old jobs: %w", err))
		}

		select {
		case <-ctx.Done():
			log.Println("shutting down old jobs background process")
			return

		case <-ticker.C:
			continue
		}
	}
}()

List jobs from newest to oldest

Would be nice to see the newest job postings at the top of the index page rather than at the bottom. The query doesn't specify an order, so it just gets results back in index order.

Let's add ORDER BY published_at DESC to the getAllJobs func.

func getAllJobs(db *sqlx.DB) ([]Job, error) {
	var jobs []Job

-	err := db.Select(&jobs, "SELECT * FROM jobs")
+	err := db.Select(&jobs, "SELECT * FROM jobs ORDER BY published_at DESC")
	if err != nil && !errors.Is(err, sql.ErrNoRows) {
		return jobs, err
	}

	return jobs, nil
}

fix inline error display on new/edit job forms

when reviewing #13, I noticed that the validate method was map[string]string but the templates expect map[string][]string (slice of strings per field) for the inline errors.

also, even after correcting that, the errors didn't seem to be displaying. my hunch is that there is something up with the flash messages.

update Go to latest version

We're running on go1.18, which will be unsupported when go1.20 is released next month (anticipated). We need to update Go to the latest version at the time someone picks up this issue.

Optionally, update the go.mod file, and double-optionally, update dependencies.

Create a db seed

When developing locally, it would be nice to have a script that adds dummy data to the database so that we can interact with it from the web for testing. ~50 rows will do.

GitHub deploy actions require updates

After the latest deploy, there were some warnings.

Let's see what we can do to resolve them. 👍

Provide more guidance within posting form to users

I think that we could put answers to these questions inline in the form in order to make it easier for job posters:

Jim Rice⁉️ 1 day ago
It says the Description is optional if no link is available. Will it always be used? I'd like to just put a few explainer lines in there, in addition to providing a link.

Jim Rice⁉️ 1 day ago
Also, does this automatically post the job, or is there a review/approval/moderation step?

Jim Rice⁉️ 1 day ago
Also Also - does my email get posted publicly?
I'm realizing now that I could probably answer that last one by reviewing other jobs on the board - but it was a question I asked myself as I hovered over the "Publish" button. (edited)

Seth Etter:adhoc: 1 day ago
Auto posts

Seth Etter:adhoc: 1 day ago
Email is not public — you are emailed an edit link
❤️
1

Seth Etter:adhoc: 1 day ago
Description is always used, even with a link, but only displays on the individual job post view page, like this one

Seth Etter:adhoc: 1 day ago
If a URL is provided, clicking the posting from the home page will take the user to that URL. But clicking the “Posted on YYYY/MM/DD” text under the posting will take them to the view page

Seth Etter:adhoc: 1 day ago
With no URL, both things will go to the view page

Seth Etter:adhoc: 1 day ago
(So there’s a good chance users won’t see the description if a URL is also provided unfortunately, unless they know to click that “Posted on …” link) (edited)

1

logging sensitive data

This is happening locally, don't know if it's also happening in prd, but we're logging the tokens for editing a post.

job-board-app-1  | 2022/09/27 14:07:07 main.go:108: server listening on port :8080
job-board-app-1  | [GIN] 2022/09/27 - 14:07:16 | 200 |    8.339653ms |      172.19.0.1 | GET      "/"
job-board-app-1  | [GIN] 2022/09/27 - 14:07:16 | 304 |    2.037051ms |      172.19.0.1 | GET      "/assets/css/app.css"
job-board-app-1  | [GIN] 2022/09/27 - 14:07:16 | 304 |    2.724662ms |      172.19.0.1 | GET      "/assets/svg/devict-logo.svg"
job-board-app-1  | [GIN] 2022/09/27 - 14:07:16 | 304 |    1.826482ms |      172.19.0.1 | GET      "/assets/svg/circuit-board.svg"
job-board-app-1  | [GIN] 2022/09/27 - 14:07:16 | 404 |       3.887µs |      172.19.0.1 | GET      "/favicon.ico"
job-board-app-1  | [GIN] 2022/09/27 - 14:07:19 | 200 |     2.62795ms |      172.19.0.1 | GET      "/new"
job-board-app-1  | [GIN] 2022/09/27 - 14:08:01 | 302 |  1.061981724s |      172.19.0.1 | POST     "/jobs"
job-board-app-1  | [GIN] 2022/09/27 - 14:08:01 | 200 |      4.1646ms |      172.19.0.1 | GET      "/"
job-board-app-1  | [GIN] 2022/09/27 - 14:09:27 | 200 |    5.221391ms |      172.19.0.1 | GET      "/jobs/54/edit?token=tvtxz2yUaSZsK4ewEuRR1wtOlGs%3D"
job-board-app-1  | [GIN] 2022/09/27 - 14:10:01 | 302 |    2.525355ms |      172.19.0.1 | POST     "/jobs/54?token=tvtxz2yUaSZsK4ewEuRR1wtOlGs%3d"
job-board-app-1  | [GIN] 2022/09/27 - 14:10:01 | 200 |    3.684014ms |      172.19.0.1 | GET      "/"
job-board-app-1  | [GIN] 2022/09/27 - 14:10:10 | 200 |    3.791154ms |      172.19.0.1 | GET      "/jobs/54"
job-board-app-1  | [GIN] 2022/09/27 - 14:10:28 | 200 |    3.905699ms |      172.19.0.1 | GET      "/jobs/54/edit?token=tvtxz2yUaSZsK4ewEuRR1wtOlGs%3D"

Add auto tagging of listings

I think it might be nice to have auto tagging of jobs for things like crypto and web3 jobs. Then maybe users could filter or at least quickly see what type a job is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.