Skip to content

fatik-islam/NexoraNeo

Repository files navigation

NexoraNeo — Professional Development Sessions

Production-oriented Next.js App Router project for NexoraNeo PD sessions, bookings, Stripe payments, attendance, certificates and public certificate verification.

Stack

  • Next.js App Router, TypeScript, Tailwind CSS
  • shadcn-style UI components
  • Zod validation
  • InsForge auth, Postgres, storage and CLI migrations
  • Stripe Checkout and webhooks
  • PDF certificate generation with QR verification

Environment

Copy .env.example to .env.local and fill:

NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_INSFORGE_URL=https://ji3ny662.us-east.insforge.app
NEXT_PUBLIC_INSFORGE_ANON_KEY=$(npx @insforge/cli secrets get ANON_KEY)
INSFORGE_ANON_KEY=same-anon-key
INSFORGE_API_KEY=server-only-admin-api-key-from-.insforge/project.json
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
NEXORA_EMAIL_REPLY_TO=hello@yourdomain.com
RESEND_API_KEY=re_...
RESEND_FROM_EMAIL=bookings@yourdomain.com
NEXORA_VERIFICATION_FROM_EMAIL="NexoraNeo <noreply@yourdomain.com>"
NEXORA_BOOKINGS_FROM_EMAIL="NexoraNeo Bookings <bookings@yourdomain.com>"
NEXORA_CONTACT_TO_EMAIL=info@yourdomain.com

Never expose INSFORGE_API_KEY to the browser.

For the live production deployment, set:

NEXT_PUBLIC_APP_URL=https://nexoraneo.com

InsForge Setup

Verify the linked project:

npx @insforge/cli whoami
npx @insforge/cli current
npx @insforge/cli metadata --json

Apply migrations:

npx @insforge/cli db migrations list
npx @insforge/cli db migrations up --all

Create storage buckets:

npx @insforge/cli storage create-bucket certificates --private

Seed NexoraNeo content:

npm install
npm run seed

Stripe Setup

This InsForge project currently reports managed InsForge Payments as unavailable, so the app uses server-side Stripe routes and stores payment state in app-owned InsForge Postgres tables.

Configure a Stripe webhook to:

https://nexoraneo.com/api/stripe/webhook

Listen for:

  • checkout.session.completed
  • payment_intent.succeeded
  • payment_intent.payment_failed
  • charge.refunded

Booking confirmation happens only in the webhook. Success redirect pages never mark bookings paid.

Admin Account

  1. Sign up through /signup.
  2. In InsForge SQL, promote the profile to the single full-access admin account:
UPDATE public.profiles
SET role = 'admin'
WHERE email = 'you@example.com';

Use migrations for schema changes. The one-off promotion can be run with:

npx @insforge/cli db query "UPDATE public.profiles SET role = 'admin' WHERE email = 'you@example.com';"

Development

npm install
npm run dev

Open http://localhost:3000.

Deployment

If InsForge deployment hosting is enabled for the project:

npx @insforge/cli deployments deploy .

Production deployment env must include:

NEXT_PUBLIC_APP_URL=https://nexoraneo.com

Otherwise deploy to any Next.js-compatible host and keep InsForge as the backend.

Test Checklist

  • Sign up and login create a profiles row.
  • Browse /sessions, open a session detail page, book and reach Stripe Checkout.
  • Stripe webhook marks booking confirmed and writes payments.raw_event.
  • Booking confirmation emails send from NEXORA_BOOKINGS_FROM_EMAIL with a PDF receipt attachment.
  • Account email changes stay pending until the user clicks the verification link sent from NEXORA_VERIFICATION_FROM_EMAIL.
  • /contact sends enquiries to NEXORA_CONTACT_TO_EMAIL.
  • Admin/facilitator marks attendance through /api/admin/attendance.
  • Admin completes a session instance and calls /api/certificates/issue.
  • Certificate PDF uploads to InsForge storage.
  • User sees certificate in dashboard.
  • /certificates/verify/[code] shows only safe public certificate data.
  • Admin/facilitator routes redirect unauthenticated users and reject insufficient roles server-side.