Compare commits

..

8 Commits

Author SHA1 Message Date
KS Jannette
5cd5b38df0 add analytics tag 2026-05-12 23:23:17 -04:00
S Jannette
4667e612fd Merge pull request #45 from kjannette/update-README
m
2026-05-12 19:48:07 -04:00
KS Jannette
1d68ce40e7 m 2026-05-12 19:47:42 -04:00
S Jannette
ae256eea91 Merge pull request #44 from kjannette/auth-hack
m
2026-05-12 19:26:24 -04:00
KS Jannette
7bad2ab562 m 2026-05-12 19:26:03 -04:00
S Jannette
54b7c92e83 Merge pull request #43 from kjannette/adjust-url-support-form-submit
Adjust endpoint
2026-05-12 18:59:49 -04:00
KS Jannette
39c6957e2f Adjust endpoint 2026-05-12 18:58:47 -04:00
S Jannette
4f44af5180 Merge pull request #42 from kjannette/add-footer
Add footer
2026-05-12 18:34:46 -04:00
5 changed files with 49 additions and 13 deletions

View File

@@ -31,3 +31,15 @@ Backend startup quickstart:
make poller — Builds and runs the poller.
make poller-dev — Runs the poller with auto-reload.
## Production: `make build` + restart service
On the server, from this directory:
- **`make build`** — writes fresh **`bin/api`** and **`bin/poller`** (see the Makefile).
- **`make build-api`** — API only; **`make build-poller`** — poller only.
Building alone does **not** reload a process that is already listening (e.g. on port 8080). After deploy:
1. Ensure **`systemctl`** (or your supervisor) **`ExecStart`** runs the binary you just built (e.g. **`.../backend/bin/api`**) or copy `bin/api` to that path.
2. **`sudo systemctl restart <your-api-service>`** (and the poller service if you rebuilt it).
3. Optional check: **`readlink -f /proc/<pid>/exe`** should show your **`bin/api`** path without **`(deleted)`** — if you see `(deleted)`, an old process is still running the previous binary from memory.

View File

@@ -1,14 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Koin Ping - On-Chain Monitoring</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Koin Ping - On-Chain Monitoring</title>
<script data-goatcounter="https://koinping.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

View File

@@ -1 +1,20 @@
export const API_BASE = import.meta.env.VITE_API_BASE || "/v1";
const DEFAULT_API_BASE = "/v1";
/**
* API origin for fetch(): root-relative prefix (e.g. /v1) or absolute URL (https://host/v1).
* Root-relative values are forced to start with "/" so requests work from any SPA route
* (e.g. /support); otherwise "v1/support" would resolve under the current path and 404.
*/
function normalizeApiBase(raw) {
const s = String(raw ?? "").trim();
const base = s || DEFAULT_API_BASE;
if (/^https?:\/\//i.test(base)) {
return base.replace(/\/+$/, "") || DEFAULT_API_BASE;
}
const path = base.startsWith("/") ? base : `/${base}`;
return path.replace(/\/+$/, "") || DEFAULT_API_BASE;
}
export const API_BASE = normalizeApiBase(import.meta.env.VITE_API_BASE);

View File

@@ -15,7 +15,7 @@ export async function submitSupportRequest({ email, description }) {
if (data.message) message = data.message;
else if (data.error && res.status) message = `${data.error} (${res.status})`;
} catch {
message = `Request failed (${res.status}). Is the API running on port 3001?`;
message = `Request failed (HTTP ${res.status}). The server did not return JSON — check that POST ${API_BASE}/support is proxied to your Go API (e.g. nginx location /v1/).`;
}
throw new Error(message);
}

View File

@@ -12,10 +12,12 @@ const navLinks = [
export default function Navbar() {
const { currentUser, logout } = useAuth();
const authData = useAuth();
const location = useLocation();
const [isNavPanelOpen, setIsNavPanelOpen] = useState(false);
if (!currentUser) return null;
console.log(authData)
return (
<>