nexforge-cli 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The official Command Line Interface for **NexForge** - Your custom Platform as a Service (PaaS).
4
4
  Deploy, manage, and scale your applications directly from your terminal with zero friction!
5
- <a href="https://nexforge-zeta.vercel.app/">Visit Nexforge</a>
5
+ <a href="https://nexforge-sandy.vercel.app/">Visit Nexforge</a>
6
6
 
7
7
  ## Installation
8
8
 
@@ -59,12 +59,17 @@ nexforge init
59
59
  nexforge create
60
60
  ```
61
61
 
62
- **Details:**
63
-
64
- - Interactively asks for your **Project Name** and **Tech Stack** (Next.js, MERN, Frontend, Backend).
65
- - Generates a fully configured folder structure matching NexForge's custom standards.
66
- - Pre-installs all necessary libraries (Tailwind, Framer Motion, AWS SDK, Mongoose, AI SDKs, Socket.io, etc.).
67
- - Automatically sets up boilerplate code like `server.js` or `App.jsx` and configures TailwindCSS.
62
+ **How it works (Step-by-Step):**
63
+
64
+ 1. **Run the Command:** Type `nexforge create` in your terminal.
65
+ 2. **Project Name:** The CLI will ask for a project name (e.g., `my-awesome-app`). It will create a new folder with this name.
66
+ 3. **Select your Stack:** You will be prompted to choose from 4 professional templates:
67
+ - **Frontend Only (React + Vite):** Generates a full React structure with Tailwind CSS, Framer Motion, GSAP, and all your UI components pre-configured.
68
+ - **Backend Only (Node + Express):** Generates an industry-standard MVC architecture (Controllers, Routes, Models) with Express, Mongoose, Socket.io, Redis, AWS SDK, and AI SDKs pre-installed.
69
+ - **MERN Stack:** Automatically creates a parent folder containing both the `frontend` and `backend` structures side-by-side.
70
+ - **Next.js (App Router):** Generates a Next.js App Router project packed with all UI and Backend dependencies, including an `app/api` folder for your backend routes.
71
+ 4. **Automatic Setup:** The CLI will magically generate the exact folder structures, boilerplate code (like `server.js` or `App.jsx`), configuration files (`tailwind.config.js`), and automatically run `npm install` for you!
72
+ 5. **Ready to Deploy:** Once finished, simply `cd` into your new folder, run `nexforge init` to connect it to your account, and `nexforge deploy` to take it live!
68
73
 
69
74
  ---
70
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexforge-cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Custom Deployment CLI for NexForge",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -116,7 +116,7 @@ app.listen(PORT, () => console.log(\`Server running on port \${PORT}\`));
116
116
 
117
117
  const setupFrontend = (targetDir) => {
118
118
  console.log(chalk.cyan("\n⚛️ Scaffolding Frontend (React + Vite)..."))
119
- runCommand(`npx create-vite@latest ${path.basename(targetDir)} --template react`, path.dirname(targetDir))
119
+ fs.mkdirSync(targetDir, { recursive: true })
120
120
 
121
121
  createFolderStructure(path.join(targetDir, "src"), [
122
122
  "assets",
@@ -129,14 +129,69 @@ const setupFrontend = (targetDir) => {
129
129
  "utils",
130
130
  ])
131
131
 
132
+ // Create Vite Boilerplate
133
+ const viteConfig = `import { defineConfig } from 'vite'
134
+ import react from '@vitejs/plugin-react'
135
+
136
+ export default defineConfig({
137
+ plugins: [react()],
138
+ })`
139
+ fs.writeFileSync(path.join(targetDir, "vite.config.js"), viteConfig)
140
+
141
+ const indexHtml = `<!doctype html>
142
+ <html lang="en">
143
+ <head>
144
+ <meta charset="UTF-8" />
145
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
146
+ <title>NexForge App</title>
147
+ </head>
148
+ <body>
149
+ <div id="root"></div>
150
+ <script type="module" src="/src/main.jsx"></script>
151
+ </body>
152
+ </html>`
153
+ fs.writeFileSync(path.join(targetDir, "index.html"), indexHtml)
154
+
155
+ const mainJsx = `import React from 'react'
156
+ import ReactDOM from 'react-dom/client'
157
+ import App from './App.jsx'
158
+ import './index.css'
159
+
160
+ ReactDOM.createRoot(document.getElementById('root')).render(
161
+ <React.StrictMode>
162
+ <App />
163
+ </React.StrictMode>,
164
+ )`
165
+ fs.writeFileSync(path.join(targetDir, "src", "main.jsx"), mainJsx)
166
+
167
+ const appJsx = `import React from 'react'
168
+
169
+ function App() {
170
+ return (
171
+ <div className="min-h-screen flex items-center justify-center bg-gray-900 text-white">
172
+ <h1 className="text-4xl font-bold">Welcome to NexForge</h1>
173
+ </div>
174
+ )
175
+ }
176
+
177
+ export default App`
178
+ fs.writeFileSync(path.join(targetDir, "src", "App.jsx"), appJsx)
179
+
132
180
  // Merge package.json
133
- const pkgPath = path.join(targetDir, "package.json")
134
- if (fs.existsSync(pkgPath)) {
135
- const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"))
136
- pkg.dependencies = { ...pkg.dependencies, ...FRONTEND_DEPS, "react-router-dom": "^7.18.0" }
137
- pkg.devDependencies = { ...pkg.devDependencies, tailwindcss: "^3.4.19", postcss: "^8.5.15", autoprefixer: "^10.5.0" }
138
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2))
181
+ const pkgJson = {
182
+ name: "frontend",
183
+ private: true,
184
+ version: "0.0.0",
185
+ type: "module",
186
+ scripts: {
187
+ dev: "vite",
188
+ build: "vite build",
189
+ preview: "vite preview"
190
+ },
191
+ dependencies: { ...FRONTEND_DEPS, "react": "^19.2.6", "react-dom": "^19.2.6", "react-router-dom": "^7.18.0" },
192
+ devDependencies: { "@vitejs/plugin-react": "^6.0.1", "vite": "^8.0.12", tailwindcss: "^3.4.19", postcss: "^8.5.15", autoprefixer: "^10.5.0" }
139
193
  }
194
+ fs.writeFileSync(path.join(targetDir, "package.json"), JSON.stringify(pkgJson, null, 2))
140
195
 
141
196
  // Tailwind config
142
197
  const twConfig = `/** @type {import('tailwindcss').Config} */