create-backlist 6.1.3 β†’ 6.1.4

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.
Files changed (2) hide show
  1. package/README.md +153 -61
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,97 +1,189 @@
1
- # πŸš€ Create Backlist
2
1
 
3
- [![NPM Version](https://img.shields.io/npm/v/create-backlist.svg)](https://www.npmjs.com/package/create-backlist)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
+ # πŸš€ Create Backlist CLI
5
3
 
6
- Tired of manually creating backend boilerplate every time you build a frontend? **`create-backlist`** is an intelligent CLI tool that analyzes your frontend project and automatically generates a backend with all the necessary routes and controllers, saving you hours of repetitive work.
4
+ [![NPM Version](https://img.shields.io/npm/v/create-backlist.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/create-backlist)
5
+ [![Downloads](https://img.shields.io/npm/dt/create-backlist.svg?style=flat-square&color=green)](https://www.npmjs.com/package/create-backlist)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
7
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=flat-square)](https://github.com/WAH-ISHAN/create-backlist/graphs/commit-activity)
7
8
 
8
- It's not just another scaffolder; it's a **context-aware, dynamic code generator** that builds a backend tailor-made for your frontend's specific API needs.
9
+ > **The World's First AST-Powered Polyglot Backend Generator.**
9
10
 
10
- ![Demo GIF (Optional: Add a GIF of your tool in action here)](link-to-your-demo-gif.gif)
11
+ **`create-backlist`** is an intelligent CLI tool that **Reverse Engineers** your frontend source code to automatically generate production-ready backends.
11
12
 
12
- ## ✨ Key Features
13
+ Unlike traditional scaffolders that rely on static templates, it uses **Abstract Syntax Tree (AST) Analysis** to deep-scan your code (React, Vue, etc.), understand your API intent, and generate a custom backend in **Node.js, Python, Java, or C#** with full **Docker support**.
13
14
 
14
- - **πŸ€– Intelligent Code Analysis:** Scans your frontend codebase (React, Vue, etc.) using Abstract Syntax Trees (ASTs) to detect API calls (`fetch` requests).
15
- - **🌐 Multi-Language Support:** Generate a backend in your preferred stack.
16
- - βœ… **Currently Supports:**
17
- - Node.js (with TypeScript & Express)
18
- - C# (with ASP.NET Core Web API)
19
- - ⏳ **Coming Soon:**
20
- - Python (with FastAPI)
21
- - Java (with Spring Boot)
22
- - **⚑️ Fully Automated:** A single command handles everything from project scaffolding to dependency installation.
23
- - **πŸ”§ Zero-Configuration:** No complex config files needed. Just run the command and answer a few simple questions.
24
- - **🧼 Clean Code Generation:** Creates a well-structured backend, ready for you to implement your business logic.
15
+ ---
25
16
 
26
- ## πŸ“¦ Installation & Usage
17
+ ## 🧠 The Core Technology (AST Analysis)
18
+
19
+ Why is this tool unique? It doesn't just "read" text; it "understands" structure.
20
+
21
+ We use an **Abstract Syntax Tree (AST)** engine to break down your frontend code into its fundamental components. This allows us to ignore comments, spacing, and formatting, focusing purely on the logic.
22
+
23
+ ```mermaid
24
+ %%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#007ACC', 'edgeLabelBackground':'#ffffff', 'tertiaryColor': '#f4f4f4'}}}%%
25
+ graph TD
26
+ subgraph Frontend Source
27
+ Code["fetch('/api/users', { method: 'POST' })"]
28
+ end
29
+
30
+ Code -->|Parser| AST[AST Node: CallExpression]
31
+
32
+ subgraph AST Logic Engine
33
+ AST -->|Detect| Type[Callee: fetch]
34
+ AST -->|Extract| Arg1[Arg 0: '/api/users']
35
+ AST -->|Extract| Arg2[Prop: method = 'POST']
36
+ end
37
+
38
+ subgraph Backend Generation
39
+ Arg1 & Arg2 -->|Map to| Route["Route: POST /api/users"]
40
+ Route -->|Generate| Controller["Controller: createUser()"]
41
+ end
42
+
43
+ style AST fill:#ffcc00,color:black
44
+ style Route fill:#00cc66,color:white
45
+
46
+ ```
27
47
 
28
- No global installation needed! Just run this command inside your existing frontend project's root directory:
48
+ ---
49
+
50
+ ## πŸ—οΈ System Architecture
51
+
52
+ Our **3-Stage Compilation Process** ensures that one frontend codebase can generate backends in multiple languages.
53
+
54
+ ```mermaid
55
+ graph LR
56
+ subgraph Input [Stage 1: Analysis]
57
+ A[Frontend Files] -->|AST Parsing| B(Scanner Engine)
58
+ end
59
+ subgraph Core [Stage 2: Abstraction]
60
+ B -->|Extracts Endpoints| C{Intermediate JSON Bridge}
61
+ end
62
+ subgraph Output [Stage 3: Generation]
63
+ C -->|Transpiles| D[Node.js (Express)]
64
+ C -->|Transpiles| E[Python (FastAPI)]
65
+ C -->|Transpiles| F[Java (Spring Boot)]
66
+ C -->|Transpiles| G[C# (.NET Core)]
67
+ end
68
+ style C fill:#ff9900,stroke:#333,stroke-width:2px,color:white
29
69
 
30
- ```bash
31
- npm create backlist@latest
32
70
  ```
33
71
 
34
- The tool will then guide you through an interactive setup process:
72
+ 1. **Stage 1 (Analysis):** The engine scans source files (prioritizing active editor context) to build an AST.
73
+ 2. **Stage 2 (Abstraction):** Extracted logic is converted into a universal **JSON Intermediate Representation (IR)**. This acts as a "Bridge" between languages.
74
+ 3. **Stage 3 (Generation):** Language-specific compilers read the JSON IR and write production-ready code.
75
+
76
+ ---
35
77
 
36
- 1. **Enter a name for your backend directory:** (default: `backend`)
37
- 2. **Select the backend stack:** (e.g., `Node.js (TypeScript, Express)`)
38
- 3. **Enter the path to your frontend `src` directory:** (default: `src`)
78
+ ## ⚑ Real-World Example
39
79
 
40
- That's it! The tool will analyze your code, generate the backend in a new directory, and install all the necessary dependencies.
80
+ See how `create-backlist` transforms your code instantly.
41
81
 
42
- ### Example
82
+ ### 1️⃣ Input (Your Frontend Code)
43
83
 
44
- Let's say your frontend has this API call:
84
+ Imagine you have this simple API call in your React component:
45
85
 
46
86
  ```javascript
47
- // in your React component
48
- fetch('/api/products/123', { method: 'PUT' });
87
+ // user-profile.jsx
88
+ axios.post('/api/v1/users', { name: "Ishan", role: "Admin" });
89
+
49
90
  ```
50
91
 
51
- `create-backlist` will automatically generate a backend with a `products` controller and a `PUT` route for `products/:id`.
92
+ ### 2️⃣ Output (Generated Backend)
52
93
 
53
- ## πŸ’‘ How It's Different from Other Tools
94
+ Running `npx create-backlist` automatically detects the route and body, generating:
54
95
 
55
- | Tool | Approach | Use Case |
56
- | --------------------- | -------------------------------------- | ----------------------------------------------------------- |
57
- | **Express Generator** | Static Scaffolding | Quickly start a *new, empty* Express project. |
58
- | **NestJS CLI** | Static Scaffolding & Code Generation | Start a *new, structured* NestJS project and add parts manually. |
59
- | **`create-backlist`** | **Dynamic & Context-Aware Scaffolding** | Generate a backend that is **tailor-made** for an *existing* frontend. |
96
+ ```typescript
97
+ // Generated Controller (Node.js/Express)
98
+ import { Request, Response } from 'express';
60
99
 
61
- While traditional generators give you a blank canvas, `create-backlist` looks at your finished painting (the frontend) and builds the perfect frame (the backend) for it.
100
+ export const createUsers = async (req: Request, res: Response) => {
101
+ try {
102
+ // Logic for POST /api/v1/users
103
+ const { name, role } = req.body;
104
+ res.status(201).json({ message: "Resource created successfully" });
105
+ } catch (error) {
106
+ res.status(500).json({ error: "Internal Server Error" });
107
+ }
108
+ };
62
109
 
63
- ## πŸ—ΊοΈ Roadmap
110
+ ```
64
111
 
65
- `create-backlist` is actively being developed. Here are some of the features planned for future releases:
112
+ *It also automatically updates `routes.ts` and creates a `Dockerfile`!*
66
113
 
67
- - [ ] **Python Support:** Generate a backend using FastAPI.
68
- - [ ] **Java Support:** Generate a backend using Spring Boot.
69
- - [ ] **Database Model Generation:** Automatically create basic database models (e.g., Mongoose, Prisma) based on `POST`/`PUT` request bodies.
70
- - [ ] **Authentication Boilerplate:** Add an option to generate basic JWT-based authentication routes (`/login`, `/register`).
114
+ ---
115
+
116
+ ## ✨ Key Features & Innovation
117
+
118
+ | Feature | Description |
119
+ | --- | --- |
120
+ | **πŸ€– AST-Powered Engine** | Uses advanced static analysis to detect endpoints dynamically. Superior to Regex because it understands code structure. |
121
+ | **🌐 Polyglot Support** | **One Tool, Four Stacks.** <br>
122
+
123
+ <br>βœ… **Node.js** (Production Ready)<br>
124
+
125
+ <br>πŸš€ **Python, Java, C#** (Beta Support) |
126
+ | **🐳 Auto-Dockerization** | Instantly generates optimized `Dockerfile` and `docker-compose.yml` for zero-config deployment. |
127
+ | **🧠 Active Context Analysis** | Smartly prioritizes scanning the file currently open in your VS Code editor to capture complex endpoints missed by global scans. |
128
+ | **⚑ Zero-Config Boilerplate** | No manual setup. It scaffolds folders, installs dependencies (`package.json`, `pom.xml`, `requirements.txt`), and starts the server. |
71
129
 
72
- Have an idea for a new feature? Feel free to [open an issue](https://github.com/WAH-ISHAN/create-backlist/issues) on GitHub!
130
+ ---
73
131
 
74
- ## πŸ› οΈ Contributing
132
+ ## πŸ“¦ Installation & Usage
75
133
 
76
- Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
134
+ No global installation needed. Just run this command inside your existing frontend project's root:
77
135
 
78
- 1. Fork the Project
79
- 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
80
- 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
81
- 4. Push to the Branch (`git push origin feature/AmazingFeature`)
82
- 5. Open a Pull Request
136
+ ```bash
137
+ npx create-backlist@latest
138
+
139
+ ```
83
140
 
84
- ## πŸ“„ License
141
+ ### πŸš€ Interactive Walkthrough
85
142
 
86
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
143
+ The CLI will guide you through **3 Simple Steps**:
87
144
 
88
- ## πŸ™ Acknowledgements
145
+ 1. **Select Stack:** Choose between Node.js, Python, Java, or C#.
146
+ 2. **Name Backend:** Choose a folder name (e.g., `my-server`).
147
+ 3. **Locate Source:** Point to your frontend folder (e.g., `src`).
89
148
 
90
- - **Babel** for the amazing AST parser.
91
- - **Inquirer.js** for the interactive CLI prompts.
92
- - **fs-extra** for making file system operations a breeze.
93
- - **Google's Gemini** for assistance with brainstorming and debugging.
149
+ ---
150
+
151
+ ## πŸ’‘ Technical Comparison: Why AST?
152
+
153
+ Why did we choose Abstract Syntax Trees over simple Text Search (Regex)?
154
+
155
+ | Method | Can Read Comments? | Understands Variables? | Accuracy |
156
+ | --- | --- | --- | --- |
157
+ | **Regex (Others)** | ❌ No (Might detect commented code) | ❌ No | Low |
158
+ | **AST (Us)** | βœ… Yes (Ignores comments) | βœ… Yes (Trace variable values) | **High** |
159
+
160
+ ---
161
+
162
+ ## πŸ—ΊοΈ Roadmap & Research Goals
163
+
164
+ This tool is an ongoing research project aimed at automating software infrastructure.
165
+
166
+ * [x] **Phase 1: Core Engine** (AST Parsing & Node.js Support) - *Completed*
167
+ * [x] **Phase 2: Polyglot Architecture** (Python, Java, C# Support & Docker) - *Completed*
168
+ * [ ] **Phase 3: Intelligent Data Modeling** (Auto-generate Prisma/TypeORM schemas from request bodies)
169
+ * [ ] **Phase 4: Security Automation** (Auto-generate JWT auth and basic security headers)
170
+
171
+ ---
172
+
173
+ ## 🀝 Contributing & Feedback
174
+
175
+ This is an open-source project built for the developer community. We welcome contributions!
176
+
177
+ * Found a bug? [Open an Issue](https://github.com/WAH-ISHAN/create-backlist/issues).
178
+ * Want to contribute? [Submit a Pull Request](https://www.google.com/search?q=https://github.com/WAH-ISHAN/create-backlist/pulls).
179
+
180
+ Give us a ⭐ on GitHub if this saved you time!
181
+
182
+ ---
183
+
184
+ *Built with ❀️ for builders by [W.A.H. ISHAN](https://github.com/WAH-ISHAN).*
185
+
186
+ ```
94
187
 
95
188
  ---
96
189
 
97
- _Built with ❀️ by [W.A.H. ISHAN](https://github.com/WAH-ISHAN)._
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-backlist",
3
- "version": "6.1.3",
3
+ "version": "6.1.4",
4
4
  "description": "An advanced, multi-language backend generator based on frontend analysis.",
5
5
  "type": "commonjs",
6
6
  "bin": {