create-leo 0.1.0 → 0.1.1

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 (3) hide show
  1. package/README.md +438 -51
  2. package/package.json +19 -5
  3. package/versions.json +2 -2
package/README.md CHANGED
@@ -1,91 +1,478 @@
1
- # create-leo
1
+ # Leo
2
2
 
3
- `create-leo` is a small, production-oriented backend generator for Node.js, FastAPI, databases, and RAG.
3
+ ### A lightweight backend project generator for developers who want a serious starting point.
4
4
 
5
- ## Requirements
5
+ **Leo** scaffolds production-oriented backend projects in seconds — from Express and Fastify APIs to FastAPI services, PostgreSQL/MongoDB backends, and RAG foundations.
6
6
 
7
- - Node.js 22+
8
- - Python 3.11+ for Python templates
9
- - `uv` is recommended for Python dependency installation, but Leo falls back to `venv` + `pip`
7
+ No boilerplate hunting.
8
+ No copying old projects.
9
+ No bloated frameworks.
10
10
 
11
- ## Use
11
+ Just choose a template and start building.
12
12
 
13
13
  ```bash
14
14
  npx create-leo my-api
15
15
  ```
16
16
 
17
- Choose one of seven templates:
17
+ ---
18
18
 
19
- | ID | Stack |
20
- |---|---|
21
- | `express-mongodb` | Express 5 + Mongoose + MongoDB |
22
- | `express-postgres` | Express 5 + pg + PostgreSQL |
23
- | `fastify-postgres` | Fastify + pg + PostgreSQL |
24
- | `fastapi-postgres` | FastAPI + SQLAlchemy + PostgreSQL |
25
- | `fastapi-mongodb` | FastAPI + native async PyMongo |
26
- | `semantic` | FastAPI + FastEmbed + local Qdrant + OpenAI-compatible LLM |
27
- | `hybrid` | Semantic + BM25 + RRF + optional cross-encoder |
19
+ ## Why Leo?
28
20
 
