create-nextpress
Version:
Polyrepo architecture in a single monorepo
172 lines (127 loc) ⢠7.12 kB
Markdown
<div align="center">
<a href="https://github.com/Nextpress-cc">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://foshati.storage.c2.liara.space/Nextpress.png">
<img alt="Nextpress logo" src="https://foshati.storage.c2.liara.space/Nextpress.png" height="150" style="border-radius: 12px;">
</picture>
</a>
<h1>NextPress v2.8.1</h1>
<h3>Polyrepo architecture in a single monorepo</h3>
<a href="https://www.npmjs.com/package/create-nextpress"><img alt="NPM version" src="https://img.shields.io/npm/v/create-nextpress.svg?style=for-the-badge&labelColor=000000&color=0066FF&borderRadius=8"></a>
<a href="https://www.npmjs.com/package/create-nextpress"><img alt="Download Count" src="https://img.shields.io/npm/dt/create-nextpress.svg?style=for-the-badge&labelColor=000000&color=0066FF&borderRadius=8"></a>
<a href="https://github.com/Nextpress-cc/create-nextpress/blob/main/LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-0066FF.svg?style=for-the-badge&labelColor=000000&borderRadius=8"></a>
<a href="https://github.com/Nextpress-cc"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Nextpress-0066FF.svg?style=for-the-badge&logo=github&labelColor=000000&logoWidth=20&borderRadius=8"></a>
</div>
# 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:
```bash
npx create-nextpress
```
Or use with your preferred package manager:
```bash
# 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:
```bash
cd my-project
npm install # or yarn, pnpm install, bun install
```
6. Start development:
```bash
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 āļø
```bash
# 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](https://github.com/Nextpress-cc/create-nextpress/blob/main/CONTRIBUTING.md) for details.
## License š
[MIT License](https://github.com/Nextpress-cc/create-nextpress/blob/main/LICENSE)
---
<div align="center">
⨠Built with ā¤ļø by the NextPress team āØ<br>
<a href="https://github.com/Nextpress-cc">Nextpress.cc</a>
</div>