Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ GoMyAdmin gives you a small CLI, a Go resource API, PostgreSQL introspection, an
[![CI](https://github.com/darwvin-dev/gomyadmin/actions/workflows/ci.yml/badge.svg)](https://github.com/darwvin-dev/gomyadmin/actions/workflows/ci.yml)

<p align="center">
<img src="docs/demo-cli.svg" alt="GoMyAdmin CLI demo" width="720" /><br/>
<img src="docs/demo-ui.svg" alt="GoMyAdmin admin UI screenshot" width="720" />
<img src="docs/screenshots/dashboard.png" alt="GoMyAdmin admin dashboard" width="820" />
</p>

<p align="center">
<em>The generated CRM admin — <a href="https://gomyadmin-next-shadcn.darwvin-dev.workers.dev/admin/login">try the live demo</a> (admin@example.com / password)</em>
</p>

## Why
Expand All @@ -26,6 +29,19 @@ PostgreSQL schema -> resource definitions in Go -> generated admin API + Next.js

The output is explicit Go, SQL, and TypeScript. There is no runtime model magic and no requirement to replace your router, ORM, auth, or deployment flow.

## Live Demo

Try the generated CRM admin UI without installing anything:

```text
https://gomyadmin-next-shadcn.darwvin-dev.workers.dev/admin/login
admin@example.com / password
```

The demo frontend runs on Cloudflare Workers (OpenNext) and talks to a seeded, read-only demo API worker. The demo data is served fresh per request, so visitors can explore freely without affecting a real database.

Screenshots from the live demo: [dashboard](docs/screenshots/dashboard.png) · [resource list](docs/screenshots/customers-list.png) · [edit form](docs/screenshots/customer-edit-form.png) · [audit log](docs/screenshots/audit-log.png) — see [docs/screenshots/](docs/screenshots/).

## Quick Start

```sh
Expand All @@ -43,7 +59,7 @@ Open `http://localhost:3000/admin` and use:
admin@example.com / password
```

Public demo deployment instructions are in [docs/cloudflare-demo-deploy.md](docs/cloudflare-demo-deploy.md) for a card-free Cloudflare demo and [docs/free-demo-deploy.md](docs/free-demo-deploy.md) for a Render + Neon demo that runs the Go backend. Once a hosted demo is live, add its URL here.
Public demo deployment instructions are in [docs/cloudflare-demo-deploy.md](docs/cloudflare-demo-deploy.md) for a card-free Cloudflare demo and [docs/free-demo-deploy.md](docs/free-demo-deploy.md) for a Render + Neon demo that runs the Go backend.

You can also start from an existing database:

Expand Down Expand Up @@ -167,7 +183,7 @@ yarn run build
- [x] Admin API with CRUD, filters, search, sort, pagination, actions, audit, RBAC, sessions, and files
- [x] Next.js admin template
- [x] Drop-in HTTP handler for existing Go backends
- [ ] Hosted public demo
- [x] Hosted public demo
- [ ] Relation field rendering in the frontend
- [ ] Playwright e2e coverage for the CRM demo
- [ ] Split heavier optional adapters into separate modules or documented opt-in packages
Expand Down
37 changes: 26 additions & 11 deletions docs/cloudflare-demo-deploy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Cloudflare Demo Deploy

A live demo built with this guide is running at:

```text
Frontend: https://gomyadmin-next-shadcn.darwvin-dev.workers.dev/admin/login
API: https://gomyadmin-demo-api.darwvin-dev.workers.dev
Login: admin@example.com / password
```

This guide creates a public GoMyAdmin demo without adding a payment card.

The Cloudflare setup is intentionally demo-only:
Expand All @@ -15,8 +23,8 @@ Use [free-demo-deploy.md](free-demo-deploy.md) if you want the Render + Neon pat

```text
Browser
-> gomyadmin-demo.<account>.workers.dev Next.js admin UI
-> gomyadmin-demo-api.<account>.workers.dev demo API Worker
-> gomyadmin-next-shadcn.<account>.workers.dev Next.js admin UI (OpenNext)
-> gomyadmin-demo-api.<account>.workers.dev demo API Worker
```

The Worker mirrors the API contract expected by the frontend and returns seeded CRM data. It is not meant to replace the Go backend.
Expand Down Expand Up @@ -46,27 +54,32 @@ curl https://gomyadmin-demo-api.<your-account>.workers.dev/admin/api/resources

## 2. Deploy The Frontend To Cloudflare Workers

Cloudflare recommends the Workers/OpenNext path for full Next.js apps. Deploy the existing frontend template from its directory:
Cloudflare recommends the Workers/OpenNext path for full Next.js apps. The frontend template already ships the OpenNext config (`open-next.config.ts`, `wrangler.jsonc`, and the `deploy`/`preview` scripts), so no migration step is needed. Deploy from the template directory:

```sh
cd templates/frontend-next-shadcn
yarn install --frozen-lockfile
npx @opennextjs/cloudflare migrate
NEXT_PUBLIC_ADMIN_API_URL=https://gomyadmin-demo-api.<your-account>.workers.dev npm run deploy
```

The OpenNext migration adds the Cloudflare deploy scripts and Worker config for the existing Next.js app. If Cloudflare asks for a project name, use:
The worker is named `gomyadmin-next-shadcn` in `wrangler.jsonc`. Open the deployed frontend:

```text
gomyadmin-demo
https://gomyadmin-next-shadcn.<your-account>.workers.dev/admin
```

Open the deployed frontend:
### If the worker upload times out or fails with `fetch failed`

```text
https://gomyadmin-demo.<your-account>.workers.dev/admin
The final step uploads the worker bundle (~1 MB) as a single request. On some links (mobile tethering, restrictive networks, certain VPNs) that large upload is reset while small requests and asset uploads still succeed. Route Wrangler through a stable local proxy if you have one (for example an HTTP/SOCKS proxy on `127.0.0.1:10808`):

```sh
export HTTPS_PROXY=http://127.0.0.1:10808
export HTTP_PROXY=http://127.0.0.1:10808
NEXT_PUBLIC_ADMIN_API_URL=https://gomyadmin-demo-api.<your-account>.workers.dev npm run deploy
```

Wrangler honors these variables ("We'll use your proxy for fetch requests"). Otherwise retry from a more stable connection.

Login:

```text
Expand All @@ -79,9 +92,11 @@ After the frontend is live, edit `deploy/cloudflare/worker/wrangler.toml`:

```toml
[vars]
ADMIN_ORIGIN = "https://gomyadmin-demo.<your-account>.workers.dev"
ADMIN_ORIGIN = "https://gomyadmin-next-shadcn.<your-account>.workers.dev"
```

The demo API reflects the requesting origin in its CORS headers, so the demo works even before this step; locking `ADMIN_ORIGIN` is optional hardening.

Redeploy the Worker:

```sh
Expand All @@ -107,7 +122,7 @@ The Worker uses seeded demo data, so writes are response-level demos and do not
After the demo is live, update the README:

```md
Live demo: https://gomyadmin-demo.<your-account>.workers.dev/admin
Live demo: https://gomyadmin-next-shadcn.<your-account>.workers.dev/admin

Login: `admin@example.com` / `password`
```
Expand Down
14 changes: 14 additions & 0 deletions docs/screenshots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Screenshots

Real screenshots captured from the live CRM demo
(<https://gomyadmin-next-shadcn.darwvin-dev.workers.dev/admin/login>, `admin@example.com` / `password`).

| Screenshot | Description |
| --- | --- |
| [dashboard.png](dashboard.png) | Operations dashboard with metric cards, resource shortcuts, and recent audit activity |
| [customers-list.png](customers-list.png) | Customers resource list with search, saved views, filters, status/plan badges, and export |
| [customer-edit-form.png](customer-edit-form.png) | Generated edit form for a customer record |
| [audit-log.png](audit-log.png) | Immutable audit log view |
| [login.png](login.png) | Admin sign-in screen |

These are regenerated against the deployed demo, so they match the current generated template. To refresh them, sign in to the demo and recapture at a 1440×900 viewport.
Binary file added docs/screenshots/audit-log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/customer-edit-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/customers-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions templates/frontend-next-shadcn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# OpenNext
.open-next

# wrangler files
.wrangler
.dev.vars*
!.dev.vars.example
2 changes: 2 additions & 0 deletions templates/frontend-next-shadcn/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ const nextConfig: NextConfig = {
}

export default nextConfig

import('@opennextjs/cloudflare').then(m => m.initOpenNextCloudflareForDev());
9 changes: 9 additions & 0 deletions templates/frontend-next-shadcn/open-next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// default open-next.config.ts file created by @opennextjs/cloudflare
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
// import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";

export default defineCloudflareConfig({
// For best results consider enabling R2 caching
// See https://opennext.js.org/cloudflare/caching for more details
// incrementalCache: r2IncrementalCache
});
12 changes: 9 additions & 3 deletions templates/frontend-next-shadcn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
"private": true,
"packageManager": "yarn@1.22.22",
"scripts": {
"dev": "next dev",
"build": "next build",
"dev": "next dev",
"start": "next start",
"lint": "next lint",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview",
"deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy",
"upload": "opennextjs-cloudflare build && opennextjs-cloudflare upload",
"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
},
"dependencies": {
"@hookform/resolvers": "^5.0.0",
"@opennextjs/cloudflare": "^1.19.11",
"@radix-ui/react-dialog": "^1.1.0",
"@radix-ui/react-dropdown-menu": "^2.1.0",
"@radix-ui/react-slot": "^1.2.0",
Expand All @@ -35,6 +40,7 @@
"eslint-config-next": "16.2.6",
"postcss": "^8.5.3",
"tailwindcss": "^3.4.17",
"typescript": "6.0.3"
"typescript": "6.0.3",
"wrangler": "^4.100.0"
}
}
4 changes: 4 additions & 0 deletions templates/frontend-next-shadcn/public/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://developers.cloudflare.com/workers/static-assets/headers
# https://opennext.js.org/cloudflare/caching#static-assets-caching
/_next/static/*
Cache-Control: public,max-age=31536000,immutable
27 changes: 27 additions & 0 deletions templates/frontend-next-shadcn/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"main": ".open-next/worker.js",
"name": "gomyadmin-next-shadcn",
"compatibility_date": "2026-06-13",
"compatibility_flags": [
"nodejs_compat",
"global_fetch_strictly_public"
],
"assets": {
"directory": ".open-next/assets",
"binding": "ASSETS"
},
"services": [
{
// Self-reference service binding, the service name must match the worker name
// see https://opennext.js.org/cloudflare/caching
"binding": "WORKER_SELF_REFERENCE",
"service": "gomyadmin-next-shadcn"
}
],
"images": {
// Enable image optimization
// see https://opennext.js.org/cloudflare/howtos/image
"binding": "IMAGES"
}
}
Loading
Loading