29
- ### Non-interactive
21
+ Starting a backend project usually means repeating the same setup:
22
+
23
+ - Create the project
24
+ - Configure the server
25
+ - Set up environment variables
26
+ - Add database configuration
27
+ - Create routes
28
+ - Add health checks
29
+ - Configure CORS
30
+ - Install dependencies
31
+ - Create a sensible folder structure
32
+
33
+ Leo handles that foundation for you.
34
+
35
+ You get a **clean, understandable project structure** that you can immediately extend into your own application.
36
+
37
+ > **Leo doesn't try to build your application for you. It gives you a solid starting point.**
38
+
39
+ ---
40
+
41
+ ## Quick Start
42
+
43
+ ### Create a project
44
+
45
+ ```bash
46
+ npx create-leo my-api
47
+ ```
48
+
49
+ Leo will guide you through the template selection:
50
+
51
+ ```text
52
+ ◇ Leo — backend project generator
53
+
54
+ ◇ Choose a backend template
55
+ │
56
+ ◆ Express + MongoDB
57
+ │ Express + PostgreSQL
58
+ │ Fastify + PostgreSQL
59
+ │ FastAPI + PostgreSQL
60
+ │ FastAPI + MongoDB
61
+ │ Semantic RAG
62
+ │ Hybrid RAG
63
+ ```
64
+
65
+ Then:
66
+
67
+ ```text
68
+ ✔ Created my-api
69
+
70
+ Next steps
71
+
72
+ cd my-api
73
+ npm run dev
74
+ ```
75
+
76
+ That's it.
77
+
78
+ ---
79
+
80
+ # Templates
81
+
82
+ Leo currently provides **7 backend templates**.
83
+
84
+ | Template | Stack | Best for |
85
+ |---|---|---|
86
+ | `express-mongodb` | Express 5 + Mongoose + MongoDB | REST APIs with MongoDB |
87
+ | `express-postgres` | Express 5 + pg + PostgreSQL | REST APIs with PostgreSQL |
88
+ | `fastify-postgres` | Fastify + pg + PostgreSQL | High-performance Node APIs |
89
+ | `fastapi-postgres` | FastAPI + SQLAlchemy + PostgreSQL | Python APIs with relational databases |
90
+ | `fastapi-mongodb` | FastAPI + async PyMongo + MongoDB | Python APIs with MongoDB |
91
+ | `semantic` | FastAPI + FastEmbed + Qdrant | Semantic RAG foundations |
92
+ | `hybrid` | Semantic + BM25 + RRF + optional reranking | Hybrid search / RAG systems |
93
+
94
+ ---
95
+
96
+ # What Leo Generates
97
+
98
+ Leo creates **real project files**, not code snippets pasted into strings.
99
+
100
+ For example:
101
+
102
+ ```text
103
+ my-api/
104
+ ├── src/
105
+ │ ├── config/
106
+ │ ├── middleware/
107
+ │ ├── models/
108
+ │ ├── routes/
109
+ │ ├── app.js
110
+ │ └── server.js
111
+ │
112
+ ├── .env
113
+ ├── .env.example
114
+ ├── .gitignore
115
+ ├── package.json
116
+ └── README.md
117
+ ```
118
+
119
+ The exact structure depends on the selected template.
120
+
121
+ Every template includes the fundamentals needed to start building:
122
+
123
+ - Environment configuration
124
+ - Health endpoint
125
+ - Routing structure
126
+ - Database foundation where applicable
127
+ - Error handling where applicable
128
+ - Development scripts
129
+ - README
130
+ - `.env.example`
131
+ - `.gitignore`
132
+
133
+ ---
134
+
135
+ # RAG Templates
136
+
137
+ Leo also provides lightweight foundations for building **Retrieval-Augmented Generation (RAG)** applications.
138
+
139
+ Instead of forcing a large framework onto your project, Leo gives you a small, understandable foundation.
140
+
141
+ ## Semantic RAG
142
+
143
+ ```text
144
+ semantic/
145
+ └── app/
146
+ ├── api/
147
+ │ └── routes/
148
+ │ ├── ingest.py
149
+ │ ├── query.py
150
+ │ └── health.py
151
+ │
152
+ ├── core/
153
+ │ └── config.py
154
+ │
155
+ ├── services/
156
+ │ ├── chunker.py
157
+ │ └── llm.py
158
+ │
159
+ ├── vectorstore/
160
+ │ └── qdrant.py
161
+ │
162
+ └── main.py
163
+ ```
164
+
165
+ The files intentionally start as **clear scaffolding rather than a giant pre-built RAG implementation**.
166
+
167
+ This makes the architecture easier to understand, customize, and extend.
168
+
169
+ ### Hybrid RAG
170
+
171
+ The hybrid template adds:
172
+
173
+ ```text
174
+ Semantic Retrieval
175
+ +
176
+ BM25 Search
177
+ ↓
178
+ RRF Fusion
179
+ ↓
180
+ Optional Reranking
181
+ ```
182
+
183
+ It provides dedicated places for:
184
+
185
+ - BM25 retrieval
186
+ - Result fusion
187
+ - Optional cross-encoder reranking
188
+ - Semantic retrieval
189
+ - LLM integration
190
+
191
+ The reranker is **disabled by default** so you can start lightweight and enable it when needed.
192
+
193
+ ---
194
+
195
+ # Design Philosophy
196
+
197
+ Leo follows a few simple principles.
198
+
199
+ ### Lightweight by default
200
+
201
+ No unnecessary framework layers.
202
+
203
+ Leo uses native platform features whenever they make sense.
204
+
205
+ ### Understandable
206
+
207
+ Generated projects should be easy to read and modify.
208
+
209
+ You shouldn't need to understand a huge abstraction layer before changing your own backend.
210
+
211
+ ### Production-oriented
212
+
213
+ The templates include practical foundations such as:
214
+
215
+ - Environment configuration
216
+ - Health checks
217
+ - Database separation
218
+ - Error handling
219
+ - Modular routing
220
+ - Sensible project structure
221
+
222
+ ### No framework lock-in
223
+
224
+ Leo does not force your project into a particular application architecture.
225
+
226
+ You own the generated code.
227
+
228
+ ### RAG without LangChain
229
+
230
+ RAG templates intentionally avoid LangChain.
231
+
232
+ Instead, the foundation uses focused components:
233
+
234
+ - FastEmbed
235
+ - Qdrant
236
+ - BM25
237
+ - RRF
238
+ - Optional cross-encoder reranking
239
+ - OpenAI-compatible LLM clients
240
+
241
+ This keeps the underlying retrieval architecture visible.
242
+
243
+ ---
244
+
245
+ # Built With
246
+
247
+ Leo itself is intentionally small.
248
+
249
+ ```text
250
+ TypeScript
251
+ │
252
+ ├── @clack/prompts
253
+ ├── picocolors
254
+ ├── Node.js native APIs
255
+ └── tsup
256
+ ```
257
+
258
+ The CLI uses native Node.js functionality where possible instead of adding dependencies for things Node already provides.
259
+
260
+ ---
261
+
262
+ # LLM Flexibility
263
+
264
+ The RAG templates use an **OpenAI-compatible client interface**.
265
+
266
+ That means the LLM endpoint can be configured through:
267
+
268
+ ```env
269
+ LLM_BASE_URL=
270
+ LLM_API_KEY=
271
+ LLM_MODEL=
272
+ ```
273
+
274
+ You can therefore adapt the generated project to different OpenAI-compatible providers or local development setups without rewriting the application architecture.
275
+
276
+ ---
277
+
278
+ # Local Vector Storage
279
+
280
+ The RAG templates use **Qdrant local file storage**.
281
+
282
+ You don't need to run a separate Qdrant server just to experiment with the generated project.
283
+
284
+ This makes the starter particularly convenient for:
285
+
286
+ - Learning RAG
287
+ - Prototyping
288
+ - Local development
289
+ - Small projects
290
+ - Experiments
291
+
292
+ For production deployments, you can replace the local setup with your preferred hosted/vector infrastructure.
293
+
294
+ ---
295
+
296
+ # Free-Friendly Development
297
+
298
+ Leo does not require a paid service just to generate a project.
299
+
300
+ For normal backend templates, you can use:
301
+
302
+ - Local MongoDB
303
+ - Local PostgreSQL
304
+ - Free database tiers
305
+ - Your own infrastructure
306
+
307
+ For RAG development:
308
+
309
+ - Qdrant can run locally
310
+ - FastEmbed provides local embeddings
311
+ - An LLM API is only required when you want generated answers
312
+
313
+ The first FastEmbed usage may download an embedding model. This is expected.
314
+
315
+ > **RAG dependencies are heavier than normal backend templates, so their first installation can take noticeably longer.**
316
+
317
+ ---
318
+
319
+ # 🛠️ CLI Options
320
+
321
+ ## Interactive mode
322
+
323
+ ```bash
324
+ npx create-leo my-api
325
+ ```
326
+
327
+ ## Select a template directly
30
328
 
