dhruvkit 0.1.0__tar.gz
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.
- dhruvkit-0.1.0/LICENSE +2 -0
- dhruvkit-0.1.0/PKG-INFO +353 -0
- dhruvkit-0.1.0/README.md +312 -0
- dhruvkit-0.1.0/pyproject.toml +81 -0
- dhruvkit-0.1.0/src/dhruvkit/commands/README.md +85 -0
- dhruvkit-0.1.0/src/dhruvkit/commands/__init__.py +12 -0
- dhruvkit-0.1.0/src/dhruvkit/commands/add.py +74 -0
- dhruvkit-0.1.0/src/dhruvkit/commands/docs.py +147 -0
- dhruvkit-0.1.0/src/dhruvkit/commands/init.py +96 -0
- dhruvkit-0.1.0/src/dhruvkit/commands/new.py +111 -0
- dhruvkit-0.1.0/src/dhruvkit/license_templates/README.md +65 -0
- dhruvkit-0.1.0/src/dhruvkit/license_templates/apache.md +203 -0
- dhruvkit-0.1.0/src/dhruvkit/license_templates/bsd.md +28 -0
- dhruvkit-0.1.0/src/dhruvkit/license_templates/cc.md +121 -0
- dhruvkit-0.1.0/src/dhruvkit/license_templates/gpl.md +339 -0
- dhruvkit-0.1.0/src/dhruvkit/license_templates/mit.md +21 -0
- dhruvkit-0.1.0/src/dhruvkit/license_templates/unlicense.md +24 -0
- dhruvkit-0.1.0/src/dhruvkit/templates/README.md +211 -0
- dhruvkit-0.1.0/src/dhruvkit/templates/__init__.py +38 -0
- dhruvkit-0.1.0/src/dhruvkit/templates/basic.py +65 -0
- dhruvkit-0.1.0/src/dhruvkit/templates/fastapi.py +1327 -0
- dhruvkit-0.1.0/src/dhruvkit/templates/flask.py +90 -0
dhruvkit-0.1.0/LICENSE
ADDED
dhruvkit-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dhruvkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A powerful Python scaffolding toolkit for rapid project creation with intelligent template system, modular add-ons, and beautiful CLI interface.
|
|
5
|
+
Project-URL: Homepage, https://github.com/dhruvgarg001/dhruvkit
|
|
6
|
+
Project-URL: Repository, https://github.com/dhruvgarg001/dhruvkit
|
|
7
|
+
Project-URL: Issues, https://github.com/dhruvgarg001/dhruvkit/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/dhruvgarg001/dhruvkit
|
|
9
|
+
Author-email: Dhruv Garg <dhruvgarg2025@gmail.com>
|
|
10
|
+
License: GNU GENERAL PUBLIC LICENSE
|
|
11
|
+
Version 2, June 1991
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: addons,boilerplate,cli,fastapi,firebase,flask,mongodb,project-generator,scaffolding,template
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Requires-Dist: python-decouple>=3.8
|
|
30
|
+
Requires-Dist: rich>=13.0.0
|
|
31
|
+
Provides-Extra: fastapi
|
|
32
|
+
Requires-Dist: fastapi; extra == 'fastapi'
|
|
33
|
+
Requires-Dist: uvicorn; extra == 'fastapi'
|
|
34
|
+
Provides-Extra: firebase
|
|
35
|
+
Requires-Dist: firebase-admin; extra == 'firebase'
|
|
36
|
+
Provides-Extra: flask
|
|
37
|
+
Requires-Dist: flask; extra == 'flask'
|
|
38
|
+
Provides-Extra: mongodb
|
|
39
|
+
Requires-Dist: pymongo; extra == 'mongodb'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# 🚀 DhruvKit
|
|
43
|
+
|
|
44
|
+
> A powerful Python scaffolding toolkit for rapid project creation with intelligent template system, modular add-ons, and beautiful CLI interface.
|
|
45
|
+
|
|
46
|
+
[](https://pypi.org/project/dhruvkit/)
|
|
47
|
+
[](https://pepy.tech/project/dhruvkit)
|
|
48
|
+
[](https://www.python.org/downloads/)
|
|
49
|
+
[](LICENSE)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
<div align="center">
|
|
54
|
+
|
|
55
|
+
### 🎯 Create production-ready Python projects in seconds
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install dhruvkit && dk new myproject --template fastapi --license mit
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**[Get Started](#-quick-start)** • **[View Features](#-features)** • **[Documentation](#-documentation)**
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## ✨ Features
|
|
68
|
+
|
|
69
|
+
- 🎨 **Beautiful CLI Interface** - Rich terminal output with colors, panels, and progress indicators
|
|
70
|
+
- 📦 **Smart Templates** - Pre-configured templates for FastAPI, Flask, and basic Python projects
|
|
71
|
+
- 🧩 **Modular Add-ons** - Mix and match features like MongoDB, Firebase, and security middleware
|
|
72
|
+
- 🔐 **License Support** - Generates projects with multiple license options (MIT, Apache, GPL, BSD, Unlicense, CC0)
|
|
73
|
+
- ⚡ **Intelligent Merging** - Automatically combines multiple add-ons without conflicts
|
|
74
|
+
- 🎯 **Zero configuration** - Ready to run immediately
|
|
75
|
+
- 📚 **Auto Documentation** - Generates comprehensive README and usage guides
|
|
76
|
+
|
|
77
|
+
> **📝 Note:** DhruvKit itself is licensed under GPL v2.0. Generated projects may use a different license.
|
|
78
|
+
|
|
79
|
+
## 🚄 Quick Start
|
|
80
|
+
|
|
81
|
+
### Installation
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install dhruvkit
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
> **💡 Tip:** You can use `dk` as a shorthand for `dhruvkit` in all commands!
|
|
88
|
+
|
|
89
|
+
### ⚡ Recommended Flow
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Create a full-featured app with MongoDB, Firebase, and security in one command
|
|
93
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase --secure
|
|
94
|
+
|
|
95
|
+
# Set up and run
|
|
96
|
+
cd myapp
|
|
97
|
+
pip install -r requirements.txt
|
|
98
|
+
uvicorn src.main:app --reload
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
🎉 **That's it!** You now have a production-ready FastAPI app with MongoDB, Firebase auth, and security middleware.
|
|
102
|
+
|
|
103
|
+
<details>
|
|
104
|
+
<summary><b>Install from source</b></summary>
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/dhruvgarg001/dhruvkit.git
|
|
108
|
+
cd dhruvkit
|
|
109
|
+
pip install -e .
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
</details>
|
|
113
|
+
|
|
114
|
+
<details>
|
|
115
|
+
<summary><b>Optional: Install with runtime dependencies</b></summary>
|
|
116
|
+
|
|
117
|
+
Optional: Install extras if you want to test templates locally.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# For testing FastAPI template generation
|
|
121
|
+
pip install dhruvkit[fastapi]
|
|
122
|
+
|
|
123
|
+
# For testing Flask template generation
|
|
124
|
+
pip install dhruvkit[flask]
|
|
125
|
+
|
|
126
|
+
# For testing Firebase integration
|
|
127
|
+
pip install dhruvkit[firebase]
|
|
128
|
+
|
|
129
|
+
# For testing MongoDB integration
|
|
130
|
+
pip install dhruvkit[mongodb]
|
|
131
|
+
|
|
132
|
+
# Install all extras
|
|
133
|
+
pip install dhruvkit[fastapi,flask,mongodb,firebase]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
</details>
|
|
137
|
+
|
|
138
|
+
### More Examples
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Basic FastAPI project
|
|
142
|
+
dk new myapp --template fastapi
|
|
143
|
+
|
|
144
|
+
# Flask project with MIT license
|
|
145
|
+
dk new myapp -t flask --license mit
|
|
146
|
+
|
|
147
|
+
# Initialize in current directory
|
|
148
|
+
dk init --template basic
|
|
149
|
+
|
|
150
|
+
# Add a license later
|
|
151
|
+
dk add --license apache
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 📖 Usage
|
|
155
|
+
|
|
156
|
+
### Commands
|
|
157
|
+
|
|
158
|
+
#### `new` - Create a new project
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
dhruvkit new <project_name> [--template TEMPLATE] [--license LICENSE] [addons...]
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Examples:**
|
|
165
|
+
```bash
|
|
166
|
+
dhruvkit new blog --template fastapi
|
|
167
|
+
dk new api -t fastapi --mongodb --firebase # Using short aliases
|
|
168
|
+
dhruvkit new myapp --template flask --license apache
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
#### `init` - Initialize in current directory
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
dhruvkit init [--template TEMPLATE] [--license LICENSE] [addons...]
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Examples:**
|
|
178
|
+
```bash
|
|
179
|
+
dhruvkit init --template fastapi
|
|
180
|
+
dhruvkit init --template fastapi --mongodb --secure
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### `add` - Add license to existing project
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
dhruvkit add --license LICENSE
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Examples:**
|
|
190
|
+
```bash
|
|
191
|
+
dhruvkit add --license mit
|
|
192
|
+
dhruvkit add --license apache
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### `docs` - View documentation
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
dhruvkit docs [command]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Available Templates
|
|
202
|
+
|
|
203
|
+
| Template | Description | Add-ons Available |
|
|
204
|
+
|----------|-------------|-------------------|
|
|
205
|
+
| `basic` | Minimal Python project | None |
|
|
206
|
+
| `flask` | Flask web application | None |
|
|
207
|
+
| `fastapi` | FastAPI application | mongodb, firebase, secure |
|
|
208
|
+
|
|
209
|
+
### FastAPI Add-ons
|
|
210
|
+
|
|
211
|
+
#### `--mongodb` - MongoDB Atlas Integration
|
|
212
|
+
- Complete database connection management
|
|
213
|
+
- Collection utilities and indexing
|
|
214
|
+
- Lifespan event handling
|
|
215
|
+
- Usage documentation
|
|
216
|
+
|
|
217
|
+
#### `--firebase` - Firebase Admin SDK
|
|
218
|
+
- Firebase authentication support
|
|
219
|
+
- Firestore database access
|
|
220
|
+
- Real-time database support
|
|
221
|
+
- Comprehensive integration guide
|
|
222
|
+
|
|
223
|
+
#### `--secure` - Security Middleware
|
|
224
|
+
- CORS configuration
|
|
225
|
+
- Host checking middleware
|
|
226
|
+
- Security headers (CSP, X-Frame-Options, X-Content-Type-Options)
|
|
227
|
+
- Production-ready security setup
|
|
228
|
+
|
|
229
|
+
### Mix & Match Add-ons
|
|
230
|
+
|
|
231
|
+
DhruvKit intelligently combines multiple add-ons:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# MongoDB + Firebase
|
|
235
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase
|
|
236
|
+
|
|
237
|
+
# All three add-ons together
|
|
238
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase --secure
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
The generated code automatically merges:
|
|
242
|
+
- ✅ Import statements
|
|
243
|
+
- ✅ Configuration files (.env, settings.py)
|
|
244
|
+
- ✅ Dependencies (requirements.txt)
|
|
245
|
+
- ✅ README documentation
|
|
246
|
+
- ✅ Application initialization
|
|
247
|
+
|
|
248
|
+
### Supported Licenses
|
|
249
|
+
|
|
250
|
+
- `mit` - MIT License
|
|
251
|
+
- `apache` - Apache License 2.0
|
|
252
|
+
- `gpl` - GNU General Public License v3.0
|
|
253
|
+
- `bsd` - BSD 3-Clause License
|
|
254
|
+
- `unlicense` - The Unlicense
|
|
255
|
+
- `cc` / `cc0` - Creative Commons Zero v1.0
|
|
256
|
+
|
|
257
|
+
## 🏗️ Project Structure
|
|
258
|
+
|
|
259
|
+
A typical FastAPI project with add-ons:
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
myapp/
|
|
263
|
+
├── src/
|
|
264
|
+
│ ├── database_functions/ # MongoDB utilities (if --mongodb)
|
|
265
|
+
│ │ ├── __init__.py
|
|
266
|
+
│ │ └── MongoDBConfig.py
|
|
267
|
+
│ ├── main.py # FastAPI application
|
|
268
|
+
│ ├── dbconfig.py # Database initialization (if --mongodb)
|
|
269
|
+
│ └── settings.py # Configuration
|
|
270
|
+
├── docs/ # Auto-generated documentation
|
|
271
|
+
│ ├── mongodb_usage.md
|
|
272
|
+
│ ├── firebase_usage.md
|
|
273
|
+
│ └── security_guide.md
|
|
274
|
+
├── .env # Environment variables
|
|
275
|
+
├── .gitignore
|
|
276
|
+
├── requirements.txt
|
|
277
|
+
├── LICENSE # If --license specified
|
|
278
|
+
└── README.md # Project documentation
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## 🎯 Why DhruvKit?
|
|
282
|
+
|
|
283
|
+
### Before DhruvKit
|
|
284
|
+
```bash
|
|
285
|
+
# Manual setup required
|
|
286
|
+
mkdir myapp && cd myapp
|
|
287
|
+
python -m venv .venv
|
|
288
|
+
touch main.py settings.py .env .gitignore
|
|
289
|
+
# ... write boilerplate code
|
|
290
|
+
# ... set up MongoDB connection
|
|
291
|
+
# ... configure Firebase
|
|
292
|
+
# ... add security middleware
|
|
293
|
+
# ... write documentation
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### With DhruvKit
|
|
297
|
+
```bash
|
|
298
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase --secure
|
|
299
|
+
cd myapp && pip install -r requirements.txt
|
|
300
|
+
uvicorn src.main:app --reload
|
|
301
|
+
# 🎉 Ready to code!
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## 🔧 Development
|
|
305
|
+
|
|
306
|
+
### Project Structure
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
dhruvkit/
|
|
310
|
+
├── src/
|
|
311
|
+
│ └── dhruvkit/
|
|
312
|
+
│ ├── commands/ # Command implementations
|
|
313
|
+
│ │ ├── new.py
|
|
314
|
+
│ │ ├── init.py
|
|
315
|
+
│ │ ├── add.py
|
|
316
|
+
│ │ └── docs.py
|
|
317
|
+
│ ├── templates/ # Project templates
|
|
318
|
+
│ │ ├── basic.py
|
|
319
|
+
│ │ ├── flask.py
|
|
320
|
+
│ │ └── fastapi.py
|
|
321
|
+
│ ├── license_templates/ # License files
|
|
322
|
+
│ ├── cli.py # CLI entry point
|
|
323
|
+
│ ├── licenses.py # License handler
|
|
324
|
+
│ └── utils.py # Shared utilities
|
|
325
|
+
├── tests/
|
|
326
|
+
├── pyproject.toml
|
|
327
|
+
└── README.md
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Contributing
|
|
331
|
+
|
|
332
|
+
Contributions are welcome! Feel free to:
|
|
333
|
+
- 🐛 Report bugs
|
|
334
|
+
- 💡 Suggest new features
|
|
335
|
+
- 🔧 Submit pull requests
|
|
336
|
+
- 📖 Improve documentation
|
|
337
|
+
|
|
338
|
+
## 📝 License
|
|
339
|
+
|
|
340
|
+
This project is licensed under the GNU General Public License v2.0 - see the [LICENSE](LICENSE) file for details.
|
|
341
|
+
|
|
342
|
+
## 🙏 Acknowledgments
|
|
343
|
+
|
|
344
|
+
- Built with [Rich](https://github.com/Textualize/rich) for beautiful terminal output
|
|
345
|
+
- Uses [python-decouple](https://github.com/henriquebastos/python-decouple) for environment management
|
|
346
|
+
|
|
347
|
+
## 📬 Contact
|
|
348
|
+
|
|
349
|
+
Created by [Dhruv Garg](https://www.linkedin.com/in/dhruvgarg001/)
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
<p align="center">Made with ❤️ and Python</p>
|
dhruvkit-0.1.0/README.md
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# 🚀 DhruvKit
|
|
2
|
+
|
|
3
|
+
> A powerful Python scaffolding toolkit for rapid project creation with intelligent template system, modular add-ons, and beautiful CLI interface.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/dhruvkit/)
|
|
6
|
+
[](https://pepy.tech/project/dhruvkit)
|
|
7
|
+
[](https://www.python.org/downloads/)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div align="center">
|
|
13
|
+
|
|
14
|
+
### 🎯 Create production-ready Python projects in seconds
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install dhruvkit && dk new myproject --template fastapi --license mit
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**[Get Started](#-quick-start)** • **[View Features](#-features)** • **[Documentation](#-documentation)**
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## ✨ Features
|
|
27
|
+
|
|
28
|
+
- 🎨 **Beautiful CLI Interface** - Rich terminal output with colors, panels, and progress indicators
|
|
29
|
+
- 📦 **Smart Templates** - Pre-configured templates for FastAPI, Flask, and basic Python projects
|
|
30
|
+
- 🧩 **Modular Add-ons** - Mix and match features like MongoDB, Firebase, and security middleware
|
|
31
|
+
- 🔐 **License Support** - Generates projects with multiple license options (MIT, Apache, GPL, BSD, Unlicense, CC0)
|
|
32
|
+
- ⚡ **Intelligent Merging** - Automatically combines multiple add-ons without conflicts
|
|
33
|
+
- 🎯 **Zero configuration** - Ready to run immediately
|
|
34
|
+
- 📚 **Auto Documentation** - Generates comprehensive README and usage guides
|
|
35
|
+
|
|
36
|
+
> **📝 Note:** DhruvKit itself is licensed under GPL v2.0. Generated projects may use a different license.
|
|
37
|
+
|
|
38
|
+
## 🚄 Quick Start
|
|
39
|
+
|
|
40
|
+
### Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install dhruvkit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> **💡 Tip:** You can use `dk` as a shorthand for `dhruvkit` in all commands!
|
|
47
|
+
|
|
48
|
+
### ⚡ Recommended Flow
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Create a full-featured app with MongoDB, Firebase, and security in one command
|
|
52
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase --secure
|
|
53
|
+
|
|
54
|
+
# Set up and run
|
|
55
|
+
cd myapp
|
|
56
|
+
pip install -r requirements.txt
|
|
57
|
+
uvicorn src.main:app --reload
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
🎉 **That's it!** You now have a production-ready FastAPI app with MongoDB, Firebase auth, and security middleware.
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary><b>Install from source</b></summary>
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/dhruvgarg001/dhruvkit.git
|
|
67
|
+
cd dhruvkit
|
|
68
|
+
pip install -e .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</details>
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary><b>Optional: Install with runtime dependencies</b></summary>
|
|
75
|
+
|
|
76
|
+
Optional: Install extras if you want to test templates locally.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# For testing FastAPI template generation
|
|
80
|
+
pip install dhruvkit[fastapi]
|
|
81
|
+
|
|
82
|
+
# For testing Flask template generation
|
|
83
|
+
pip install dhruvkit[flask]
|
|
84
|
+
|
|
85
|
+
# For testing Firebase integration
|
|
86
|
+
pip install dhruvkit[firebase]
|
|
87
|
+
|
|
88
|
+
# For testing MongoDB integration
|
|
89
|
+
pip install dhruvkit[mongodb]
|
|
90
|
+
|
|
91
|
+
# Install all extras
|
|
92
|
+
pip install dhruvkit[fastapi,flask,mongodb,firebase]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</details>
|
|
96
|
+
|
|
97
|
+
### More Examples
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Basic FastAPI project
|
|
101
|
+
dk new myapp --template fastapi
|
|
102
|
+
|
|
103
|
+
# Flask project with MIT license
|
|
104
|
+
dk new myapp -t flask --license mit
|
|
105
|
+
|
|
106
|
+
# Initialize in current directory
|
|
107
|
+
dk init --template basic
|
|
108
|
+
|
|
109
|
+
# Add a license later
|
|
110
|
+
dk add --license apache
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 📖 Usage
|
|
114
|
+
|
|
115
|
+
### Commands
|
|
116
|
+
|
|
117
|
+
#### `new` - Create a new project
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
dhruvkit new <project_name> [--template TEMPLATE] [--license LICENSE] [addons...]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Examples:**
|
|
124
|
+
```bash
|
|
125
|
+
dhruvkit new blog --template fastapi
|
|
126
|
+
dk new api -t fastapi --mongodb --firebase # Using short aliases
|
|
127
|
+
dhruvkit new myapp --template flask --license apache
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### `init` - Initialize in current directory
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
dhruvkit init [--template TEMPLATE] [--license LICENSE] [addons...]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Examples:**
|
|
137
|
+
```bash
|
|
138
|
+
dhruvkit init --template fastapi
|
|
139
|
+
dhruvkit init --template fastapi --mongodb --secure
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### `add` - Add license to existing project
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
dhruvkit add --license LICENSE
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Examples:**
|
|
149
|
+
```bash
|
|
150
|
+
dhruvkit add --license mit
|
|
151
|
+
dhruvkit add --license apache
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### `docs` - View documentation
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
dhruvkit docs [command]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Available Templates
|
|
161
|
+
|
|
162
|
+
| Template | Description | Add-ons Available |
|
|
163
|
+
|----------|-------------|-------------------|
|
|
164
|
+
| `basic` | Minimal Python project | None |
|
|
165
|
+
| `flask` | Flask web application | None |
|
|
166
|
+
| `fastapi` | FastAPI application | mongodb, firebase, secure |
|
|
167
|
+
|
|
168
|
+
### FastAPI Add-ons
|
|
169
|
+
|
|
170
|
+
#### `--mongodb` - MongoDB Atlas Integration
|
|
171
|
+
- Complete database connection management
|
|
172
|
+
- Collection utilities and indexing
|
|
173
|
+
- Lifespan event handling
|
|
174
|
+
- Usage documentation
|
|
175
|
+
|
|
176
|
+
#### `--firebase` - Firebase Admin SDK
|
|
177
|
+
- Firebase authentication support
|
|
178
|
+
- Firestore database access
|
|
179
|
+
- Real-time database support
|
|
180
|
+
- Comprehensive integration guide
|
|
181
|
+
|
|
182
|
+
#### `--secure` - Security Middleware
|
|
183
|
+
- CORS configuration
|
|
184
|
+
- Host checking middleware
|
|
185
|
+
- Security headers (CSP, X-Frame-Options, X-Content-Type-Options)
|
|
186
|
+
- Production-ready security setup
|
|
187
|
+
|
|
188
|
+
### Mix & Match Add-ons
|
|
189
|
+
|
|
190
|
+
DhruvKit intelligently combines multiple add-ons:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# MongoDB + Firebase
|
|
194
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase
|
|
195
|
+
|
|
196
|
+
# All three add-ons together
|
|
197
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase --secure
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
The generated code automatically merges:
|
|
201
|
+
- ✅ Import statements
|
|
202
|
+
- ✅ Configuration files (.env, settings.py)
|
|
203
|
+
- ✅ Dependencies (requirements.txt)
|
|
204
|
+
- ✅ README documentation
|
|
205
|
+
- ✅ Application initialization
|
|
206
|
+
|
|
207
|
+
### Supported Licenses
|
|
208
|
+
|
|
209
|
+
- `mit` - MIT License
|
|
210
|
+
- `apache` - Apache License 2.0
|
|
211
|
+
- `gpl` - GNU General Public License v3.0
|
|
212
|
+
- `bsd` - BSD 3-Clause License
|
|
213
|
+
- `unlicense` - The Unlicense
|
|
214
|
+
- `cc` / `cc0` - Creative Commons Zero v1.0
|
|
215
|
+
|
|
216
|
+
## 🏗️ Project Structure
|
|
217
|
+
|
|
218
|
+
A typical FastAPI project with add-ons:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
myapp/
|
|
222
|
+
├── src/
|
|
223
|
+
│ ├── database_functions/ # MongoDB utilities (if --mongodb)
|
|
224
|
+
│ │ ├── __init__.py
|
|
225
|
+
│ │ └── MongoDBConfig.py
|
|
226
|
+
│ ├── main.py # FastAPI application
|
|
227
|
+
│ ├── dbconfig.py # Database initialization (if --mongodb)
|
|
228
|
+
│ └── settings.py # Configuration
|
|
229
|
+
├── docs/ # Auto-generated documentation
|
|
230
|
+
│ ├── mongodb_usage.md
|
|
231
|
+
│ ├── firebase_usage.md
|
|
232
|
+
│ └── security_guide.md
|
|
233
|
+
├── .env # Environment variables
|
|
234
|
+
├── .gitignore
|
|
235
|
+
├── requirements.txt
|
|
236
|
+
├── LICENSE # If --license specified
|
|
237
|
+
└── README.md # Project documentation
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 🎯 Why DhruvKit?
|
|
241
|
+
|
|
242
|
+
### Before DhruvKit
|
|
243
|
+
```bash
|
|
244
|
+
# Manual setup required
|
|
245
|
+
mkdir myapp && cd myapp
|
|
246
|
+
python -m venv .venv
|
|
247
|
+
touch main.py settings.py .env .gitignore
|
|
248
|
+
# ... write boilerplate code
|
|
249
|
+
# ... set up MongoDB connection
|
|
250
|
+
# ... configure Firebase
|
|
251
|
+
# ... add security middleware
|
|
252
|
+
# ... write documentation
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### With DhruvKit
|
|
256
|
+
```bash
|
|
257
|
+
dhruvkit new myapp --template fastapi --mongodb --firebase --secure
|
|
258
|
+
cd myapp && pip install -r requirements.txt
|
|
259
|
+
uvicorn src.main:app --reload
|
|
260
|
+
# 🎉 Ready to code!
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## 🔧 Development
|
|
264
|
+
|
|
265
|
+
### Project Structure
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
dhruvkit/
|
|
269
|
+
├── src/
|
|
270
|
+
│ └── dhruvkit/
|
|
271
|
+
│ ├── commands/ # Command implementations
|
|
272
|
+
│ │ ├── new.py
|
|
273
|
+
│ │ ├── init.py
|
|
274
|
+
│ │ ├── add.py
|
|
275
|
+
│ │ └── docs.py
|
|
276
|
+
│ ├── templates/ # Project templates
|
|
277
|
+
│ │ ├── basic.py
|
|
278
|
+
│ │ ├── flask.py
|
|
279
|
+
│ │ └── fastapi.py
|
|
280
|
+
│ ├── license_templates/ # License files
|
|
281
|
+
│ ├── cli.py # CLI entry point
|
|
282
|
+
│ ├── licenses.py # License handler
|
|
283
|
+
│ └── utils.py # Shared utilities
|
|
284
|
+
├── tests/
|
|
285
|
+
├── pyproject.toml
|
|
286
|
+
└── README.md
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Contributing
|
|
290
|
+
|
|
291
|
+
Contributions are welcome! Feel free to:
|
|
292
|
+
- 🐛 Report bugs
|
|
293
|
+
- 💡 Suggest new features
|
|
294
|
+
- 🔧 Submit pull requests
|
|
295
|
+
- 📖 Improve documentation
|
|
296
|
+
|
|
297
|
+
## 📝 License
|
|
298
|
+
|
|
299
|
+
This project is licensed under the GNU General Public License v2.0 - see the [LICENSE](LICENSE) file for details.
|
|
300
|
+
|
|
301
|
+
## 🙏 Acknowledgments
|
|
302
|
+
|
|
303
|
+
- Built with [Rich](https://github.com/Textualize/rich) for beautiful terminal output
|
|
304
|
+
- Uses [python-decouple](https://github.com/henriquebastos/python-decouple) for environment management
|
|
305
|
+
|
|
306
|
+
## 📬 Contact
|
|
307
|
+
|
|
308
|
+
Created by [Dhruv Garg](https://www.linkedin.com/in/dhruvgarg001/)
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
<p align="center">Made with ❤️ and Python</p>
|