devstacker
v1.3.0
Published
CLI to scaffold **fullstack applications** with **React, Next.js, Vue, Angular** on the frontend and **Express** on the backend, with support for **JavaScript** and **TypeScript**. It also supports **MongoDB integration** using environment variables, incl
Maintainers
Readme
Create Fullstack App CLI
CLI to scaffold fullstack applications with React, Next.js, Vue, Angular on the frontend and Express on the backend, with support for JavaScript and TypeScript. It also supports MongoDB integration using environment variables, including automatic .env creation with default configurations.
Table of Contents
- Installation
- Usage
- Features
- Frontend Options
- Backend Options
- MongoDB Setup
- Linting and Formatting
- Project Structure
- Running the Project
- Contributing
- License
Installation
⚠️ Because the name
create-fullstack-appis already used on npm, you’ll need to installdevstackerbefore using the command.
Step 1 — Install the package
You can install it globally (recommended):
npm install -g devstackerOr install locally in your project folder:
npm install devstackerStep 2 — Run the CLI
Once installed, you can run:
npx create-fullstack-appUsage
After running the CLI:
- Enter your project name (default is
my-fullstack-app). - Choose a frontend framework: React, Next.js, Vue, Angular.
- Choose backend language: JavaScript or TypeScript.
- If React is selected, choose setup tool: Create React App or Vite.
- Optionally, choose MongoDB as your database.
- Optionally, choose to install Tailwind CSS for the frontend (not available for Angular).
- Optionally, choose to install ESLint and Prettier for code linting and formatting.
The CLI will automatically:
- Create a server folder with Express setup.
- Create a client folder with the chosen frontend framework.
- Create a root
package.jsonwithnpm run devto run frontend + backend concurrently. - Automatically generate a
.envfile in theserverfolder with default MongoDB and PORT configuration if MongoDB is selected. - Install all required dependencies automatically.
Features
- Supports React, Next.js, Vue, Angular frontend.
- Supports JavaScript & TypeScript backend.
- Optional MongoDB setup with automatic
.envcreation. - Optional Tailwind CSS setup for frontend frameworks (except Angular).
- Optional ESLint and Prettier setup with automatic configuration files in root, client, and server folders.
- Automatically installs concurrently to run frontend and backend together.
- Default project name, author info, and GitHub link included.
Frontend Options
| Framework | Setup Tool | | --------- | ------------------- | | React | CRA / Vite | | Next.js | TypeScript + ESLint | | Vue | Vite | | Angular | Angular CLI |
Backend Options
- JavaScript: Express + CORS
- TypeScript: Express + CORS + ts-node-dev + types packages
- Optional MongoDB: Mongoose + dotenv
.envfile automatically created inserverfolder with default:
# MongoDB Configuration
MONGODB_URL=mongodb://127.0.0.1:27017/myappDB
# Server Port
PORT=5000MongoDB Setup
If you chose MongoDB during project setup:
- A
.envfile is automatically created in theserverfolder:
server/.env- Example
.envcontent:
# MongoDB connection URL (local)
MONGODB_URL=mongodb://127.0.0.1:27017/myappDB
# Backend port
PORT=5000For MongoDB Atlas, replace with:
MONGODB_URL=mongodb+srv://username:[email protected]/myappDB?retryWrites=true&w=majority- Make sure to add
.envto.gitignore:
server/.env- The backend automatically reads this
.envfile on startup.
Linting and Formatting
If you chose to install ESLint and Prettier during setup:
- ESLint configurations are created in
root,client, andserverfolders for isolated linting rules. - Prettier configurations ensure consistent code formatting across the project.
- You can run linting and formatting commands in each folder:
# In root, client, or server folder
npm run lint # If defined in package.json
npx eslint . --ext .js,.jsx,.ts,.tsx
npx prettier --check .
npx prettier --write .This allows different ESLint rules for frontend (e.g., React-specific) and backend (e.g., Node.js-specific) code.
Project Structure
After scaffolding, your project will look like:
my-fullstack-app/
├─ client/ # Frontend
│ ├─ .eslintrc.js # ESLint config (if chosen)
│ └─ .prettierrc # Prettier config (if chosen)
├─ server/ # Backend
│ ├─ index.js or index.ts
│ ├─ .env # MongoDB config (auto-generated if selected)
│ ├─ .eslintrc.js # ESLint config (if chosen)
│ └─ .prettierrc # Prettier config (if chosen)
├─ .eslintrc.js # Root ESLint config (if chosen)
├─ .prettierrc # Root Prettier config (if chosen)
├─ package.json # Root scripts (dev using concurrently)
└─ README.mdRunning the Project
cd my-fullstack-app
npm run dev- Backend server: http://localhost:5000
- Frontend: http://localhost:3000 (depends on framework)
License
ISC License Author: Jack Pritom Soren GitHub: Jack Pritom Soren
