rim-xmg-block-explorer
v0.1.0
Published
[](https://coveralls.io/github/Rimblehelm/rim-xmg-block-explorer?branch=master) [: View latest Coveralls job
Getting Started
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.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Environment Variables
- NEXTAUTH_URL: The canonical URL where your app runs locally, e.g.
http://localhost:3000. - NEXTAUTH_SECRET: A long random string used to sign NextAuth tokens. Generate with:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"- EMAIL_SERVER / EMAIL_FROM: Required if you enable the EmailProvider in
next-auth.EMAIL_SERVERshould be a SMTP connection string, for example:
# SMTP URL form: smtp://USER:[email protected]:587
EMAIL_SERVER=smtp://user:[email protected]:587
EMAIL_FROM="Your App <[email protected]>"Notes:
.env.localis ignored by.gitignoreby default; keep secrets out of version control.- If you add or change env vars, restart the dev server so Next.js picks them up.
Email / TLS note (development)
- During development you may be tempted to bypass TLS verification (for example by setting
tls: { rejectUnauthorized: false }on your SMTP transport). This is insecure and should never be used in production. Instead, for Gmail use an App Password (see steps above). I removed the temporary TLS bypass from the code and recommend using an App Password or a trusted SMTP provider (SendGrid, Mailgun, Postmark) for reliable delivery.
Learn More
Coverage & Coveralls
- Converter: CI uses Vitest with the V8 coverage provider which produces
coverage/coverage-final.jsonand HTML reports. To upload to Coveralls we convert the V8 JSON to LCOV usingscripts/coverage-to-lcov.jsin CI. This avoids adding providers with conflicting peer dependencies and keepsnpm cistable. - Upload locally: After running tests with coverage, you can upload the generated LCOV to Coveralls locally:
# generate coverage locally
npx vitest --run --coverage
# convert (if needed)
node scripts/coverage-to-lcov.js coverage/coverage-final.json coverage/lcov.info
# upload
npm run upload-coverageThe CI workflow already runs the converter and uploads coverage/lcov.info with the Coveralls GitHub Action.
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!
Deploy on Vercel
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.
GitHub Actions / CI Secrets
The repository contains two CI workflows under .github/workflows/: ci-unit.yml (runs Vitest) and ci-e2e.yml (runs Playwright E2E against a PostgreSQL service). To run those workflows successfully you should add the following GitHub Secrets in your repository settings (Settings → Secrets → Actions).
- NEXTAUTH_SECRET: The NextAuth secret used to sign and encrypt session cookies and tokens. Example generation (locally):
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"- DATABASE_URL: Optional override for the CI job. The E2E workflow sets a default
DATABASE_URLfor the included Postgres service; use this secret if you want to point CI to a different database instance. Example value:
postgresql://postgres:postgres@localhost:5432/postgres?schema=public- SMTP_URL / EMAIL_SERVER / EMAIL_FROM: If your app sends email during tests (not required by the default tests), set these to your SMTP connection string and the sender address. Example SMTP URL form:
# smtp://USER:[email protected]:587
SMTP_URL=smtp://user:[email protected]:587
EMAIL_FROM="Your App <[email protected]>"Notes:
- The
ci-e2e.ymlworkflow uses a temporary Postgres service and runsnpx prisma migrate deployagainst it. Make sure your migrations are committed toprisma/migrations/before running the workflow. - If you add providers that require additional secrets (e.g. OAuth providers like GitHub, Google), add their client IDs / secrets to GitHub Secrets and update the workflow to expose them as environment variables.
- For secrets referenced in the workflows, use the
secrets.*syntax in the workflow file (for example${{ secrets.NEXTAUTH_SECRET }}). Currently the workflows setDATABASE_URLin the E2E job to the service value; adapt as needed for your environment.
If you'd like, I can update the workflows to reference secrets.NEXTAUTH_SECRET and other secrets explicitly and add an example .github/workflows/ci-e2e.template.yml showing the exact secrets mapping.
