A modern, interactive CLI for scaffolding production-ready Express.js projects.
Inspired by the developer experience of `create-vite`, `create-x-lite` removes the tedious boilerplate setup so you can start building your next great idea in seconds.
This project was created as a submission for the boot.dev Hackathon (July 2025).
- Introduction: The "Why"
- Quick Start
- A Dynamic Scaffolding Engine
- Features
- What You Get
- Advanced Usage
- Philosophy
- Contributing
- Roadmap
- License
The time between deciding to build an API and writing the first line of business logic is often filled with tedious, repetitive setup. While tools like express-generator
exist, I always found myself immediately replacing their outdated configurations.
I built create-x-lite
to solve this problem for myself and others. It's the tool I wish I had: a single command that generates a complete, modern, and flexible Express.js project, letting me focus on what truly matters: the code.
Get started in seconds with a single command:
npx create-x-lite
The interactive guide will walk you through all configuration options. You can also specify a project name:
npx create-x-lite my-ts-project
Examples:
# Create with all defaults
create-x-lite my-app -y
# TypeScript project with Zod validation
create-x-lite my-api --typescript --zod
# Traditional structure with CommonJS
create-x-lite legacy-api --traditional --commonjs
Unlike simple template cloners, create-x-lite
operates as a dynamic scaffolding engine. After you select a base template (e.g., TypeScript with ESM), the tool programmatically modifies and enhances it with optional features.
For example, when you opt-in to Zod validation, the tool will:
- Add Dependencies: Inject
zod
into thepackage.json
. - Copy Snippets: Add pre-built middleware and schema files from an internal library.
- Generate Code: Use Handlebars templates to generate new, feature-specific files like a validated user route.
- Modify Existing Code: Read the main
index.ts
file and inject the necessaryimport
andapp.use()
statements to integrate the new feature.
This architecture allows the tool to be incredibly flexible and scalable.
- Interactive & Intuitive: A step-by-step guided process to configure your project.
- Non-Interactive Mode: Use CLI flags for automated, scripted project setup.
- Automatic Git Initialization: Every new project is created as a Git repository with an initial commit.
- TypeScript and JavaScript: First-class support for both languages.
- Modern and Legacy Modules: Choose between modern ESM or legacy CommonJS.
- Flexible Folder Structures: Select a feature-based or traditional MVC-style structure.
- Optional Schema Validation: Add Zod for powerful, type-safe validation during setup.
- Out-of-the-Box Tooling: Every project comes pre-configured with ESLint, Prettier, Nodemon, and a
.gitignore
file.
A create-x-lite
project is more than just a folder of files; it's a production-ready foundation. Here's an example of a generated TypeScript, ESM, Feature-based project with Zod:
my_ts_project/
├── eslint.config.js
├── nodemon.json
├── package.json
├── tsconfig.json
├── .gitignore
└── src
└── core
│ └── middlewares
│ └── zod.middleware.ts
└── features
│ ├── healthcheck
│ │ └── healthcheck.routes.ts
│ └── user
│ ├── user.routes.ts
│ └── user.schema.ts
└── index.ts
For TypeScript projects, the generated tsconfig.json
is configured with a strict ruleset ("strict": true
, noUnusedLocals
, etc.) to encourage robust, type-safe code from day one.
Projects come with the latest ESLint "flat config" (eslint.config.js
) and a pre-configured Prettier setup to ensure code quality and consistency across your entire codebase.
For frequent use, you can install create-x-lite
globally:
npm install -g create-x-lite
# Then use it anywhere
create-x-lite my-project
Skip the interactive prompts using command-line flags:
Flag | Alias | Description | Default (if -y) |
---|---|---|---|
--yes |
-y |
Skip all prompts and use defaults | N/A |
--typescript |
-t |
Use TypeScript instead of JavaScript | JavaScript |
--commonjs |
-c |
Use CommonJS instead of ESM | ESM |
--traditional |
-T |
Use traditional structure | Feature-based |
--zod |
Add Zod for validation | Disabled | |
--no-git |
Skip Git initialization | Enabled |
create-x-lite
is built on a simple philosophy: empower developers with modern tools, but get out of their way.
Inspired by the fantastic developer experience of tools like create-vite
, this project aims to provide an opinionated yet flexible foundation. While express-generator
provides a starting point, create-x-lite
provides a launchpad, configured with the tools and standards that professional developers expect in a modern backend project.
This project was born in a weekend hackathon, but I have a long-term vision for it. Contributions are absolutely welcome as it grows. This is a community tool, and I'm excited to see where we can take it together. The best ways to get involved are to:
- Open an issue with bug reports or feature suggestions.
- Submit a pull request for bug fixes or new features.
- Share the project with other developers who might find it useful.
My goal is for create-x-lite to become a comprehensive toolkit for backend development. The immediate roadmap includes:
- A powerful plugin system for databases (Prisma, TypeORM), authentication, and more.
- Support for other frameworks like Koa and Fastify.
- Automatic resource generators (npx x-lite g resource user).
Released under the MIT License.