GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - onehealthtoolkit/ohtk-ms

BranchesTags
Open more actions menu

Latest commit

 

History

790 Commits
790 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.husky
.husky
 
 
.vscode
.vscode
 
 
components
components
 
 
docs
docs
 
 
i18n
i18n
 
 
lib
lib
 
 
pages
pages
 
 
public
public
 
 
styles
styles
 
 
tests
tests
 
 
types
types
 
 
.dockerignore
.dockerignore
 
 
.env.production
.env.production
 
 
.eslintignore
.eslintignore
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.graphqlrc.json
.graphqlrc.json
 
 
.lintstagedrc.js
.lintstagedrc.js
 
 
.nvmrc
.nvmrc
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.js
.prettierrc.js
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
codegen.ci.yml
codegen.ci.yml
 
 
codegen.yml
codegen.yml
 
 
entrypoint.sh
entrypoint.sh
 
 
graphql.schema.json
graphql.schema.json
 
 
jest.config.js
jest.config.js
 
 
jest.setup.ts
jest.setup.ts
 
 
lint-staged.config.js
lint-staged.config.js
 
 
next-env.d.ts
next-env.d.ts
 
 
next.config.js
next.config.js
 
 
package.json
package.json
 
 
postcss.config.js
postcss.config.js
 
 
start-proxy.sh
start-proxy.sh
 
 
tailwind.config.js
tailwind.config.js
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

OHTK MS (Management System)

A Next.js admin web app for the One Health Toolkit surveillance platform. It talks to the Django/GraphQL backend (../ohtk-api) and is multi-tenant — the effective backend is resolved at runtime from the *.opensur.test subdomain.

What you'll need

  • Node.js 22 (see .nvmrc). Run corepack enable so the pinned Yarn is available.
  • The OHTK API running locally (../ohtk-api).
  • Laravel Valet (bundles dnsmasq + nginx) and mkcert — used to serve the app over HTTPS on a *.opensur.test host (required for cookie auth, see below).

Install

git clone https://github.com/onehealthtoolkit/ohtk-ms.git
cd ohtk-ms
corepack enable
yarn install

Start the dev server

The Next.js dev server runs on port 5100 (package.json → next dev -p 5100):

yarn dev

For pure UI work you can open http://localhost:5100 directly — but authentication will not work over localhost. Use the HTTPS setup below.


Local development with HTTPS (Valet + dnsmasq + nginx)

The app authenticates against the backend using HTTP-only JWT cookies (SameSite=None; Secure). A browser only sends those cookies when both of these hold:

  1. the request goes to an HTTPS endpoint, and
  2. the page and the API are on the same site (same registrable domain).

The backend lives on a subdomain of opensur.test, so the dashboard must also be served from *.opensur.test over HTTPS. Plain http://localhost:5100 is a different site (localhost ≠ opensur.test), so the cookies are treated as third-party and silently dropped — login looks like it "succeeds" but every request is unauthenticated. We fix this with Valet (dnsmasq + nginx).

dnsmasq (installed by Valet) resolves *.test → 127.0.0.1, so opensur.test and any subdomain (bon.opensur.test, dashboard.opensur.test, …) resolve with no /etc/hosts edits.

1. Backend on *.opensur.test (Valet proxy)

Run the Django API on 127.0.0.1:8000 (see ../ohtk-api) and expose it over HTTPS through Valet:

valet proxy opensur http://127.0.0.1:8000 --secure

--secure issues a Valet CA cert covering opensur.test and *.opensur.test (already trusted by your browser). The tenant is chosen by subdomain, e.g. the GraphQL endpoint is https://bon.opensur.test/graphql/.

2. Dashboard on dashboard.opensur.test (nginx reverse proxy)

Valet's nginx already owns :443 and proxies all of *.opensur.test to the backend. Add a more specific server block so only dashboard.opensur.test is routed to the Next dev server on :5100 — an exact server_name beats Valet's *.opensur.test wildcard, so every other host still reaches the backend.

Create /opt/homebrew/etc/nginx/servers/dashboard.opensur.test.conf (this file is already included by Valet's nginx):

server {
    listen 127.0.0.1:80;
    server_name dashboard.opensur.test;
    return 301 https://$host$request_uri;
}

server {
    listen 127.0.0.1:443 ssl;
    http2 on;
    server_name dashboard.opensur.test;

    # Reuse Valet's already-trusted wildcard cert (DNS:*.opensur.test).
    # Adjust the home directory to yours.
    ssl_certificate     "/Users/<you>/.config/valet/Certificates/opensur.test.crt";
    ssl_certificate_key "/Users/<you>/.config/valet/Certificates/opensur.test.key";

    client_max_body_size 128M;

    location / {
        proxy_pass http://127.0.0.1:5100;
        proxy_http_version 1.1;
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # Next.js dev hot-reload websocket (/_next/webpack-hmr)
        proxy_set_header Upgrade    $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_read_timeout 1800;
        proxy_buffering off;
    }
}

Reload nginx (Valet's master runs as root, so this needs sudo):

sudo nginx -s reload

The dashboard is now at https://dashboard.opensur.test, same-site with the API.

3. Point the app at the backend

Set the default backend in .env (local only — not committed):

serverDomain=bon.opensur.test

…or pick the bon subdomain on the login screen. If you logged in previously under an older token flow, clear stale state once with localStorage.clear() in the dev console, then log in again.

4. Verify cookie auth

After logging in at https://dashboard.opensur.test, in DevTools:

  • Application → Cookies → https://bon.opensur.test — JWT + refresh cookies flagged HttpOnly / Secure / SameSite=None.
  • Network → a graphql request — a Cookie: header and no Authorization header.
  • Application → Local Storage — no accessToken / refreshToken keys.

Create required OHTK data

To use the mobile app you need some seed records — Authorities, Report Categories, Report Types, etc. Create them through the admin screens once you're logged in.

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.