This is my Keep POC Application.
  • JavaScript 69.7%
  • HTML 11.2%
  • Shell 9.4%
  • Dockerfile 7.6%
  • CSS 2.1%
Find a file
Nishant 74514489b1
Some checks failed
CI / Test (push) Successful in 8m56s
CI / Build and push image (push) Failing after 12s
CI / Update GitOps image tag (push) Has been skipped
Updated the label
2026-11-18 17:36:11 +05:30
.forgejo/workflows Updated the label 2026-11-18 17:36:11 +05:30
_blog added blog image 2015-02-12 11:43:57 -07:00
bin Updated the Server 2026-11-18 17:29:03 +05:30
client upgraded to latest versions of node, express, and angular 2016-09-26 08:44:11 -06:00
deploy Updated the Server 2026-11-18 17:29:03 +05:30
server Updated the Server 2026-11-18 17:29:03 +05:30
test Updated the Server 2026-11-18 17:29:03 +05:30
.dockerignore Updated the Server 2026-11-18 17:29:03 +05:30
.gitignore Ignore more editor files / OS temp files 2015-09-13 19:33:18 -04:00
.jshintrc upgraded to latest versions of node, express, and angular 2016-09-26 08:44:11 -06:00
app.js upgraded to latest versions of node, express, and angular 2016-09-26 08:44:11 -06:00
Dockerfile Updated the Server 2026-11-18 17:29:03 +05:30
LICENSE upgraded to latest versions of node, express, and angular 2016-09-26 08:44:11 -06:00
package-lock.json Updated the Server 2026-11-18 17:29:03 +05:30
package.json Updated the Server 2026-11-18 17:29:03 +05:30
readme.md Updated the label 2026-11-18 17:36:11 +05:30

PostgreSQL and NodeJS

This is a basic single page application built with Node, Express, Angular, and PostgreSQL.

Quick Start

  1. Clone the repo
  2. Install dependencies: npm ci
  3. Start Postgres and create a database called todo
  4. Create the database tables: npm run init-db
  5. Start the server: npm start
  6. Open http://localhost:3000

The connection defaults to postgres://localhost:5432/todo. Override it with DATABASE_URL, or with the standard PGHOST, PGPORT, PGDATABASE, PGUSER, and PGPASSWORD variables. TLS can be enabled with PGSSLMODE and PGSSLROOTCERT.

Health endpoints:

  • GET /healthz - process is alive
  • GET /readyz - process can reach PostgreSQL

Tests

npm test

The tests use Node's built-in test runner and do not require a database. The original Apache Bench load test is still available:

sh test/load-test.sh

Docker

docker build -t node-postgres-todo:local .
docker run --rm -p 3000:3000 \
  -e DATABASE_URL=postgres://user:password@host.docker.internal:5432/todo \
  node-postgres-todo:local

The image runs as the non-root node user, uses tini as PID 1, and has a health check against /healthz.

CI

.forgejo/workflows/ci.yml runs on Forgejo Actions:

  1. Installs dependencies, runs tests, and audits production dependencies.
  2. Builds and pushes an image tagged with the commit SHA and latest to the Forgejo container registry.
  3. Rewrites the image tag in deploy/app/kustomization.yaml so Argo CD can roll out the exact commit.

Repository variables and secrets:

Name Kind Purpose
REGISTRY variable Registry host, e.g. forgejo.example.com
REGISTRY_USERNAME secret Registry user
REGISTRY_TOKEN secret Registry password/token
GITOPS_TOKEN secret (optional) Token allowed to push the image tag commit

Every job runs on the Forgejo runner labeled docker. That runner must have Docker and Buildx available. If your runner uses a different label, update all three runs-on entries in .forgejo/workflows/ci.yml.

Kubernetes / Argo CD

Everything needed to deploy the app, CloudNativePG, and the Redis operator lives in deploy/. In short:

kubectl apply -f deploy/argocd/root-app.yaml

The root application creates two operator applications first and then the application: CloudNativePG 1.30.2 (chart 0.29.2, namespace cnpg-system) and redis-operator 0.27.0 (chart 0.27.0, namespace redis-operator). The app namespace is todo.

See deploy/README.md for all placeholders that must be replaced before applying.

Dependency notes

The project was updated from a 2016-era dependency set. The upgrades are safe, but pg required a code change because the callback-based pg.connect() API was removed in pg@8.

Dependency Was Now Notes
Node.js unspecified >=20 Tested with Node 22 (container) and 26 (local)
express ~4.13.4 ^4.22.3 Kept on 4.x on purpose; Express 5 is a separate breaking migration
pg ^6.1.0 ^8.23.1 Rewritten to use Pool and async/await
body-parser ~1.15.1 ^1.20.9 Kept on 1.x to match Express 4
cookie-parser ~1.4.3 ^1.4.7 Compatible
debug ~2.2.0 ^4.4.3 Compatible
morgan ~1.7.0 ^1.12.1 Compatible
serve-favicon ~2.3.0 ^2.5.1 Compatible
jade ~1.11.0 removed Never used; views are static HTML
supervisor not declared removed npm start now runs node ./bin/www; use npm run dev for reloads
supertest none ^7.3.2 Added for HTTP tests

npm audit --omit=dev reports 0 vulnerabilities. The remaining available major upgrades (Express 5, body-parser 2) are intentionally not applied. The Angular 1.5 client is loaded from a CDN and is unrelated to the server upgrade; moving it forward would be a front-end rewrite.