The TechHut website is deployed on Vercel with automatic deployments triggered by git pushes.
The project uses standard Next.js deployment on Vercel with no special configuration file required.
| Setting | Value |
|---|---|
| Framework | Next.js |
| Build Command | npm run build |
| Output Directory | .next |
| Install Command | npm install |
| Node.js Version | 18.x |
When deployed, the build command executes:
npm run gen:articles
npm run gen:slugmap
npm run gen:sitemap
npm run gen:rss
next build
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_SITE_URL |
Site URL for sitemaps/RSS | https://techhut.tv |
ASSET_PREFIX |
CDN prefix for assets | /docs-static (production) |
NODE_ENV |
Environment mode | Set by Vercel |
In Vercel dashboard:
- Go to Project Settings → Environment Variables
- Add variables for Production, Preview, or Development
- Redeploy for changes to take effect
The site is served at techhut.tv with:
- HTTPS enforced via HSTS header
- www subdomain redirects to apex domain
- Automatic SSL certificate management by Vercel
Security headers are configured in next.config.mjs:
| Header | Value | Purpose |
|---|---|---|
Strict-Transport-Security |
max-age=63072000; includeSubDomains; preload |
Force HTTPS |
X-Frame-Options |
SAMEORIGIN |
Prevent clickjacking |
X-Content-Type-Options |
nosniff |
Prevent MIME sniffing |
X-XSS-Protection |
1; mode=block |
XSS filter |
Referrer-Policy |
strict-origin-when-cross-origin |
Control referrer info |
Content-Security-Policy |
(see config) | Control resource loading |
The CSP allows:
- Scripts from self, Matomo, CDN
- Styles from self (inline allowed)
- Images from self, data URIs, HTTPS sources
- Frames from YouTube only
- Connections to self, Matomo, Algolia
Google Analytics and Google Tag Manager loaders have been removed, including the no-JavaScript tracking iframe. NEXT_PUBLIC_GTM_ID is no longer used. Matomo, Vercel Web Analytics, Speed Insights, and YouTube embeds remain separate integrations.
Search Console does not require visitor tracking when verified through DNS or an HTML verification tag/file. Keep existing DNS verification records and any verification files/tags. If a Search Console owner relies on Analytics or Tag Manager verification, establish another method before deploying this removal. See Google's verification instructions. Public DNS currently has a Google verification record, but the owner's active verification method must be confirmed in Search Console.
This change preserves canonical URLs, structured data, robots.txt, sitemap generation, and local article/app search. It does not delete historical data in Google Analytics or change remote account settings. Review any remotely managed Matomo container tags before adding them so they do not reintroduce Google tracking.
- Push to
mainbranch triggers production deployment - Pull requests create preview deployments
- Preview URLs are added to PR comments
# Install Vercel CLI
npm i -g vercel
# Deploy preview
vercel
# Deploy production
vercel --prodThe public privacy policy is maintained in src/pages/privacy.mdx at /privacy. Its footer link sits beside Analytics opt-out; both routes are included in sitemap generation. Keep the policy's revision date and disclosures aligned with actual changes. Validate an isolated build with node scripts/validate-privacy-build.mjs /path/to/build-copy before deployment.
The footer's Analytics opt-out link opens /privacy-settings. AnalyticsPreferencesProvider checks the saved browser preference before mounting Matomo, Vercel Web Analytics, or Speed Insights. Opting out persists locally and reloads the page to stop existing scripts; future loads omit all three integrations. Offline checks: node --test tests/analyticsPreference.test.mjs.
The site includes @vercel/analytics for performance monitoring:
import { Analytics } from '@vercel/analytics/react'
<Analytics />Performance metrics via @vercel/speed-insights:
import { SpeedInsights } from '@vercel/speed-insights/next'
<SpeedInsights />Images and static files in public/ are cached with long TTL.
Static pages are cached at the edge. Revalidation happens on deployment.
Vercel's edge network serves content from nearest location.
To rollback a deployment:
- Go to Vercel dashboard → Deployments
- Find previous working deployment
- Click "..." menu → "Promote to Production"
- Check Vercel build logs for errors
- Common issues:
- Missing environment variables
- Node version mismatch
- MDX syntax errors
- Check if PR has new commits
- Verify preview deployment completed
- Clear browser cache
- Trigger redeployment from Vercel dashboard
- Or push empty commit:
git commit --allow-empty -m "Trigger redeploy"
Test production build locally:
npm run build
npm run startThis runs the full build process and serves the production output on localhost:3000.