Repository navigation
Description
Award: $50
Summary
The template checks its own settings by hand, and only checks PORT. The porting guide tells you to read your database connection string from the environment and put it in .env, but never says what to call it, and .env.example only lists PORT. Add one settings file, src/env.ts, that validates PORT and DATABASE_URL when the server starts, then list DATABASE_URL in .env.example and name it in the porting guide. DATABASE_URL stays optional, because the template runs on its bundled sample data until you connect a database.
Acceptance criteria
-
src/env.tschecks settings once at startup with a Zod schema coveringPORTand an optionalDATABASE_URL, and replaces thePORTcheck insrc/index.ts - An invalid
PORT(for examplePORT=abc) or an invalidDATABASE_URL(for exampleDATABASE_URL=not-a-url) stops the server before it starts (exit code 1) and prints each failing setting and why. An empty or unsetPORTstill starts on 3000. -
DATABASE_URL, when set, must be a URL (any scheme) -
.env.examplelistsDATABASE_URLalongsidePORT - The porting guide names
DATABASE_URLas the setting for the connection string - Tests in
test/cover a valid config, a badPORT, an emptyPORT, and a badDATABASE_URL - Continuous integration passes
- Changes follow the template's own CONTRIBUTING.md
Where to look
The template has its own repository, common-grants/cg-api-template-hono. Start with the PORT check in src/index.ts, which the new settings file replaces, then .env.example and section 1 of PORTING.md. Zod is already a dependency. Open your pull request in cg-api-template-hono and put Closes HHS/simpler-grants-protocol#1228 in its description.
In your claim's approach line, tell us how you'll keep an empty PORT from turning into 0. In your pull request, tell us one thing in PORTING.md that was unclear when you first read it, or say "nothing."
To claim this issue
Open a comment with /claim and include the following, pasting the confirmation exactly as written. See the paid contributor terms.
/claim
- [x] I confirm that I am a United States person aged eighteen or over, that I meet the eligibility requirements in section 1 of the paid contributor terms, that I have read and I agree to the paid contributor terms, and that any work I submit is mine to contribute.
GitHub username: @your-username
Does your organization benefit from this work? If yes, how:
How I plan to approach this: one lineThe program administrator will assign the issue and post your deadline. Please do not start substantial work before the issue is assigned to you.
Once you're assigned, email commongrants-contributors@agile6.com with your GitHub username and a link to the issue, so we can reach you privately about payment.
Your pull request title should follow the title format in CONTRIBUTING.md. If it doesn't, a maintainer will fix it before merging.
Claims
Maintained by the program administrator. The first complete claim is assigned. The others are listed in the order they claimed and are offered the issue if it comes free.
| Contributor | Eligibility confirmed | Status | Deadline | Pull request |
|---|---|---|---|---|
| @robbzzilla | Yes | Assigned | December 2, 2026 |
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
SnowboardTechie commentedon Sep 23, 2026
[-][Dev tool] Add `DATABASE_URL` and a `.env.example` to the Hono.js API template[/-][+][Dev tool] Validate settings at startup and add `DATABASE_URL` to the Hono.js API template[/+]robbzzilla commentedon Nov 17, 2026
/claim
GitHub username: @robbzzilla
Does your organization benefit from this work? If yes, how: Robert Hampton is contributing independently. His engineering revenue project would benefit from the award and implementation experience.
How I plan to approach this: Normalize an unset or empty PORT to 3000 before Zod coercion, validate PORT and optional DATABASE_URL once at startup, report every invalid field, then update .env.example, PORTING.md and the required regression tests.
Submitted on Robert Hampton's behalf by his authorized AI assistant. Robert personally confirmed eligibility and that he has read and agrees to the paid contributor terms. Implementation and verification will use disclosed AI assistance under this account. We will wait for assignment and the recorded deadline before substantial implementation.
laurabelinfante commentedon Nov 18, 2026
Hi @robbzzilla, this is assigned to you. Your deadline to open a pull request that's ready for review is December 2, and we'll check in here on November 25.
Next step: please email commongrants-contributors@agile6.com with your GitHub username and a link to this issue, so we can reach you privately about payment.
For the record, you've disclosed that your independent engineering business may benefit from the award and the experience of this work.