node-vite-easysetup
v1.0.3
Published
By installing this package you can easily set up MERN project with node and vite.
Maintainers
Readme
Node-Vite-EasySetup
Node-Vite-EasySetup is an NPM package that allows you to quickly scaffold a full-stack application with an Express.js backend and a Vite-powered React frontend. The generated project structure is pre-configured with essential folders, files, and setups to streamline your development process.
Features
Express.js Backend:
- Includes pre-configured folder structure:
src,utils,models,controllers,routes,config - MongoDB connection with
.envsupport - Example API route for quick start
- Includes pre-configured folder structure:
Vite.js Frontend:
- React-based frontend using Vite for fast development
- Pre-configured folders:
components,shared,utils,context - Example
AppContextsetup for state management - TailwindCSS configuration included (optional)
Installation
To use the package, you must first install it globally:
npm install -g node-vite-easysetupUsage
Run the following command to create a new full-stack project:
npx node-vite-easysetup <project-name>Replace <project-name> with the desired name of your project. If no name is provided, the default project name will be my-fullstack-app.
Example
node-vite-easysetup my-awesome-projectThis will generate a folder structure like this:
my-awesome-project/
├── backend/
│ ├── src/
│ │ ├── index.js
│ │ ├── routes/
│ │ └── index.js
│ ├── utils/
│ ├── models/
│ ├── controllers/
│ ├── config/
│ └── .env
├── frontend/
├── src/
│ ├── components/
│ ├── shared/
│ ├── utils/
│ ├── context/
│ └── AppContext.js
└── tailwind.config.jsProject Details
Backend
Dependencies:
- Express.js
- Mongoose
- dotenv
Features:
- MongoDB connection setup with
.envconfiguration. - Basic Express.js setup including a sample route (
/api).
- MongoDB connection setup with
Environment Variables: Define the following variables in
.env:MONGO_URI=your_mongodb_uri PORT=5000
Frontend
Dependencies:
- React (via Vite template)
- TailwindCSS (optional)
Features:
- Organized folder structure for components, shared utilities, and context management.
- Pre-configured TailwindCSS setup (editable via
tailwind.config.js).
Context Setup: An example
AppContextfile is included for managing global state.
Development
Start Backend
Navigate to the backend folder and install dependencies:
cd backend
npm install
node src/index.jsStart Frontend
Navigate to the frontend folder and install dependencies:
cd frontend
npm install
npm run devThe frontend will be available at http://localhost:5173.
Full-stack Development
- Ensure the backend and frontend are running simultaneously.
- The backend API is accessible via
/apifrom the frontend.
Contributing
Contributions are welcome! Feel free to submit issues or pull requests on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Start building amazing full-stack apps faster with Node-Vite-EasySetup!
