@bayajidalam/apollo-cli 1.0.0 → 1.0.2

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 (2) hide show
  1. package/README.md +39 -61
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,97 +1,75 @@
1
- # Apollo CLI
1
+ # Apollo Gears CLI
2
2
 
3
- A CLI tool for scaffolding and managing Apollo backend projects (Express + TypeScript + Prisma + PostgreSQL).
3
+ A powerful CLI tool for scaffolding and managing **Apollo Gears** backend projects (Express + TypeScript + Prisma + PostgreSQL).
4
4
 
5
5
  ## Installation
6
6
 
7
- ### Global Installation
8
-
9
- To install the CLI globally:
7
+ Install the CLI globally via npm:
10
8
 
11
9
  ```bash
12
- npm install -g apollo-cli
10
+ npm install -g @bayajidalam/apollo-cli
13
11
  ```
14
12
 
15
- ### Local Development Setup
13
+ ## Usage
16
14
 
17
- If you are developing this tool locally and want to test it:
15
+ ### 1. Initialize a New Project
18
16
 
19
- 1. **Build the CLI**:
20
- ```bash
21
- npm run build
22
- ```
17
+ Create a complete backend project structure with Express, Prisma, and TypeScript configured.
23
18
 
24
- 2. **Link it globally**:
25
- ```bash
26
- npm link
27
- ```
28
- This makes the `apollo-cli` command available in your terminal.
19
+ ```bash
20
+ apollo-cli init my-new-project
21
+ ```
29
22
 
30
- ## Usage
23
+ During init, the CLI:
24
+ - Fetches the latest versions of all dependencies from npm
25
+ - Creates a `prisma/schema.prisma` file and `prisma` folder
26
+ - Lets you choose npm, yarn, or pnpm for installation
31
27
 
32
- ### 1. `generate` (alias: `g`)
28
+ ### 2. Generate Modules
33
29
 
34
- Generates a new module structure including controller, service, route, interface, validation, and constants.
30
+ Scaffold a new module (Controller, Service, Route, Interface, Validation, Constants) instantly.
35
31
 
36
- **Syntax:**
37
- ```bash
38
- apollo-cli generate module <ModuleName>
39
- # OR
40
- apollo-cli g module <ModuleName>
41
- ```
32
+ **Alias**: `g`
33
+
34
+ **Important:** You must run this command *inside* your project directory.
42
35
 
43
- **Example:**
44
- Generate a `User` module:
45
36
  ```bash
37
+ cd my-new-project
38
+ # Using full command
39
+ apollo-cli generate module User
40
+
41
+ # Using alias
46
42
  apollo-cli g module User
47
43
  ```
48
44
 
49
- This will create the following files in `src/app/modules/User`:
50
- - `user.controller.ts`
51
- - `user.service.ts`
52
- - `user.route.ts`
53
- - `user.interface.ts`
54
- - `user.validation.ts`
55
- - `user.constant.ts`
45
+ This will create `src/app/modules/User` with:
46
+ - `user.controller.ts`: Request handlers
47
+ - `user.service.ts`: Business logic
48
+ - `user.route.ts`: Express routes
49
+ - `user.interface.ts`: TypeScript interfaces
50
+ - `user.validation.ts`: Zod validation schemas
51
+ - `user.constant.ts`: Module constants
56
52
 
57
- ### 2. `build`
53
+ ### 3. Build for Production
58
54
 
59
- Builds the application for production deployment.
55
+ Builds your TypeScript application to the `dist` folder.
60
56
 
61
- **Syntax:**
62
57
  ```bash
63
58
  apollo-cli build
64
59
  ```
65
60
 
66
- **What it does:**
67
- - Cleans the `dist` folder.
68
- - Compiles TypeScript files.
69
- - Copies `package.json`, `package-lock.json`, and `.env` to the `dist` folder.
61
+ ### 4. Prisma Utilities
70
62
 
71
- ### 3. `prisma`
63
+ Convenient wrappers for common Prisma commands.
72
64
 
73
- Helper commands for Prisma ORM.
74
-
75
- **Generate Client:**
76
65
  ```bash
66
+ # Generate Prisma Client (runs: npx prisma generate)
77
67
  apollo-cli prisma generate
78
- ```
79
- *(Runs `npx prisma generate`)*
80
68
 
81
- **Run Migrations:**
82
- ```bash
69
+ # Run Migrations (runs: npx prisma migrate dev)
83
70
  apollo-cli prisma migrate
84
71
  ```
85
- *(Runs `npx prisma migrate dev`)*
86
-
87
- ## Development
88
72
 
89
- To run the CLI directly from source without building:
73
+ ## License
90
74
 
91
- ```bash
92
- npx ts-node src/bin/index.ts <command>
93
- ```
94
- Example:
95
- ```bash
96
- npx ts-node src/bin/index.ts generate module Product
97
- ```
75
+ ISC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bayajidalam/apollo-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "CLI tool for speed up backend projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,4 +44,4 @@
44
44
  "ts-node": "^10.9.2",
45
45
  "typescript": "^5.7.3"
46
46
  }
47
- }
47
+ }