31
329
  ```bash
32
330
  npx create-leo my-api --template express-mongodb
33
- npx create-leo my-rag --template hybrid --no-install
331
+ ```
332
+
333
+ ## Create a RAG project
334
+
335
+ ```bash
336
+ npx create-leo my-rag --template hybrid
337
+ ```
338
+
339
+ ## Skip dependency installation
340
+
341
+ ```bash
342
+ npx create-leo my-api --template express-mongodb --no-install
343
+ ```
344
+
345
+ Useful for:
346
+
347
+ - CI
348
+ - Testing
349
+ - Offline setup
350
+ - Custom dependency installation
351
+ - Template inspection
352
+
353
+ ## List available templates
354
+
355
+ ```bash
34
356
  npx create-leo --list
35
357
  ```
36
358
 
37
- `--no-install` is useful for CI, smoke tests, or when you want to install dependencies yourself.
359
+ ---
360
+
361
+ # 🐍 Python Support
362
+
363
+ Python templates require:
38
364
 
39
- ## Design choices
365
+ ```text
366
+ Python 3.11+
367
+ ```
40
368
 
41
- - Node 22 native `--watch` and `--env-file`; no nodemon or dotenv.
42
- - ESM everywhere in Node templates.
43
- - Express 5 async handlers; no custom async wrapper.
44
- - FastAPI configuration uses `pydantic-settings`.
45
- - MongoDB Python uses PyMongo's async client rather than Motor.
46
- - RAG uses FastEmbed/ONNX rather than sentence-transformers + torch.
47
- - Qdrant runs in local file mode; no Qdrant server is required for the starter.
48
- - LLM calls use the OpenAI client with configurable `LLM_BASE_URL`.
49
- - No LangChain dependency.
50
- - Hybrid RAG overlays the semantic pipeline instead of duplicating ingestion.
51
- - Every template has a DB-independent `/health` endpoint.
369
+ Leo supports Python environments using:
52
370
 
53
- ## Free-tier development
371
+ ```text
372
+ uv
373
+ ```
54
374
 
55
- The generated projects do not require a paid service. For hosted free tiers, use a provider appropriate to the database you choose, or run the database locally. RAG's local Qdrant storage is file-based. An LLM key is only needed when you want generated answers rather than retrieved context.
375
+ when available, with a fallback to:
56
376
 
57
- The first FastEmbed query downloads its embedding model. This is expected.
377
+ ```text
378
+ venv + pip
379
+ ```
58
380
 
59
- ## Publishing
381
+ This means you don't have to manually create a virtual environment every time you scaffold a Python backend.
60
382
 
61
- Before publishing, verify the package name is available:
383
+ ---
62
384
 
63
- ```bash
64
- npm view create-leo
65
- node scripts/check-name.mjs
385
+ # 📦 Requirements
386
+
387
+ ### Node.js
388
+
389
+ ```text
390
+ Node.js 22+
66
391
  ```
67
392
 
68
- If it is unavailable, use `create-leo-cli` or a scoped package.
393
+ ### Python
69
394
 
70
- Then:
395
+ Required only for Python templates:
396
+
397
+ ```text
398
+ Python 3.11+
399
+ ```
400
+
401
+ `uv` is recommended but optional.
402
+
403
+ ---
404
+
405
+ # 🔍 Example
406
+
407
+ Create a PostgreSQL backend:
71
408
 
72
409
  ```bash
