Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

1184+ Articles
136+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Checklists
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. Projects
  3. How CosmicBytez Labs Is Built: Next.js 16, velite, and Resend
How CosmicBytez Labs Is Built: Next.js 16, velite, and Resend
PROJECTIntermediate

How CosmicBytez Labs Is Built: Next.js 16, velite, and Resend

A meta writeup about this site — content pipeline via velite (the contentlayer2 successor), a Resend-backed newsletter wired through a Vercel cron, the IT exam prep with 770 practice questions across 11 cert tracks, and the 8-tool utility suite.

Dylan H.

Projects

May 5, 2026
3 min read
4-6 hours

Tools & Technologies

Next.js 16veliteMDXResendVercel Cron

Overview

This is the site you're reading. CosmicBytez Labs is an IT and cybersecurity intelligence hub — news, how-tos, project writeups, IT exam prep, IT tools, and a weekly newsletter — all powered by a single Next.js content site. This writeup covers the pipeline.

Stack

  • Framework: Next.js 16.1.6 + React 19 + TypeScript
  • Content: velite (MDX files in content/)
  • Styling: Tailwind CSS v4
  • State: Zustand
  • Analytics: Vercel Analytics + Speed Insights
  • Fonts: Syne + Space Mono
  • Newsletter: Resend, sent via Vercel cron (Wednesdays 2pm UTC)
  • Deployment: Vercel (auto-deploy on push to master)

Content Pipeline

content/*.mdx → velite (velite.config.ts) → Next.js App Router → server-rendered pages

Seven content collections are defined: News, Howtos, Newsletters, Projects, Checklists, Outages, and Security advisories. Each collection has a strict zod-style schema that validates frontmatter at build time — bad MDX surfaces as a npm run build failure instead of a runtime exception.

Key Features

  • Cybersecurity news feed with automated generation (scripts/generate-news.mjs)
  • IT how-to guide library
  • Newsletter system with Resend (weekly send via Vercel cron, Wednesdays 2pm UTC)
  • IT exam prep at /study — 11 cert tracks (AZ-104, AZ-500, NSE4-7, MS-/MD-series, and more) with exam simulation, flashcards, and practice modes (770 practice questions across all tracks)
  • IT tools suite at /tools: Base64, DNS lookup, hash generator, invoice generator, JWT debugger, password generator, subnet calculator, text diff
  • Community leaderboard
  • Threat ticker on the homepage
  • Service uptime monitoring

Routes

RoutePurpose
/Home — hero, threat ticker, featured, latest, categories
/newsCybersecurity news feed
/howtosIT how-to guide library
/newsletterNewsletter archive and subscribe
/projectsProject writeups
/checklistsIT checklists
/outagesOutage log
/security/[slug]Security advisory detail pages
/studyIT exam prep
/toolsIT tools index (8 tools)

Environment Variables

VariablePurpose
ADMIN_SECRETSecret for protected API endpoints
RESEND_API_KEYResend newsletter API key
RESEND_AUDIENCE_IDResend audience ID for subscribers
CRON_SECRETVercel cron job secret
NEXT_PUBLIC_BASE_URLSite base URL

CI/CD

Three GitHub Actions: ci.yml (lint, test, build), generate-news.yml (automated news generation), update-leaderboard.yml (leaderboard data updates). Vercel auto-deploys on push to master.

The newsletter cron is wired in vercel.json and hits /api/newsletter/send every Wednesday at 14:00 UTC, validated against CRON_SECRET.

Lessons Learned

  • The site uses master, not main. Match the existing branch convention rather than fighting it.
  • velite errors only surface during npm run build — never npm run dev. Run a build locally before pushing or you'll find out from the deploy.
  • New MDX frontmatter must match the velite schema exactly. The schema is the contract.
  • src/proxy.ts handles CSRF protection, origin validation, and protected-route auth in one place. Don't sprinkle that logic across API routes.

Testing

57 Vitest tests covering the content pipeline, route helpers, and newsletter logic.

#Next.js#velite#MDX#Vercel#Newsletter#Tailwind#Resend

Related Articles

A Real-Time Trading Dashboard with Next.js 15 and lightweight-charts

Frontend for an algorithmic trading bot — TradingView-style candlestick charts, WebSocket auto-reconnect, dark theme, and zero SSR because the bot's API lives on a separate server.

3 min read

Orbit: An Offline-First Fitness PWA with Dual Storage Backend

A household fitness PWA with weight tracking, meal planning, workouts, and pantry — built on Next.js 15 with a single codebase that runs against either Supabase or local SQLite, plus an IndexedDB mutation queue for offline.

3 min read

Self-Hosted IPTV Manager with HDHomeRun Emulation for Plex

An IPTV stream manager that pretends to be an HDHomeRun tuner so Plex DVR can record over-the-air-style live TV — M3U import, tier-based channel classification, FFmpeg HLS remux, and an XMLTV EPG.

3 min read
Back to all Projects