UNPKG

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
# πŸš€ 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.