micro-service-maker 1.1.2 โ†’ 1.1.4

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 +121 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # ๐Ÿš€ Project architecture
2
+
3
+ This monorepo serves as the main entry point and controller for all microservices under a single gateway. It uses TypeScript, Express, and custom tooling to streamline development.
4
+
5
+ ---
6
+
7
+ ## ๐Ÿ“ Project Structure
8
+
9
+ ```
10
+ microservice/
11
+ โ”œโ”€โ”€ services/
12
+ โ”‚ โ””โ”€โ”€ gateway/ # Main gateway application
13
+ โ”œโ”€โ”€ src/
14
+ โ”‚ โ”œโ”€โ”€ app.ts # Configurations of concurrently running services
15
+ โ”‚ โ”œโ”€โ”€ servers.json # List of all services
16
+ โ”‚ โ”œโ”€โ”€ install-all.ts # Installs all services' dependencies
17
+ โ”‚ โ””โ”€โ”€ uninstall-all.ts # Removes all services' node_modules
18
+ โ”œโ”€โ”€ dist/ # Compiled JavaScript
19
+ โ”œโ”€โ”€ package.json
20
+ โ””โ”€โ”€ tsconfig.json
21
+ ```
22
+
23
+ ---
24
+
25
+ ## ๐Ÿ“ฆ Scripts
26
+
27
+ | Command | Description |
28
+ |--------|-------------|
29
+ | `npx msm` | ๐Ÿ”ง Create a new service inside the `services/` folder. You will be prompted to enter a service name. |
30
+ | `npm run install-all` | ๐Ÿ“ฆ Installs dependencies in all services by running. |
31
+ | `npm run uninstall-all` | โŒ Deletes `node_modules` from each service folder. |
32
+ | `npm run dev` | ๐Ÿ› ๏ธ Runs the gateway in development mode using `ts-node-dev`. |
33
+
34
+ ---
35
+
36
+ ## ๐Ÿงฐ Tech Stack
37
+
38
+ - **Node.js**
39
+ - **Express.js**
40
+ - **TypeScript**
41
+ - **Mongoose**
42
+ - **ts-node-dev**
43
+ - **CMP (Service Generator)**
44
+
45
+ ---
46
+
47
+ ## ๐Ÿงช Creating a New Service
48
+
49
+ To scaffold a new microservice:
50
+
51
+ ```bash
52
+ npx cmp
53
+ ```
54
+
55
+ ๐Ÿ‘‰ Then type the desired **service name** when prompted.
56
+ ๐Ÿ“ The new service will be generated automatically inside the `services/` folder.
57
+
58
+ ---
59
+
60
+ ## ๐Ÿณ Docker Compose
61
+
62
+ This project comes with built-in support for Redis and RabbitMQ using Docker Compose.
63
+
64
+ ### `docker-compose.yml`
65
+
66
+ ```yaml
67
+ version: '3.9'
68
+
69
+ services:
70
+ redis:
71
+ image: redis:7-alpine
72
+ container_name: redis
73
+ restart: unless-stopped
74
+ ports:
75
+ - "6379:6379"
76
+ volumes:
77
+ - redis_data:/data
78
+
79
+ rabbitmq:
80
+ image: rabbitmq:3-management
81
+ container_name: rabbitmq
82
+ restart: unless-stopped
83
+ ports:
84
+ - "5672:5672"
85
+ - "15672:15672"
86
+ environment:
87
+ RABBITMQ_DEFAULT_USER: admin
88
+ RABBITMQ_DEFAULT_PASS: admin
89
+
90
+ volumes:
91
+ redis_data:
92
+ ```
93
+
94
+ To start services:
95
+
96
+ ```bash
97
+ docker-compose up -d
98
+ ```
99
+
100
+ To stop services:
101
+
102
+ ```bash
103
+ docker-compose down
104
+ ```
105
+
106
+ ---
107
+
108
+ ## ๐Ÿ“‹ Prerequisites
109
+
110
+ - Node.js `v16+`
111
+ - npm
112
+ - Docker & Docker Compose
113
+
114
+ ---
115
+
116
+ ## ๐Ÿ‘จโ€๐Ÿ’ป Maintained by
117
+
118
+ **CodingOtt Systems**
119
+ ๐Ÿ”— [Satyam Sharma](https://github.com/sharmasatyam121104-devloper)
120
+
121
+ ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micro-service-maker",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "main": "dist/app.js",
5
5
  "types": "dist/app.d.ts",
6
6
  "bin": {