Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Optional Postgres support for self-hosting

Open
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, javascript, node.js, postgresql, sqlite

Research direction

Start by reading backend/db.js to map the existing database operations and schema, then inspect SQLite-specific SQL in backend/routes/ and backend/server.js. Run npm test and node scripts/check-boundary.js to establish the current baseline. This is explicitly a large, multi-PR change; done means both database test runs pass, a seeded SQLite database migrates with table row counts reported, and self-hosting docs are updated.

Written by the indexing model from the issue text.

Description

enhancement help wanted

CodeArena runs on SQLite only. That is perfect for a small instance, but a busy self-hosted copy wants a managed database with backups, replicas and more than one backend process.

Goal

Optional Postgres support selected by DATABASE_URL, with SQLite remaining the default and zero-config.

What to do

  • Put database access behind a small adapter with the operations the code already uses (run, get, all, transactions), with one implementation per engine.
  • Translate schema and migrations in backend/db.js for Postgres: autoincrement ids, INTEGER booleans, text dates and INSERT OR IGNORE style statements all differ.
  • Find and fix SQLite-only SQL across backend/routes/ and backend/server.js. List each pattern you changed in the pull request.
  • A one-way migration script that copies an existing SQLite database into an empty Postgres database and checks row counts per table.

Rules

  • Run the whole backend test suite against both engines in CI, using a Postgres service container. A feature is not done if it only passes on one.
  • No ORM rewrite. Keep the SQL readable and close to what is there.

Definition of done

  • npm test green on SQLite and Postgres.
  • A real migration of a seeded local database, with row counts in the pull request.
  • Self-hosting docs updated, including the Docker setup if #10 has landed.
  • node scripts/check-boundary.js passes.

Large change: please comment with a plan and split it into several pull requests.

Dominant language
JavaScript
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sennaicodes/codearena

All issues in sennaicodes/codearena

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.