create-forgeapi
v1.1.0
Published
CLI scaffold for ForgeAPI — Express + TypeScript + MongoDB + Zod + Swagger base project
Maintainers
Readme
create-forgeapi
🔨 CLI scaffold untuk ForgeAPI — base project Express + TypeScript + MongoDB + Zod + Swagger
Usage
Via npm (jika di-publish)
npx create-forgeapi my-projectVia GitHub (tanpa publish ke npm) ✅
npx github:username/create-forgeapi my-projectGanti
usernamedengan GitHub username kamu. Bisa dipakai dari PC manapun tanpa perlu publish ke npm.
Opsi tambahan
# Skip semua prompt, pakai nilai default
npx create-forgeapi my-project --yes
# Skip cek versi terbaru (mode offline)
npx create-forgeapi my-project --no-fetchFitur CLI
- ✅ Auto-fetch versi terbaru semua dependency dari npm registry saat generate
- 🔔 Notifikasi package mana saja yang ada update
- 🌿
git init+ initial commit otomatis - 📦
npm installotomatis (opsional) - 🔒
.envdibuat otomatis dari.env.example
Yang didapat
my-project/
├── src/
│ ├── api/ # Controllers & Middlewares
│ ├── base/ # BaseRepository, BaseResponse, BaseSchema
│ ├── config/ # Route, Swagger, Logger, ENV config
│ ├── core/ # Server, Exceptions, Repositories, Services
│ ├── database/ # MongoDB connection, Builder, Entities
│ └── shared/ # Decorators, Interfaces, Models, Utils
├── .env # Konfigurasi environment (auto-generated)
├── .env.example
├── nodemon.json
├── tsconfig.json
└── package.json # Versi dependency selalu terbaruStack
| | | |---|---| | Framework | Express 5 | | Language | TypeScript 5 | | Database | MongoDB (Mongoose) | | Validation | Zod | | Auth | JWT | | Docs | Swagger UI | | Logger | Custom (file + console) |
Next steps setelah scaffold
cd my-project
# Edit .env — isi MONGO_DB_URL dan JWT_SECRET
npm run devSwagger tersedia di http://localhost:3000/api-docs
Cara update template
Cukup update file di folder template/ atau bin/index.ts di repo GitHub ini,
lalu semua orang yang menjalankan npx github:username/create-forgeapi akan
otomatis mendapat versi terbaru.