73
- npm login
74
- npm publish
410
+ npx create-leo orders-api --template express-postgres
75
411
  ```
76
412
 
77
- The `prepublishOnly` script resolves current Node dependency versions, builds `dist`, and runs tests.
413
+ Create a FastAPI + PostgreSQL backend:
78
414
 
79
- ## Testing
415
+ ```bash
416
+ npx create-leo backend --template fastapi-postgres
417
+ ```
418
+
419
+ Create a hybrid RAG foundation:
80
420
 
81
421
  ```bash
82
- npm install
83
- npm test
84
- npm run build
422
+ npx create-leo knowledge-base --template hybrid
85
423
  ```
86
424
 
87
- CI generates all templates with `--no-install` and checks their basic filesystem output.
425
+ Then open the generated project and start building.
426
+
427
+ ---
428
+
429
+ # 🗺️ What's Next?
430
+
431
+ Leo is intentionally starting small.
432
+
433
+ Possible future directions include:
434
+
435
+ - More backend templates
436
+ - Authentication foundations
437
+ - Redis-ready templates
438
+ - Queue/worker foundations
439
+ - More RAG architectures
440
+ - Better project customization
441
+ - Additional database options
442
+ - Template composition
443
+ - Project configuration
444
+ - More CLI commands
445
+
446
+ The goal is not to generate everything.
447
+
448
+ The goal is to make the **first 30 minutes of a backend project dramatically easier**.
449
+
450
+ ---
451
+
452
+ # 🤝 Contributing
88
453
 
89
- ## License
454
+ Contributions, ideas, template suggestions, and bug reports are welcome.
455
+
456
+ If you find a problem, please open an issue with:
457
+
458
+ 1. Operating system
459
+ 2. Node.js version
460
+ 3. Python version (if applicable)
461
+ 4. Leo command used
462
+ 5. Error/output
463
+
464
+ ---
465
+
466
+ # 📄 License
90
467
 
91
468
  MIT
469
+
470
+ ---
471
+
472
+ <div align="center">
473
+
474
+ **Built with Node.js + TypeScript**
475
+
476
+ ⭐ If Leo is useful to you, consider giving the project a star.
477
+
478
+ </div>
package/package.json CHANGED
@@ -1,10 +1,20 @@
1
1
  {
2
2
  "name": "create-leo",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A lightweight project generator for production-oriented Node.js, FastAPI, database and RAG backends.",
5
5
  "type": "module",
6
- "bin": { "create-leo": "dist/index.js", "leo": "dist/index.js" },
7
- "files": ["dist", "templates", "README.md", "LICENSE", "CHANGELOG.md", "versions.json"],
6
+ "bin": {
7
+ "create-leo": "dist/index.js",
8
+ "leo": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "templates",
13
+ "README.md",
14
+ "LICENSE",
15
+ "CHANGELOG.md",
16
+ "versions.json"
17
+ ],
8
18
  "scripts": {
9
19
  "build": "tsup src/index.ts --format esm --target node22 --clean",
10
20
  "dev": "tsx src/index.ts",
@@ -13,9 +23,13 @@
13
23
  "resolve-versions": "node scripts/resolve-versions.mjs",
14
24
  "prepublishOnly": "npm run resolve-versions && npm run build && npm test"
15
25
  },
16
- "engines": { "node": ">=22.0.0" },
26
+ "engines": {
27
+ "node": ">=22.0.0"
28
+ },
17
29
  "packageManager": "npm@11",
18
- "publishConfig": { "access": "public" },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
19
33
  "dependencies": {
20
34
  "@clack/prompts": "^0.11.0",
21
35
  "picocolors": "^1.1.1"
package/versions.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "fastapi": "fastapi==0.142.2",
12
12
  "uvicorn": "uvicorn==0.54.0",
13
13
  "pydantic-settings": "pydantic-settings==2.15.0",
14
- "sqlalchemy": "sqlalchemy==2.1.2",
14
+ "sqlalchemy": "sqlalchemy==2.1.3",
15
15
  "psycopg": "psycopg==3.3.6",
16
16
  "pymongo": "pymongo==4.18.2",
17
17
  "python-multipart": "python-multipart==0.0.32",
@@ -19,6 +19,6 @@
19
19
  "fastembed": "fastembed==0.8.1",
20
20
  "qdrant-client": "qdrant-client==1.19.1",
21
21
  "openai": "openai==3.24.0",
22
- "bm25s": "bm25s==0.3.11"
22
+ "bm25s": "bm25s==0.3.12"
23
23
  }
24
24
  }