4
7
Fork
You've already forked apply.coop
2
The source for apply.coop https://apply.coop
  • Go 81.2%
  • templ 14.6%
  • CSS 4.1%
  • Shell 0.1%
2025年12月12日 20:48:00 +01:00
.woodpecker Renames woodpecker config file 2025年04月03日 01:14:04 -04:00
cmd/seed (Linter) gofumpt Format 2025年06月17日 08:31:20 -04:00
config Re-home JobsPerQueryLimit to the db Package 2025年06月13日 12:55:50 -04:00
db invert checks 2025年08月18日 10:36:49 -04:00
email Merge branch 'main' into refactor/biz-logic-metrics 2025年04月02日 23:58:03 -04:00
kerror handle co-ops not being found by slug 2025年05月15日 12:19:11 -04:00
khttp this should be info logs 2025年05月23日 13:42:22 -04:00
kimage adds more whitespace padding to the image so it doesnt get chopped off by LinkedIn 2025年05月28日 15:17:24 -04:00
localize Adds more translations 2025年04月18日 16:29:50 -04:00
log Experiment: Unify All Job Query Filter Inputs 2025年06月17日 08:08:32 -04:00
markdown Addresses feedback 2025年04月18日 15:58:01 -04:00
metrics Moves metric creation to the package in which they are observed 2025年04月02日 23:41:00 -04:00
migrations removed all smart quotes in project 2025年06月09日 14:37:36 -04:00
proc Ensures main context is for setup only 2025年04月13日 23:59:06 -04:00
scripts build script for releases 2025年05月28日 15:55:23 -04:00
social refresh the bluesky session on an interval 2025年08月19日 13:27:51 -04:00
static Made heading levels more semantic 2025年08月06日 11:50:36 -04:00
templates index message with cta to email us workplace suggestions 2025年12月12日 08:18:10 -05:00
testdata testdata uses new workplaces table and workplace_id 2025年05月22日 09:10:50 -04:00
translation index message with cta to email us workplace suggestions 2025年12月12日 08:18:10 -05:00
web now the root is the same as /workplaces with some UI tweaks 2025年12月11日 10:24:01 -05:00
.editorconfig editorconfig settings to match current code 2025年03月10日 18:13:20 -04:00
.example.config.toml integrate resend client as an email provider 2025年04月02日 15:21:13 -04:00
.gitignore Removed a bunch of jobs elements & language 2025年12月09日 15:14:18 -05:00
.golangci.yaml Increase golangci-lint timeout 2025年04月03日 01:04:24 -04:00
CODE_OF_CONDUCT.md if folks have it in their hearts to help out 2025年06月11日 14:20:26 -04:00
go.mod initial work of the social outlet channels 2025年06月13日 14:29:55 -04:00
go.sum initial work of the social outlet channels 2025年06月13日 14:29:55 -04:00
LICENSE Adds MPL 2.0 LICENSE 2025年03月27日 23:10:06 -04:00
main.go refresh the bluesky session on an interval 2025年08月19日 13:27:51 -04:00
README.md if folks have it in their hearts to help out 2025年06月11日 14:20:26 -04:00

apply.coop

A job board for co-ops. More info about our hosted version is available at apply.coop.

Codeberg CI Status

Contributing

Since we are building this in public, we value any contributions from folks who find this project valuable. There are many ways to contribute to:

  • Patches and pull requests
  • Documentation
  • Testing and bug finding/squashing
  • Financially

Before you get started, please review our Code of Conduct. Our goal is to improve the world, and we cannot do that unless we treat each other with respect.

System Dependancies

Installing Go

Read the instructions for your platform at https://go.dev/doc/install.

Installing SQLite (optional)

Rust may complain if there are missing libraries for SQLite so if you need to install SQLite then you can use whatever system package manager is convenient to install it.

  • Mac: brew install sqlite. Note: if you have already installed Xcode command line tools, you can skip this, as you will already have sqlite3 installed.
  • Ubuntu: sudo apt install sqlite3

Configuration

The apply application can be configured via flags, environment variables, or TOML config file(s).

To see command line usage, run go run main.go -h

By default, the application looks for a config.toml file in the same directory from which it is executed. An example config file can be found at .example.config.toml.

You can simply run the following for a minimal development configuration without the need for flags or environment variables:

% cp .example.config.toml config.toml

Running

You can easily run the app by using the following command:

% go run main.go

However, we use templ for HTML templating. If you modify any of the templates/*.temp files you need to re-generate them to create their *.go versions.

Simply run:

% go generate ./...

Then you can run it as normal. You can even chain them together:

% go generate ./... && go run main.go

Load up the browser at http://0.0.0.0:8080

Seeding Database

By default, there will be no data in the database when migrations are run. If you would like to seed the database with an account and some podcasts then you can run the following:

% go run ./cmd/seed

Tools

We use Go 1.24's new tool directive in go.mod to declare any additional tools we need for development.

Testing

Use go to run then.

% go test -race -cover ./...

Formatting

We use gofumpt to format the code. See the instructions there to set it up with your editor/IDE.

You run it to format the project with:

% go tool gofumpt -w .

Linting

We use golangci-lint to lint the code. You can install it with:

% curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.0.2

From their documentaion, it is not recommended to use go get to install it.

Then run it with:

% golangci-lint run

Localization

Tip: When localizing a string that is used in multiple places, make a constant.

Available Languages

This is controlled in two places:

translation/translation.go

//go:generate go tool gotext -srclang=en-US update -out=catalog.go -lang=en-US,es-419 applycoop/web/context applycoop/web/middleware applycoop/web/handler applycoop/templates

This lets the gotext tool know which languages we want to translate to and picks up any usages of the message.Printer underneath our Localizer(s). If we end up using localization in other packages, just add it to the list at the end of the generate string.

localize/localize.go

var matcher language.Matcher
var locales map[language.Tag]*Localizer

These are used by our middleware to pick up the translated messages and use the correct language catalog.

Recognizing Newly-Added, Translatable Strings

% go generate ./...

This picks up any new calls to applycoop/web/context.Localize and generates new files for each of our (currenly two) locales at translation/locales/{locale}/out.gotext.json

We then need to move the new out.gotext.json files to the messages.gotext.json files.

% mv -f ./translation/locales/en/{out,messages}.gotext.json
% mv -f ./translation/locales/es/{out,messages}.gotext.json

We only deal with messages.gotext.json files in the repository. The out.gotext.json files are ignored.

Updating Translations

We would perform any necessary translations on the translation/locales/{locale}/messages.gotext.json file(s).

Then run:

% go generate ./...

This updates the generated translation/catalog.go file.

Example Usage

Example from a *.templ file:

import (
 webctx "applycoop/web/context"
)
// ...
templ Thing() {
 <p>{ webctx.Localize(ctx, "This should be translated to multiple languages.") }</p>
}