create-leo
v0.1.1
Published
A lightweight project generator for production-oriented Node.js, FastAPI, database and RAG backends.
Readme
Leo
A lightweight backend project generator for developers who want a serious starting point.
Leo scaffolds production-oriented backend projects in seconds — from Express and Fastify APIs to FastAPI services, PostgreSQL/MongoDB backends, and RAG foundations.
No boilerplate hunting.
No copying old projects.
No bloated frameworks.
Just choose a template and start building.
npx create-leo my-apiWhy Leo?
Starting a backend project usually means repeating the same setup:
- Create the project
- Configure the server
- Set up environment variables
- Add database configuration
- Create routes
- Add health checks
- Configure CORS
- Install dependencies
- Create a sensible folder structure
Leo handles that foundation for you.
You get a clean, understandable project structure that you can immediately extend into your own application.
Leo doesn't try to build your application for you. It gives you a solid starting point.
Quick Start
Create a project
npx create-leo my-apiLeo will guide you through the template selection:
◇ Leo — backend project generator
◇ Choose a backend template
│
◆ Express + MongoDB
│ Express + PostgreSQL
│ Fastify + PostgreSQL
│ FastAPI + PostgreSQL
│ FastAPI + MongoDB
│ Semantic RAG
│ Hybrid RAGThen:
✔ Created my-api
Next steps
cd my-api
npm run devThat's it.
Templates
Leo currently provides 7 backend templates.
| Template | Stack | Best for |
|---|---|---|
| express-mongodb | Express 5 + Mongoose + MongoDB | REST APIs with MongoDB |
| express-postgres | Express 5 + pg + PostgreSQL | REST APIs with PostgreSQL |
| fastify-postgres | Fastify + pg + PostgreSQL | High-performance Node APIs |
| fastapi-postgres | FastAPI + SQLAlchemy + PostgreSQL | Python APIs with relational databases |
| fastapi-mongodb | FastAPI + async PyMongo + MongoDB | Python APIs with MongoDB |
| semantic | FastAPI + FastEmbed + Qdrant | Semantic RAG foundations |
| hybrid | Semantic + BM25 + RRF + optional reranking | Hybrid search / RAG systems |
What Leo Generates
Leo creates real project files, not code snippets pasted into strings.
For example:
my-api/
├── src/
│ ├── config/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── app.js
│ └── server.js
│
├── .env
├── .env.example
├── .gitignore
├── package.json
└── README.mdThe exact structure depends on the selected template.
Every template includes the fundamentals needed to start building:
- Environment configuration
- Health endpoint
- Routing structure
- Database foundation where applicable
- Error handling where applicable
- Development scripts
- README
.env.example.gitignore
RAG Templates
Leo also provides lightweight foundations for building Retrieval-Augmented Generation (RAG) applications.
Instead of forcing a large framework onto your project, Leo gives you a small, understandable foundation.
Semantic RAG
semantic/
└── app/
├── api/
│ └── routes/
│ ├── ingest.py
│ ├── query.py
│ └── health.py
│
├── core/
│ └── config.py
│
├── services/
│ ├── chunker.py
│ └── llm.py
│
├── vectorstore/
│ └── qdrant.py
│
└── main.pyThe files intentionally start as clear scaffolding rather than a giant pre-built RAG implementation.
This makes the architecture easier to understand, customize, and extend.
Hybrid RAG
The hybrid template adds:
Semantic Retrieval
+
BM25 Search
↓
RRF Fusion
↓
Optional RerankingIt provides dedicated places for:
- BM25 retrieval
- Result fusion
- Optional cross-encoder reranking
- Semantic retrieval
- LLM integration
The reranker is disabled by default so you can start lightweight and enable it when needed.
Design Philosophy
Leo follows a few simple principles.
Lightweight by default
No unnecessary framework layers.
Leo uses native platform features whenever they make sense.
Understandable
Generated projects should be easy to read and modify.
You shouldn't need to understand a huge abstraction layer before changing your own backend.
Production-oriented
The templates include practical foundations such as:
- Environment configuration
- Health checks
- Database separation
- Error handling
- Modular routing
- Sensible project structure
No framework lock-in
Leo does not force your project into a particular application architecture.
You own the generated code.
RAG without LangChain
RAG templates intentionally avoid LangChain.
Instead, the foundation uses focused components:
- FastEmbed
- Qdrant
- BM25
- RRF
- Optional cross-encoder reranking
- OpenAI-compatible LLM clients
This keeps the underlying retrieval architecture visible.
Built With
Leo itself is intentionally small.
TypeScript
│
├── @clack/prompts
├── picocolors
├── Node.js native APIs
└── tsupThe CLI uses native Node.js functionality where possible instead of adding dependencies for things Node already provides.
LLM Flexibility
The RAG templates use an OpenAI-compatible client interface.
That means the LLM endpoint can be configured through:
LLM_BASE_URL=
LLM_API_KEY=
LLM_MODEL=You can therefore adapt the generated project to different OpenAI-compatible providers or local development setups without rewriting the application architecture.
Local Vector Storage
The RAG templates use Qdrant local file storage.
You don't need to run a separate Qdrant server just to experiment with the generated project.
This makes the starter particularly convenient for:
- Learning RAG
- Prototyping
- Local development
- Small projects
- Experiments
For production deployments, you can replace the local setup with your preferred hosted/vector infrastructure.
Free-Friendly Development
Leo does not require a paid service just to generate a project.
For normal backend templates, you can use:
- Local MongoDB
- Local PostgreSQL
- Free database tiers
- Your own infrastructure
For RAG development:
- Qdrant can run locally
- FastEmbed provides local embeddings
- An LLM API is only required when you want generated answers
The first FastEmbed usage may download an embedding model. This is expected.
RAG dependencies are heavier than normal backend templates, so their first installation can take noticeably longer.
🛠️ CLI Options
Interactive mode
npx create-leo my-apiSelect a template directly
npx create-leo my-api --template express-mongodbCreate a RAG project
npx create-leo my-rag --template hybridSkip dependency installation
npx create-leo my-api --template express-mongodb --no-installUseful for:
- CI
- Testing
- Offline setup
- Custom dependency installation
- Template inspection
List available templates
npx create-leo --list🐍 Python Support
Python templates require:
Python 3.11+Leo supports Python environments using:
uvwhen available, with a fallback to:
venv + pipThis means you don't have to manually create a virtual environment every time you scaffold a Python backend.
📦 Requirements
Node.js
Node.js 22+Python
Required only for Python templates:
Python 3.11+uv is recommended but optional.
🔍 Example
Create a PostgreSQL backend:
npx create-leo orders-api --template express-postgresCreate a FastAPI + PostgreSQL backend:
npx create-leo backend --template fastapi-postgresCreate a hybrid RAG foundation:
npx create-leo knowledge-base --template hybridThen open the generated project and start building.
🗺️ What's Next?
Leo is intentionally starting small.
Possible future directions include:
- More backend templates
- Authentication foundations
- Redis-ready templates
- Queue/worker foundations
- More RAG architectures
- Better project customization
- Additional database options
- Template composition
- Project configuration
- More CLI commands
The goal is not to generate everything.
The goal is to make the first 30 minutes of a backend project dramatically easier.
🤝 Contributing
Contributions, ideas, template suggestions, and bug reports are welcome.
If you find a problem, please open an issue with:
- Operating system
- Node.js version
- Python version (if applicable)
- Leo command used
- Error/output
📄 License
MIT
Built with Node.js + TypeScript
⭐ If Leo is useful to you, consider giving the project a star.
