npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gasket/template-nextjs-app

v7.0.8

Published

Gasket Next.js App Router template

Readme

Gasket Next.js App Router Template

A modern full-stack TypeScript web application template built with Gasket, Next.js App Router, and internationalization support.

Overview

This template provides a production-ready starting point for building web applications using:

  • Next.js 15 with App Router - React framework with file-based routing
  • TypeScript - Type-safe development with modern JavaScript features
  • Gasket - Plugin architecture for extensible applications
  • React Intl - Internationalization with multi-language support
  • HTTPS Proxy - Development proxy for secure local development
  • Vitest - Lightning-fast unit testing with React Testing Library

Features

  • Next.js App Router with TypeScript support
  • Internationalization pre-configured with English and French
  • HTTPS development proxy for secure local testing
  • Server-side rendering with Gasket data injection
  • Testing setup with Vitest, React Testing Library, and JSDOM
  • ESLint configuration with React and Next.js rules
  • Development tools with hot reloading and TypeScript watching
  • Production build optimization

Quick Start

Create a new Next.js App Router project using this template:

npx create-gasket-app@latest my-app --template @gasket/template-nextjs-app

Project Structure

my-app/
├── app/                   # Next.js App Router pages
│   ├── layout.tsx         # Root layout component
│   └── page.tsx           # Home page component
├── locales/               # Internationalization files
│   ├── en-US.json         # English translations
│   └── fr-FR.json         # French translations
├── test/                  # Test files
├── gasket.ts              # Gasket configuration
├── server.ts              # HTTPS proxy server
├── intl.ts                # Internationalization manager
├── next.config.js         # Next.js configuration
├── tsconfig.json          # TypeScript configuration
└── dist/                  # Built server files

Available Scripts

| Script | Description | |--------|-------------| | npm run local | Start development with HTTPS proxy, TypeScript watch, and Next.js dev server | | npm run build | Build TypeScript server and Next.js application | | npm run start | Start production servers (HTTPS proxy + Next.js) | | npm run preview | Build and start production servers | | npm run test | Run unit tests | | npm run test:watch | Run tests in watch mode | | npm run test:coverage | Run tests with coverage report | | npm run docs | Generate and serve documentation | | npm run lint | Check code style and quality |

Development

The template includes a sophisticated development setup:

HTTPS Development Proxy

The template includes an HTTPS proxy server that runs alongside Next.js during development, allowing you to test secure features locally:

  • HTTPS Proxy: https://localhost:80
  • Next.js Dev Server: http://localhost:3000
  • Proxy Target: Routes HTTPS traffic to the Next.js dev server

Hot Reloading

Three concurrent processes run during development:

  1. TypeScript Watch - Compiles server TypeScript files on change
  2. HTTPS Proxy Server - Provides secure development environment
  3. Next.js Dev Server - Hot reloads React components and pages

Pages and Layout

Root Layout (app/layout.tsx)

The root layout is enhanced with Gasket data injection using withGasketData:

import { withGasketData } from '@gasket/nextjs/layout';
import gasket from '@/gasket';

function RootLayout({ children }) {
  return (
    <html lang='en'>
      <body>{children}</body>
    </html>
  );
}

export default withGasketData(gasket)(RootLayout);

Adding New Pages

Create new pages in the app/ directory following Next.js App Router conventions:

// app/about/page.tsx
import { Metadata } from 'next';

export const metadata: Metadata = {
  title: 'About - My App'
};

export default function AboutPage() {
  return <h1>About Page</h1>;
}

Configuration

The template includes these Gasket plugins by default:

  • @gasket/plugin-nextjs - Next.js integration
  • @gasket/plugin-intl - Internationalization support
  • @gasket/plugin-https-proxy - HTTPS development proxy
  • @gasket/plugin-webpack - Webpack configuration
  • @gasket/plugin-winston - Structured logging
  • @gasket/plugin-command - CLI command support

Environment-Specific Configuration

Configure different settings for different environments in gasket.ts:

export default makeGasket({
  // Base configuration
  intl: {
    locales: ['en-US', 'fr-FR'],
    defaultLocale: 'en-US'
  },
  // Environment-specific overrides
  environments: {
    production: {
      httpsProxy: {
        port: 443,
        target: { port: 3000 }
      }
    }
  }
});

Testing

The template includes comprehensive testing setup:

  • Vitest - Fast test runner
  • React Testing Library - React component testing utilities
  • JSDOM - DOM simulation for server-side testing
  • TypeScript support - Type-safe tests

Write tests in the test/ directory:

import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import IndexPage from '@/app/page';

describe('IndexPage', () => {
  it('renders welcome message', () => {
    render(<IndexPage />);
    expect(screen.getByText('Welcome to Gasket!')).toBeInTheDocument();
  });
});

Next Steps

  • Add more pages in the app/ directory
  • Customize the internationalization with additional languages
  • Add database connections and API routes
  • Configure authentication and authorization
  • Set up CI/CD pipeline
  • Add more comprehensive testing