@sundaysf/cli-v2 0.0.4 → 1.0.1
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.
- package/README.md +178 -178
- package/dist/README.md +178 -178
- package/dist/bin/generators/class.js.map +1 -1
- package/dist/bin/generators/postman.js.map +1 -1
- package/dist/bin/index.js.map +1 -1
- package/dist/templates/backend/.env.example +13 -13
- package/dist/templates/backend/.prettierignore +2 -2
- package/dist/templates/backend/Dockerfile +14 -14
- package/dist/templates/backend/README.md +18 -18
- package/dist/templates/backend/src/app.ts +34 -34
- package/dist/templates/backend/src/common/utils/environment.resolver.ts +3 -3
- package/dist/templates/backend/src/common/utils/version.resolver.ts +4 -4
- package/dist/templates/backend/src/controllers/health/health.controller.ts +23 -23
- package/dist/templates/backend/src/routes/health/health.router.ts +16 -16
- package/dist/templates/backend/src/routes/index.ts +57 -57
- package/dist/templates/backend/src/server.ts +16 -16
- package/dist/templates/backend/src/types.d.ts +10 -10
- package/dist/templates/backend-db-sql/.env.example +14 -13
- package/dist/templates/backend-db-sql/.prettierignore +2 -2
- package/dist/templates/backend-db-sql/Dockerfile +17 -17
- package/dist/templates/backend-db-sql/README.md +34 -34
- package/dist/templates/backend-db-sql/db/knexfile.ts +33 -33
- package/dist/templates/backend-db-sql/db/migrations/001_create_sundays_package_version.ts +12 -12
- package/dist/templates/backend-db-sql/db/seeds/001_sundays_package_version_seed.ts +10 -10
- package/dist/templates/backend-db-sql/db/src/KnexConnection.ts +74 -74
- package/dist/templates/backend-db-sql/db/src/d.types.ts +18 -18
- package/dist/templates/backend-db-sql/db/src/dao/sundays-package-version/sundays-package-version.dao.ts +71 -71
- package/dist/templates/backend-db-sql/db/src/index.ts +9 -9
- package/dist/templates/backend-db-sql/db/src/interfaces/sundays-package-version/sundays-package-version.interfaces.ts +6 -6
- package/dist/templates/backend-db-sql/db/tsconfig.json +16 -16
- package/dist/templates/backend-db-sql/src/app.ts +34 -34
- package/dist/templates/backend-db-sql/src/common/utils/environment.resolver.ts +3 -3
- package/dist/templates/backend-db-sql/src/common/utils/version.resolver.ts +4 -4
- package/dist/templates/backend-db-sql/src/controllers/health/health.controller.ts +23 -23
- package/dist/templates/backend-db-sql/src/routes/health/health.router.ts +16 -16
- package/dist/templates/backend-db-sql/src/routes/index.ts +57 -57
- package/dist/templates/backend-db-sql/src/server.ts +18 -18
- package/dist/templates/backend-db-sql/src/types.d.ts +10 -10
- package/dist/templates/db-sql/knexfile.ts +33 -33
- package/dist/templates/db-sql/migrations/001_create_sundays_package_version.ts +12 -12
- package/dist/templates/db-sql/seeds/001_sundays_package_version_seed.ts +10 -10
- package/dist/templates/db-sql/src/KnexConnection.ts +74 -74
- package/dist/templates/db-sql/src/d.types.ts +18 -18
- package/dist/templates/db-sql/src/dao/sundays-package-version/sundays-package-version.dao.ts +71 -71
- package/dist/templates/db-sql/src/index.ts +9 -9
- package/dist/templates/db-sql/src/interfaces/sundays-package-version/sundays-package-version.interfaces.ts +6 -6
- package/dist/templates/db-sql/tsconfig.json +16 -16
- package/dist/templates/module/CLAUDE.md +158 -158
- package/dist/templates/module/tsconfig.json +19 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
# 🚀 Sundays Framework - The Backend Architect's Dream
|
|
2
|
-
|
|
3
|
-
> *"Why waste weekdays struggling with boilerplate when you can build like it's Sunday?"* - Paul Sundays
|
|
4
|
-
|
|
5
|
-
Welcome to **Sundays Framework**, where backend development meets architectural elegance. Created by Paul Sundays, your personal backend architect, this framework transforms the way you build scalable, production-ready applications.
|
|
6
|
-
|
|
7
|
-
## 🌟 Why Sundays Framework?
|
|
8
|
-
|
|
9
|
-
In a world of complex setups and endless configurations, Sundays Framework stands as your beacon of simplicity and power. We believe that great architecture shouldn't require a PhD to implement. That's why we've crafted every line of code with love, ensuring you spend less time configuring and more time creating.
|
|
10
|
-
|
|
11
|
-
### ✨ Features That Make Every Day Feel Like Sunday
|
|
12
|
-
|
|
13
|
-
- **🏗️ Zero-Config Architecture**: Start building in seconds, not hours
|
|
14
|
-
- **🎯 Type-Safe Everything**: TypeScript-first approach for bulletproof code
|
|
15
|
-
- **⚡ Lightning Fast Setup**: From zero to API in under 60 seconds
|
|
16
|
-
- **🔧 Smart Code Generation**: Controllers, routes, and DAOs created automagically
|
|
17
|
-
- **📦 Production-Ready**: Docker, migrations, and best practices out of the box
|
|
18
|
-
- **🎨 Clean Code Philosophy**: Because beautiful code is maintainable code
|
|
19
|
-
|
|
20
|
-
## 🎯 Quick Start - Your Sunday Begins Now
|
|
21
|
-
|
|
22
|
-
Paul Sundays here! Let me guide you through the smoothest setup experience you've ever had. Choose your adventure:
|
|
23
|
-
|
|
24
|
-
### 🏃♂️ Backend API Template
|
|
25
|
-
```bash
|
|
26
|
-
npx @sundaysf/cli --init --backend
|
|
27
|
-
```
|
|
28
|
-
*Perfect for REST APIs, microservices, and full-stack backends*
|
|
29
|
-
|
|
30
|
-
### 🗄️ Database SQL Module
|
|
31
|
-
```bash
|
|
32
|
-
npx @sundaysf/cli --init --db-sql
|
|
33
|
-
```
|
|
34
|
-
*Ideal for database layers with Knex.js, migrations, and seeds*
|
|
35
|
-
|
|
36
|
-
### 📦 Basic Module Template
|
|
37
|
-
```bash
|
|
38
|
-
npx @sundaysf/cli --init --module
|
|
39
|
-
```
|
|
40
|
-
*Great for npm packages and shared libraries*
|
|
41
|
-
|
|
42
|
-
> **Pro tip from Paul**: Each template comes pre-configured with everything you need. No more "how do I structure this?" moments!
|
|
43
|
-
## ⚙️ Configuration - Set It and Forget It
|
|
44
|
-
|
|
45
|
-
After initialization, you'll find a `.env.example` file. Simply:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
cp .env.example .env
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Customize your environment variables, and you're ready to rock! The framework handles the rest with sensible defaults.
|
|
52
|
-
|
|
53
|
-
## 🎨 Magic Controller Generation
|
|
54
|
-
|
|
55
|
-
Watch as Paul Sundays works his magic! Need a new feature? Let's create a controller with all CRUD operations in seconds:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm run create:controller
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### What You Get:
|
|
62
|
-
- ✅ **Full CRUD Operations**: GET, GET by UUID, CREATE, UPDATE, DELETE
|
|
63
|
-
- ✅ **Type-Safe Routes**: Automatically generated with proper TypeScript types
|
|
64
|
-
- ✅ **Postman Collection**: API documentation generated on the fly
|
|
65
|
-
- ✅ **Best Practices**: Error handling, validation, and clean architecture
|
|
66
|
-
|
|
67
|
-
> **Paul's Secret**: Each controller follows the same battle-tested patterns I've refined over years of Sunday coding sessions!
|
|
68
|
-
|
|
69
|
-
## 🛠️ Development Commands - Your Sunday Toolkit
|
|
70
|
-
|
|
71
|
-
### 🔥 Development Mode
|
|
72
|
-
```bash
|
|
73
|
-
npm run start:dev
|
|
74
|
-
```
|
|
75
|
-
*Hot-reloading enabled! Code like the wind, see changes instantly.*
|
|
76
|
-
|
|
77
|
-
### 🏗️ Build for Production
|
|
78
|
-
```bash
|
|
79
|
-
npm run build
|
|
80
|
-
```
|
|
81
|
-
*TypeScript → JavaScript transformation with optimization magic.*
|
|
82
|
-
|
|
83
|
-
### 🚀 Production Server
|
|
84
|
-
```bash
|
|
85
|
-
npm run start
|
|
86
|
-
```
|
|
87
|
-
*Battle-tested, production-ready, and blazing fast.*
|
|
88
|
-
|
|
89
|
-
### 🗄️ Database Commands (db-sql template)
|
|
90
|
-
```bash
|
|
91
|
-
npm run migrate:create # Create a new migration
|
|
92
|
-
npm run migrate:deploy # Run pending migrations
|
|
93
|
-
npm run seed:create # Create a new seed file
|
|
94
|
-
npm run seed:run # Populate your database
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### 🎯 Code Quality
|
|
98
|
-
```bash
|
|
99
|
-
npm run format # Prettier auto-formatting
|
|
100
|
-
npm run lint # ESLint code analysis
|
|
101
|
-
npm test # Run your test suite
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## 🐳 Docker Support - Ship It Like a Pro
|
|
105
|
-
|
|
106
|
-
Paul Sundays believes in shipping with confidence. That's why every backend template includes a production-ready Dockerfile!
|
|
107
|
-
|
|
108
|
-
### 📦 Build Your Container
|
|
109
|
-
```bash
|
|
110
|
-
docker build -t my-sunday-api .
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### 🚢 Launch to the Cloud
|
|
114
|
-
```bash
|
|
115
|
-
docker run -p 3098:3098 my-sunday-api
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### 🎯 Docker Compose Ready
|
|
119
|
-
```yaml
|
|
120
|
-
version: '3.8'
|
|
121
|
-
services:
|
|
122
|
-
api:
|
|
123
|
-
build: .
|
|
124
|
-
ports:
|
|
125
|
-
- "3098:3098"
|
|
126
|
-
environment:
|
|
127
|
-
- NODE_ENV=production
|
|
128
|
-
volumes:
|
|
129
|
-
- ./logs:/app/logs
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## 🏗️ Project Structure - Organized Like Sunday Brunch
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
your-project/
|
|
136
|
-
├── src/
|
|
137
|
-
│ ├── controllers/ # Your business logic lives here
|
|
138
|
-
│ ├── routes/ # RESTful route definitions
|
|
139
|
-
│ ├── services/ # Reusable service layer
|
|
140
|
-
│ ├── middlewares/ # Express middleware magic
|
|
141
|
-
│ ├── dao/ # Data Access Objects (db-sql)
|
|
142
|
-
│ └── interfaces/ # TypeScript interfaces
|
|
143
|
-
├── migrations/ # Database evolution scripts
|
|
144
|
-
├── seeds/ # Sample data for development
|
|
145
|
-
├── dist/ # Compiled production code
|
|
146
|
-
└── postman.json # Auto-generated API docs
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## 🎓 Philosophy - The Sunday Way
|
|
150
|
-
|
|
151
|
-
**"Code on Sundays, Deploy on Mondays"**
|
|
152
|
-
|
|
153
|
-
We believe that:
|
|
154
|
-
- 🌟 **Simplicity is the ultimate sophistication**
|
|
155
|
-
- 🎯 **Convention over configuration saves lives**
|
|
156
|
-
- 🚀 **Developer experience is user experience**
|
|
157
|
-
- 💪 **Great frameworks empower, not constrain**
|
|
158
|
-
|
|
159
|
-
## 🤝 Join the Sunday Revolution
|
|
160
|
-
|
|
161
|
-
Created with ❤️ by Paul Sundays, your backend architect who believes every developer deserves tools that spark joy.
|
|
162
|
-
|
|
163
|
-
### 🌐 Connect with Paul
|
|
164
|
-
- 📧 Feedback: Create an issue and let's make Sundays even better!
|
|
165
|
-
- 🐛 Found a bug? You've discovered a weekday trying to sneak in!
|
|
166
|
-
- 💡 Have an idea? Sunday brainstorming sessions are the best!
|
|
167
|
-
|
|
168
|
-
## 📜 License
|
|
169
|
-
|
|
170
|
-
MIT License - Because Sundays are meant to be free!
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
*Remember: When you code with Sundays Framework, every day feels like the weekend. Now go build something amazing!*
|
|
175
|
-
|
|
176
|
-
**Happy Sunday Coding! 🎉**
|
|
177
|
-
|
|
178
|
-
*- Paul Sundays, Your Backend Architect*
|
|
1
|
+
# 🚀 Sundays Framework - The Backend Architect's Dream
|
|
2
|
+
|
|
3
|
+
> *"Why waste weekdays struggling with boilerplate when you can build like it's Sunday?"* - Paul Sundays
|
|
4
|
+
|
|
5
|
+
Welcome to **Sundays Framework**, where backend development meets architectural elegance. Created by Paul Sundays, your personal backend architect, this framework transforms the way you build scalable, production-ready applications.
|
|
6
|
+
|
|
7
|
+
## 🌟 Why Sundays Framework?
|
|
8
|
+
|
|
9
|
+
In a world of complex setups and endless configurations, Sundays Framework stands as your beacon of simplicity and power. We believe that great architecture shouldn't require a PhD to implement. That's why we've crafted every line of code with love, ensuring you spend less time configuring and more time creating.
|
|
10
|
+
|
|
11
|
+
### ✨ Features That Make Every Day Feel Like Sunday
|
|
12
|
+
|
|
13
|
+
- **🏗️ Zero-Config Architecture**: Start building in seconds, not hours
|
|
14
|
+
- **🎯 Type-Safe Everything**: TypeScript-first approach for bulletproof code
|
|
15
|
+
- **⚡ Lightning Fast Setup**: From zero to API in under 60 seconds
|
|
16
|
+
- **🔧 Smart Code Generation**: Controllers, routes, and DAOs created automagically
|
|
17
|
+
- **📦 Production-Ready**: Docker, migrations, and best practices out of the box
|
|
18
|
+
- **🎨 Clean Code Philosophy**: Because beautiful code is maintainable code
|
|
19
|
+
|
|
20
|
+
## 🎯 Quick Start - Your Sunday Begins Now
|
|
21
|
+
|
|
22
|
+
Paul Sundays here! Let me guide you through the smoothest setup experience you've ever had. Choose your adventure:
|
|
23
|
+
|
|
24
|
+
### 🏃♂️ Backend API Template
|
|
25
|
+
```bash
|
|
26
|
+
npx @sundaysf/cli --init --backend
|
|
27
|
+
```
|
|
28
|
+
*Perfect for REST APIs, microservices, and full-stack backends*
|
|
29
|
+
|
|
30
|
+
### 🗄️ Database SQL Module
|
|
31
|
+
```bash
|
|
32
|
+
npx @sundaysf/cli --init --db-sql
|
|
33
|
+
```
|
|
34
|
+
*Ideal for database layers with Knex.js, migrations, and seeds*
|
|
35
|
+
|
|
36
|
+
### 📦 Basic Module Template
|
|
37
|
+
```bash
|
|
38
|
+
npx @sundaysf/cli --init --module
|
|
39
|
+
```
|
|
40
|
+
*Great for npm packages and shared libraries*
|
|
41
|
+
|
|
42
|
+
> **Pro tip from Paul**: Each template comes pre-configured with everything you need. No more "how do I structure this?" moments!
|
|
43
|
+
## ⚙️ Configuration - Set It and Forget It
|
|
44
|
+
|
|
45
|
+
After initialization, you'll find a `.env.example` file. Simply:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cp .env.example .env
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Customize your environment variables, and you're ready to rock! The framework handles the rest with sensible defaults.
|
|
52
|
+
|
|
53
|
+
## 🎨 Magic Controller Generation
|
|
54
|
+
|
|
55
|
+
Watch as Paul Sundays works his magic! Need a new feature? Let's create a controller with all CRUD operations in seconds:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm run create:controller
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### What You Get:
|
|
62
|
+
- ✅ **Full CRUD Operations**: GET, GET by UUID, CREATE, UPDATE, DELETE
|
|
63
|
+
- ✅ **Type-Safe Routes**: Automatically generated with proper TypeScript types
|
|
64
|
+
- ✅ **Postman Collection**: API documentation generated on the fly
|
|
65
|
+
- ✅ **Best Practices**: Error handling, validation, and clean architecture
|
|
66
|
+
|
|
67
|
+
> **Paul's Secret**: Each controller follows the same battle-tested patterns I've refined over years of Sunday coding sessions!
|
|
68
|
+
|
|
69
|
+
## 🛠️ Development Commands - Your Sunday Toolkit
|
|
70
|
+
|
|
71
|
+
### 🔥 Development Mode
|
|
72
|
+
```bash
|
|
73
|
+
npm run start:dev
|
|
74
|
+
```
|
|
75
|
+
*Hot-reloading enabled! Code like the wind, see changes instantly.*
|
|
76
|
+
|
|
77
|
+
### 🏗️ Build for Production
|
|
78
|
+
```bash
|
|
79
|
+
npm run build
|
|
80
|
+
```
|
|
81
|
+
*TypeScript → JavaScript transformation with optimization magic.*
|
|
82
|
+
|
|
83
|
+
### 🚀 Production Server
|
|
84
|
+
```bash
|
|
85
|
+
npm run start
|
|
86
|
+
```
|
|
87
|
+
*Battle-tested, production-ready, and blazing fast.*
|
|
88
|
+
|
|
89
|
+
### 🗄️ Database Commands (db-sql template)
|
|
90
|
+
```bash
|
|
91
|
+
npm run migrate:create # Create a new migration
|
|
92
|
+
npm run migrate:deploy # Run pending migrations
|
|
93
|
+
npm run seed:create # Create a new seed file
|
|
94
|
+
npm run seed:run # Populate your database
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 🎯 Code Quality
|
|
98
|
+
```bash
|
|
99
|
+
npm run format # Prettier auto-formatting
|
|
100
|
+
npm run lint # ESLint code analysis
|
|
101
|
+
npm test # Run your test suite
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 🐳 Docker Support - Ship It Like a Pro
|
|
105
|
+
|
|
106
|
+
Paul Sundays believes in shipping with confidence. That's why every backend template includes a production-ready Dockerfile!
|
|
107
|
+
|
|
108
|
+
### 📦 Build Your Container
|
|
109
|
+
```bash
|
|
110
|
+
docker build -t my-sunday-api .
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 🚢 Launch to the Cloud
|
|
114
|
+
```bash
|
|
115
|
+
docker run -p 3098:3098 my-sunday-api
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 🎯 Docker Compose Ready
|
|
119
|
+
```yaml
|
|
120
|
+
version: '3.8'
|
|
121
|
+
services:
|
|
122
|
+
api:
|
|
123
|
+
build: .
|
|
124
|
+
ports:
|
|
125
|
+
- "3098:3098"
|
|
126
|
+
environment:
|
|
127
|
+
- NODE_ENV=production
|
|
128
|
+
volumes:
|
|
129
|
+
- ./logs:/app/logs
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 🏗️ Project Structure - Organized Like Sunday Brunch
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
your-project/
|
|
136
|
+
├── src/
|
|
137
|
+
│ ├── controllers/ # Your business logic lives here
|
|
138
|
+
│ ├── routes/ # RESTful route definitions
|
|
139
|
+
│ ├── services/ # Reusable service layer
|
|
140
|
+
│ ├── middlewares/ # Express middleware magic
|
|
141
|
+
│ ├── dao/ # Data Access Objects (db-sql)
|
|
142
|
+
│ └── interfaces/ # TypeScript interfaces
|
|
143
|
+
├── migrations/ # Database evolution scripts
|
|
144
|
+
├── seeds/ # Sample data for development
|
|
145
|
+
├── dist/ # Compiled production code
|
|
146
|
+
└── postman.json # Auto-generated API docs
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 🎓 Philosophy - The Sunday Way
|
|
150
|
+
|
|
151
|
+
**"Code on Sundays, Deploy on Mondays"**
|
|
152
|
+
|
|
153
|
+
We believe that:
|
|
154
|
+
- 🌟 **Simplicity is the ultimate sophistication**
|
|
155
|
+
- 🎯 **Convention over configuration saves lives**
|
|
156
|
+
- 🚀 **Developer experience is user experience**
|
|
157
|
+
- 💪 **Great frameworks empower, not constrain**
|
|
158
|
+
|
|
159
|
+
## 🤝 Join the Sunday Revolution
|
|
160
|
+
|
|
161
|
+
Created with ❤️ by Paul Sundays, your backend architect who believes every developer deserves tools that spark joy.
|
|
162
|
+
|
|
163
|
+
### 🌐 Connect with Paul
|
|
164
|
+
- 📧 Feedback: Create an issue and let's make Sundays even better!
|
|
165
|
+
- 🐛 Found a bug? You've discovered a weekday trying to sneak in!
|
|
166
|
+
- 💡 Have an idea? Sunday brainstorming sessions are the best!
|
|
167
|
+
|
|
168
|
+
## 📜 License
|
|
169
|
+
|
|
170
|
+
MIT License - Because Sundays are meant to be free!
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
*Remember: When you code with Sundays Framework, every day feels like the weekend. Now go build something amazing!*
|
|
175
|
+
|
|
176
|
+
**Happy Sunday Coding! 🎉**
|
|
177
|
+
|
|
178
|
+
*- Paul Sundays, Your Backend Architect*
|