SRH Solutions webserver for the public site, customer portal, and admin console.
The current admin and portal screens can run in demo mode, while the backend harness below provides the Supabase schema and Next.js Route Handlers needed to move customer management, license issuance, installations, and invoicing onto a real database.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
Useful routes:
/public site/portalcustomer portal/adminSRH operator console/api/admin/harnessbackend harness health check
- Create a Supabase project.
- Copy
.env.exampleto.env.localand fill in the Supabase URL, anon key, and service-role key. - Apply
supabase/migrations/001_srh_admin_core.sqlin Supabase SQL editor or with the Supabase CLI. - Optionally run
supabase/seed.sqlfor starter organizations, products, licenses, invoices, and installation records. - Restart
npm run dev.
When Supabase env vars are missing, the API harness returns the existing demo
data from app/admin/data.ts. When the env vars are present, the same routes
read and mutate Supabase.
If SRH_ADMIN_API_TOKEN is set, send Authorization: Bearer <token>.
curl http://localhost:3000/api/admin/harnesscurl -X POST http://localhost:3000/api/admin/licenses \
-H "Content-Type: application/json" \
-d "{\"organizationId\":\"ORG-HUONS-2019\",\"productId\":\"imaging\",\"seats\":8,\"durationDays\":365,\"environment\":\"Production\",\"site\":\"Anyang HQ\"}"curl -X POST http://localhost:3000/api/admin/invoices \
-H "Content-Type: application/json" \
-d "{\"organizationId\":\"ORG-HUONS-2019\",\"licenseIds\":[\"L-1042\",\"L-1043\"]}"Core tables:
organizations,organization_membersproductslicenses,installationsinvoices,invoice_line_itemsactivity_events
The migration enables RLS. Authenticated customer users can read rows for their
own organization through organization_members. Admin Route Handlers use the
server-only Supabase service-role key and should stay server-side.
This project uses Next.js App Router and next/font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.