# @bolttech/server-side-next

This package contains a collection of common utilities and files for use with Server-Side Rendering (SSR) applications built with Next.js.

## Requirements

This plugin requires Node version (v16.0.0+)

## Exports

This package exports the following modules:

(default export): This export contains types and helpers, enums, constants, and utilities, as well as other modules and services that do not fit into the specific exports mentioned previously.

./src/common/middlewares: Contains references to middleware functions. This module does not contain any external dependencies, such as axios or other packages, to avoid potential runtime issues with Next.js.

./src/common/pages: Contains API routes for Next.js. This module exports all pages-related functionality.

./src/common/pages/server: Contains references to the server.tsx file, which provides functionality for server-side rendering with the PGG plugin for Next.js. This module only exports the server.tsx file.

./src/common/shared-services: Contains services that are used both server-side and client-side.

./src/modules/session: Contains files and references for session management.

./src/common/utils: Contains all utility functions for server side rendering.

./src/common/pgg: Export focused on the frontend CLI for generating static pages using the Next.js.

## Getting Started

To use this package in your Next.js project, install it using npm or yarn:

## Install

Using npm:

```console
npm install @bolttech/server-side-next
```

or

```console
yarn add @bolttech/server-side-next
```

## Usage

Then, import the desired module(s) into your code:

```typescript
import { myMiddleware } from '@bolttech/server-side-next/src/common/middlewares';
```

## Contributing

Contributions are welcome! If you are member the bolttech team, please submit a pull request with any changes or additions you'd like to make.
