create-next-bricks
Version:
create-next-bricks is a CLI tool designed to scaffold a modular and scalable structure for Next.js applications. Inspired by the concept of `bricks` as reusable building blocks, this tool helps developers quickly set up a well-structured Next.js project w
106 lines (73 loc) β’ 3.14 kB
Markdown
# π Next.js Project Generator
A powerful CLI tool to scaffold a scalable, modular **Next.js** project with best practices, essential dependencies, and opinionated architectureβready for real-world development.
## π¦ Features
- β
**Modular folder structure**
- π§ **Redux Toolkit + Persist** pre-configured
- π **i18next** for localization
- π¨ **Material-UI** and **SCSS** support
- βοΈ **TypeScript**, strict linting, and Prettier
- π Auth module boilerplate
- ποΈ `.env.local` with default variables
- π§ͺ Testing ready structure
- π οΈ Easily extendable (e.g., Socket.IO, internationalization)
## π οΈ How to Use
```bash
# Run
npx create-next-bricks
```
If no app name is passed, it defaults to `app-name`.
## π Generated Folder Structure
```
your-app-name/
βββ public/
βββ src/
β βββ app/ # Next.js App Router
β βββ config/ # Environment configs
β βββ modules/
β β βββ auth/ # Auth-related logic
β βββ shared/ # Shared UI/components
β βββ store/ # Redux Toolkit store setup
β βββ types/ # Global TypeScript types
β βββ styles/ # Global SCSS files
βββ .env.local # Local environment variables
```
> Temporary folders include `.temp` files to prevent deletion during initial Git commits.
## π Pre-installed Packages
| Category | Packages |
|-------------------|--------------------------------------------------------------------------|
| **Core** | `next`, `react`, `react-dom`, `typescript`, `sass` |
| **UI Framework** | `@mui/material`, `@mui/icons-material`, `@emotion/react`, `styled` |
| **State Mgmt** | `@reduxjs/toolkit`, `react-redux`, `redux-persist` |
| **Utilities** | `axios`, `i18next`, `react-i18next` |
| **Dev Tools** | `@types/react`, `@types/node`, `prettier` |
## βοΈ Configuration Included
- `package.json` with common scripts
- `tsconfig.json` with `@/*` path aliases
- `next.config.js` with SVG support
- `store` with Redux Toolkit + persistence
- Localization setup with i18next
- Global layout, styles, and sample components
- Auth module boilerplate (slice + login page)
- API helper (`api.ts`) using Axios
## π¬ Need Socket.IO Support?
You can easily extend this with **Socket.IO**.
> π‘ Just ans:
>
> **1. Do you want to include Socket.IO setup? (yes/no):**
> **2. Do you want to add sample chat ui? (yes/no):**
It generate a Socket.IO integration with:
- Socket initialization via custom hook
- Connection and event handling
- Folder structure that fits into `shared` or `modules/chat`
## π§βπ» Contributing
This CLI generator is meant for rapid prototyping and scaling production apps. Fork it, modify it, and use it across teams!
## π License
**MIT** β Free to use, modify, and distribute.