create-nextpress
TypeScript icon, indicating that this package has built-in type declarations

2.8.1 • Public • Published
Nextpress logo

NextPress v2.8.1

Polyrepo architecture in a single monorepo

NPM version Download Count MIT License GitHub

Create NextPress

Fast to start, easy to build, ready for production

Why NextPress ? 🚀

NextPress implements true polyrepo architecture within a single repository structure, giving you:

  • 🏗️ Polyrepo Benefits: Independent frontend and backend codebases with separate dependencies
  • 🔄 Single Repository Workflow: The convenience of a monorepo with polyrepo architecture principles
  • 🧩 Separation of Concerns: Clear boundaries between Next.js frontend and Express backend
  • 🛠️ Independent Versioning: Each project can evolve at its own pace
  • Zero Configuration: Immediate productivity with no manual setup
  • 📱 Production-Ready Structure: Best practices for enterprise application development

Features ✨

  • Next.js Frontend with TypeScript & complete project structure
  • 🚀 Express Backend with TypeScript, Prisma & API setup
  • 📦 Polyrepo-in-Repo Structure: Independent projects sharing one repository
  • 🔄 Isolated Dependencies: Each project manages its own packages
  • 🌐 API-Ready: Express configured for RESTful API development
  • 🔒 Environment Setup: Pre-configured dotenv for secure variable management
  • 📊 Database Integration: Prisma ORM configured and ready for your models
  • 🛠️ CLI Tool: Includes nextpressx for streamlined development workflows
  • 🛠️ Fast Development: Start quickly with zero configuration needed

Quick Start 🚀

Create a new NextPress Monorepo project with a single command:

npx create-nextpress

Or use with your preferred package manager:

# Using npm
npm create nextpress@latest

# Using yarn
yarn create nextpress

# Using pnpm
pnpm create nextpress

# Using bun
bunx create-nextpress

Step-by-Step Guide 📝

  1. Run the command above
  2. Enter your project name (e.g., my-awesome-project)
  3. Select your preferred package manager:
    • npm
    • yarn
    • pnpm
    • bun
  4. Wait for automatic project structure creation
  5. Install dependencies:
    cd my-project
    npm install  # or yarn, pnpm install, bun install
  6. Start development:
    npm run dev  # or yarn dev, pnpm dev, bun dev
  7. Open http://localhost:3000 for the frontend and http://localhost:3001 for the backend!

Advanced Options ⚙️

# Create in current directory
npx create-nextpress@latest .

# Create with specific name
npx create-nextpress@latest my-project

# Enable debug mode to see detailed logs
npx create-nextpress@latest my-project --debug

# Check CLI version
npx create-nextpress@latest --version

Project Structure

my-project/              # The single repository containing polyrepo architecture
├── .env                 # Root environment variables
├── apps/                # Applications directory
│   ├── client/          # Independent Next.js Frontend Project
│   │   ├── src/         # Source directory
│   │   │   ├── app/     # Next.js App Router
│   │   │   └── ...      # Additional source files
│   │   ├── next.config.ts # Next.js configuration
│   │   ├── package.json # Frontend's independent dependencies
│   │   └── tsconfig.json # Frontend's TypeScript configuration
│   │
│   └── server/          # Independent Express Backend Project
│       ├── src/         # Source directory
│       │   ├── server.ts # Express server entry point
│       │   └── ...      # Additional source files
│       ├── package.json # Backend's independent dependencies
│       └── tsconfig.json # Backend's TypeScript configuration
│
│
├── package.json         # Root orchestration package.json (not a traditional workspace)
└── README.md            # Project documentation

Each project directory is a fully independent application that could be extracted to its own repository if needed in the future - true polyrepo architecture in a single repository.

System Requirements 📋

  • Node.js 18.0.0 or later
  • macOS, Windows, or Linux
  • Supported package manager (npm, yarn, pnpm, or bun)

FAQ

What is polyrepo architecture in a single monorepo?

NextPress combines the best of both worlds: it structures your application as truly independent projects (polyrepo approach) but keeps them in one cohesive repository. Unlike traditional monorepos with shared dependencies and tight coupling, NextPress maintains complete isolation between frontend and backend with their own independent package.json files, dependencies, build processes, and deployment pipelines - all while providing the convenience of a single codebase.

How does the frontend communicate with the backend?

The frontend (Next.js) and backend (Express) are configured as separate applications that can communicate via API calls. The backend exposes RESTful API endpoints that the frontend can consume.

Can I use NextPress for production applications?

Absolutely! NextPress follows best practices for both frontend and backend development, making it suitable for production applications of any size.

How can I customize the database connection?

Edit the pkg/prisma/schema.prisma file to configure your database connection. NextPress supports PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, and CockroachDB through Prisma.

Contributing 🤝

We welcome contributions! Please see our contributing guidelines for details.

License 📜

MIT License


✨ Built with ❤️ by the NextPress team ✨
Nextpress.cc

/create-nextpress/

    Package Sidebar

    Install

    npm i create-nextpress

    Weekly Downloads

    125

    Version

    2.8.1

    License

    MIT

    Unpacked Size

    959 kB

    Total Files

    9

    Last publish

    Collaborators

    • foshati