type-3-cli
v0.1.0-beta.5
Published
CLI tool to scaffold a Node.js + Express + TypeScript project
Downloads
6
Readme
Type-3 CLI Tool
Type-3 CLI is a powerful command-line tool designed to scaffold backend applications with minimal effort. Whether you're building a simple API or a full-fledged application with authentication, database integration, and logging, Type-3 CLI has got you covered. It supports both TypeScript and JavaScript, works seamlessly with popular databases like MongoDB, MySQL, and PostgreSQL, and provides robust features for modern development workflows.
Beta Release: This is a beta version of the tool. Please report any bugs or issues on the GitHub repository.
Features
✅ Language Support:
- Generate projects in TypeScript or JavaScript.
✅ Database Integration:
- Supports MongoDB, MySQL, PostgreSQL, or No Database setups.
✅ Authentication:
- Built-in support for JWT-based authentication (optional).
✅ Logging:
- Integrated Winston and Morgan logging utilities (optional).
✅ Customizable Configuration:
- Choose your preferred package manager (
npm,yarn,pnpm). - Configure environment variables via
.env.
✅ Project Structure:
- Automatically generates a clean, modular project structure with:
- Controllers
- Services
- Routes
- Models
- Middleware
- Utilities
✅ Fallback "Hello World":
- Generates a simple "Hello World" API when no database is selected.
Installation
To install the Type-3 CLI globally, run:
npm install -g type-3-cli@betaOr, if you're using yarn:
yarn global add type-3-cli@betaVerify the installation by checking the version:
type-3 --versionUsage
1. Initialize a New Project
Run the following command to create a new project:
type-3 initThis will prompt you to answer a series of questions about your project configuration.
2. Example Workflow
type-3 initPrompts:
Project Name
- my-api
Programming Language:
- TypeScript or JavaScript?
Database:
- MongoDB, MySQL, PostgreSQL, or None?
Authentication:
- Include JWT-based authentication? (Yes/No)
Logging:
- Include logging utilities? (Yes/No)
Package Manager:
- npm, yarn, or pnpm?
Project Name:
- Confirm the project name.
Once you've answered all prompts, the CLI will generate the project structure and install dependencies automatically.
Generated Project Structure
Here’s an example of the generated project structure:
my-api/
├── src/
│ ├── config/ # Database and other configurations
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Authentication middleware
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── utils/ # Logger utilities
│ └── server.ts # Entry point
├── .env # Environment variables
├── .gitignore # Git ignore file
├── package.json # Dependencies and scripts
├── README.md # Project documentation
└── tsconfig.json # TypeScript configuration (if applicable)Running the Application
Development Mode
Navigate to the project directory and start the development server:
cd my-api
npm run devor
yarn run devor
pnpm run devThe server will start on http://localhost:3000 by default.
Production Build
For TypeScript projects, build the project first:
npm run buildThen start the production server:
npm run startConfiguration
Environment Variables
Create a .env file in the root directory with the following variables:
PORT=3000
NODE_ENV=development
DB_URL=mongodb://localhost:27017/mydatabase
JWT_SECRET=your-secret-key
LOG_LEVEL=infoAdjust these values based on your project's requirements.
Contributing
We welcome contributions from the community! Here’s how you can help:
Fork the Repository:
- Fork the GitHub repository.
Clone Your Fork:
git clone https://github.com/your-username/type-3-cli.gitInstall Dependencies:
npm installMake Changes:
- Add features, fix bugs, or improve documentation.
Test Your Changes:
npm testSubmit a Pull Request:
- Push your changes and open a pull request against the
mainbranch.
- Push your changes and open a pull request against the
Reporting Issues
If you encounter any bugs or have feature requests, please open an issue on the GitHub repository.
Before Opening an Issue:
- Check the existing issues to avoid duplicates.
- Provide detailed information about the problem, including steps to reproduce it.
Roadmap
📌 Phase 1: Beta Release
- Status: ✅ Developed
- Focus: Core Features
- Key Deliverables:
- Project scaffolding (structured folder generation).
- Authentication utilities (JWT, bcrypt, OAuth-ready templates).
- Logger setup (Winston/Pino-based logging).
- Sample route, controller, and service generation.
.gitignore,.env, andREADMEauto-setup.- Database connection support (MongoDB, PostgreSQL, MySQL).
- Release Plan:
- Public Beta Launch.
- Gather feedback from early adopters.
- Fix bugs and minor refinements.
🚀 Phase 2: Stability & DX Enhancements (v1.0 Stable Release)
- Focus: Developer Experience (DX) and Stability
- Key Deliverables:
- Typescript-first mode (
--typescriptflag). - Unit testing setup (Jest + Supertest).
- Error-handling middleware.
- Command-line help/docs (
type-3 --help). - ESM & CommonJS support.
- Performance optimizations (Compression, Helmet, PM2-ready configurations).
- Typescript-first mode (
- Release Plan:
- v1.0 Stable Release 🚀
- Community adoption and early contributor onboarding.
🌟 Phase 3: Developer Productivity & Scalability Features (v2.0 - Advanced Features)
- Focus: Advanced Features for Scalability and Productivity
- Key Deliverables:
- Database model generator:
type-3 generate model <name>. - Auto API documentation (Swagger/OpenAPI integration).
- Middleware generator:
type-3 generate middleware <name>. - Role-based Access Control (RBAC) template.
- Background job support (BullMQ integration).
- CLI-based authentication setup (
--auth=jwt/--auth=oauthoptions).
- Database model generator:
- Release Plan:
- v2.0 release with database models & API docs.
- Extend testing capabilities.
- Create interactive CLI prompts.
🔥 Phase 4: Advanced Automation & Deployment Features (v3.0 - Enterprise Ready)
- Focus: Enterprise-Grade Features and Automation
- Key Deliverables:
- Multi-tenancy support.
- Microservices-ready scaffolding.
- GraphQL integration option.
- CI/CD pipeline generator:
type-3 setup ci --github-actions. - Auto Dockerfile & Kubernetes configs:
type-3 setup docker. - Plugin System:
type-3 add plugin <name>.
- Release Plan:
- Establish Type-3 as the industry standard for Express app generation.
- Open-source contribution expansion.
Overall Timeline
| Phase | Version | Timeline | |--------------------------|--------------|--------------------| | Beta Release | v0.x | Q1 2025 | | Stable v1.0 | v1.0 | Q2 2025 | | Advanced Features | v2.0 | Q3 2025 | | Enterprise Readiness | v3.0 | Q4 2025 |
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
- Inspired by tools like Express Generator and NestJS CLI.
- Built with ❤️ using Node.js and JavaScript.
Contact
For questions or feedback, feel free to reach out:
- GitHub: @vihangamallawaarachchi2001
- Email: [email protected]
