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.
- package/README.md +153 -61
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,97 +1,189 @@
|
|
|
1
|
-
# π Create Backlist
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
2
|
+
# π Create Backlist CLI
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
[](https://www.npmjs.com/package/create-backlist)
|
|
5
|
+
[](https://www.npmjs.com/package/create-backlist)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://github.com/WAH-ISHAN/create-backlist/graphs/commit-activity)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
> **The World's First AST-Powered Polyglot Backend Generator.**
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
**`create-backlist`** is an intelligent CLI tool that **Reverse Engineers** your frontend source code to automatically generate production-ready backends.
|
|
11
12
|
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
80
|
+
See how `create-backlist` transforms your code instantly.
|
|
41
81
|
|
|
42
|
-
###
|
|
82
|
+
### 1οΈβ£ Input (Your Frontend Code)
|
|
43
83
|
|
|
44
|
-
|
|
84
|
+
Imagine you have this simple API call in your React component:
|
|
45
85
|
|
|
46
86
|
```javascript
|
|
47
|
-
//
|
|
48
|
-
|
|
87
|
+
// user-profile.jsx
|
|
88
|
+
axios.post('/api/v1/users', { name: "Ishan", role: "Admin" });
|
|
89
|
+
|
|
49
90
|
```
|
|
50
91
|
|
|
51
|
-
|
|
92
|
+
### 2οΈβ£ Output (Generated Backend)
|
|
52
93
|
|
|
53
|
-
|
|
94
|
+
Running `npx create-backlist` automatically detects the route and body, generating:
|
|
54
95
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
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
|
-
|
|
110
|
+
```
|
|
64
111
|
|
|
65
|
-
|
|
112
|
+
*It also automatically updates `routes.ts` and creates a `Dockerfile`!*
|
|
66
113
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
130
|
+
---
|
|
73
131
|
|
|
74
|
-
##
|
|
132
|
+
## π¦ Installation & Usage
|
|
75
133
|
|
|
76
|
-
|
|
134
|
+
No global installation needed. Just run this command inside your existing frontend project's root:
|
|
77
135
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
5. Open a Pull Request
|
|
136
|
+
```bash
|
|
137
|
+
npx create-backlist@latest
|
|
138
|
+
|
|
139
|
+
```
|
|
83
140
|
|
|
84
|
-
|
|
141
|
+
### π Interactive Walkthrough
|
|
85
142
|
|
|
86
|
-
|
|
143
|
+
The CLI will guide you through **3 Simple Steps**:
|
|
87
144
|
|
|
88
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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)._
|