create-next-xpres
v2.0.0
Published
Create a Next.js project with an Express server.
Readme
create-next-xpres
Version 2.0 (Major Changes)
create-next-xpres is a CLI tool that helps you quickly set up a Next.js project integrated with an Express server. It simplifies the process of creating a full-stack JavaScript application by combining Next.js for the frontend, Express for the backend and MongoDB for Database preconfigured, with optional Tailwind CSS for styling.
Features
- Automatic Project Setup: Automatically creates a Next.js app and an Express Server in a
rootdirectory. - Tailwind CSS Support: Optionally includes Tailwind CSS setup during the Next.js project creation.
- Express Server: Includes a basic Express server setup with routing, ready for customization.
Installation
You can install create-next-xpres globally to use it as a CLI tool:
npm install -g create-next-xpres@latestOr use it directly with npx:
npx create-next-xpres@latestUsage
Run the CLI: Start by running the CLI command:
npx create-next-xpres@latestProject Name: Enter the name of your project when prompted. If you don't enter a name, it will default to
next-xpres-app. If you enter., the files will be created in the current directory.Tailwind CSS: Choose whether to include Tailwind CSS during the Next.js app setup.
Project Structure: The tool will create a project with the following structure:
your-project-name/ ├── nextjs_app # Next.js app ├── index.js # Express server ├── connection.js # MongoDB Connection with Mongoose ├── package.json # Root package.json with Express dependencies ├── tailwind.config.js # Tailwind configuration (if Tailwind CSS is selected) └── postcss.config.js # PostCSS configuration (if Tailwind CSS is selected)Start the Project: After setup, navigate to the project folder and start the development server:
cd your-project-name npm run dev # Starts the Next.js development server with express using nodemon npm start # Starts the Next.js production server with express
Example
$ npx create-next-xpres
? Enter the name of your project: my-app
? Do you want to use Tailwind CSS? Yes
Running: npx create-next-app@latest client --tailwind
...
Express server setup completed.Scripts
The package.json includes the following scripts:
npm start: Starts the Next.js development server Express server.npm run dev: Starts the Next.js development server with Express server.
License
MIT License
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
