shafikul-cli 2.1.2__tar.gz → 2.1.3__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.
- shafikul_cli-2.1.3/PKG-INFO +353 -0
- shafikul_cli-2.1.3/README.md +336 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/pyproject.toml +1 -1
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/main.py +18 -10
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/helper_function.py +5 -1
- shafikul_cli-2.1.3/shafikul_cli.egg-info/PKG-INFO +353 -0
- shafikul_cli-2.1.2/PKG-INFO +0 -147
- shafikul_cli-2.1.2/README.md +0 -130
- shafikul_cli-2.1.2/shafikul_cli.egg-info/PKG-INFO +0 -147
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/LICENSE +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/setup.cfg +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/__init__.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/asset/__init__.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/asset/logo.png +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/__init__.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/create_file_content.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/create_file_structure.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/create_html_file.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/ensure_db.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/ensure_main.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/env_generate.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli/utility/install_dependicy.py +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli.egg-info/SOURCES.txt +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli.egg-info/dependency_links.txt +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli.egg-info/entry_points.txt +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli.egg-info/requires.txt +0 -0
- {shafikul_cli-2.1.2 → shafikul_cli-2.1.3}/shafikul_cli.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shafikul_cli
|
|
3
|
+
Version: 2.1.3
|
|
4
|
+
Summary: CLI tool for FastAPI scaffolding with router, models, database, and templates.
|
|
5
|
+
Author-email: Md Shafikul Islam <buildwithshafikul@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/build-with-shafikul/shafikul_cli
|
|
7
|
+
Project-URL: Issues, https://github.com/build-with-shafikul/shafikul_cli/issues
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: typer
|
|
12
|
+
Requires-Dist: rich
|
|
13
|
+
Requires-Dist: keyboard
|
|
14
|
+
Requires-Dist: pyautogui
|
|
15
|
+
Requires-Dist: pyperclip
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# 🚀 Shafikul CLI
|
|
19
|
+
|
|
20
|
+
> **Lightning-fast FastAPI Project Scaffolding** — Generate production-ready boilerplate with user authentication, database models, and a complete folder structure in seconds.
|
|
21
|
+
|
|
22
|
+
<div align="center">
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+

|
|
26
|
+

|
|
27
|
+
[](https://github.com/build-with-shafikul/shafikul_cli)
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 📋 What is Shafikul CLI?
|
|
34
|
+
|
|
35
|
+
Shafikul CLI is a **command-line scaffolding tool** that generates **complete FastAPI projects** with best practices built-in. Instead of manually creating routers, models, templates, and configurations, let the CLI do it for you—instantly.
|
|
36
|
+
|
|
37
|
+
Perfect for:
|
|
38
|
+
- 🎯 **Rapid Prototyping** — Start building features, not boilerplate
|
|
39
|
+
- 👥 **User Authentication** — Pre-configured login, logout, and registration
|
|
40
|
+
- 🗄️ **Database Setup** — SQLAlchemy models, Alembic migrations, auto-generated
|
|
41
|
+
- 🎨 **Templates Ready** — Organized template structure for web routes
|
|
42
|
+
- ⚡ **Zero Config** — Works out of the box with sensible defaults
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## ✨ Features
|
|
47
|
+
|
|
48
|
+
| Feature | Status |
|
|
49
|
+
|---------|--------|
|
|
50
|
+
| 🏗️ Auto-generate FastAPI project structure | ✅ |
|
|
51
|
+
| 🔐 Built-in user authentication (login, logout, registration) | ✅ |
|
|
52
|
+
| 🗄️ SQLAlchemy models & Alembic migrations | ✅ |
|
|
53
|
+
| 🛣️ Auto-generate routers (Web & API) | ✅ |
|
|
54
|
+
| 📝 HTML templates (layouts, pages, error handling) | ✅ |
|
|
55
|
+
| ⚙️ Auto-update `main.py` and `.env` | ✅ |
|
|
56
|
+
| 🎨 CSS, JavaScript, and static assets folders | ✅ |
|
|
57
|
+
| 🧩 Interactive CLI with multiple input options | ✅ |
|
|
58
|
+
| 🌈 Colored console output | ✅ |
|
|
59
|
+
| 📦 Pip installable package | ✅ |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 📦 Installation
|
|
64
|
+
|
|
65
|
+
### From PyPI (Recommended)
|
|
66
|
+
```bash
|
|
67
|
+
pip install shafikul_cli
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### From Source (Development)
|
|
71
|
+
```bash
|
|
72
|
+
git clone https://github.com/build-with-shafikul/shafikul_cli.git
|
|
73
|
+
cd shafikul_cli
|
|
74
|
+
pip install -e .
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 🚀 Quick Start
|
|
80
|
+
|
|
81
|
+
### 1️⃣ Create a New FastAPI Project
|
|
82
|
+
```bash
|
|
83
|
+
mkdir project_name
|
|
84
|
+
shafikul_cli create app
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2️⃣ Follow the Interactive Prompts
|
|
88
|
+
The CLI will create folders, files, install dependencies, and initialize the database automatically.
|
|
89
|
+
|
|
90
|
+
### 3️⃣ Start the Development Server
|
|
91
|
+
```bash
|
|
92
|
+
python main.py
|
|
93
|
+
```
|
|
94
|
+
Then visit **`http://127.0.0.1:8000`** in your browser.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 📖 CLI Commands
|
|
99
|
+
|
|
100
|
+
### View Help
|
|
101
|
+
```bash
|
|
102
|
+
shafikul_cli --help
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Check Version
|
|
106
|
+
```bash
|
|
107
|
+
shafikul_cli --version
|
|
108
|
+
# or
|
|
109
|
+
shafikul_cli -v
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### About
|
|
113
|
+
```bash
|
|
114
|
+
shafikul_cli --about
|
|
115
|
+
# or
|
|
116
|
+
shafikul_cli -a
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Create Resources (Interactive)
|
|
120
|
+
```bash
|
|
121
|
+
shafikul_cli create app
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 📁 Project Structure
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
your-project/
|
|
130
|
+
│
|
|
131
|
+
├── 📄 main.py # FastAPI application entry point
|
|
132
|
+
├── 📄 requirements.txt # Python dependencies
|
|
133
|
+
├── 📄 .env # Environment variables (gitignored)
|
|
134
|
+
├── 📄 .env.example # Environment template
|
|
135
|
+
├── 📄 .gitignore # Git ignore rules
|
|
136
|
+
├── 📄 alembic.ini # Database migration config
|
|
137
|
+
│
|
|
138
|
+
├── 📂 app/ # Application core
|
|
139
|
+
│ ├── database.py # Database connection & session
|
|
140
|
+
│ └── models.py # SQLAlchemy ORM models
|
|
141
|
+
│
|
|
142
|
+
├── 📂 config/ # Configuration
|
|
143
|
+
│ └── app.py # App settings & constants
|
|
144
|
+
│
|
|
145
|
+
├── 📂 router/ # Route handlers
|
|
146
|
+
│ ├── web/ # Web routes (HTML responses)
|
|
147
|
+
│ │ ├── auth.py # Login, logout, register
|
|
148
|
+
│ │ ├── public.py # Public pages
|
|
149
|
+
│ │ └── error.py # Error pages
|
|
150
|
+
│ └── api/ # API routes (JSON responses)
|
|
151
|
+
│ └── users.py # User API endpoints
|
|
152
|
+
│
|
|
153
|
+
├── 📂 templates/ # Jinja2 HTML templates
|
|
154
|
+
│ ├── layouts/ # Base templates
|
|
155
|
+
│ │ ├── main.html # Main layout
|
|
156
|
+
│ │ └── auth.html # Auth layout
|
|
157
|
+
│ └── pages/ # Page templates
|
|
158
|
+
│ ├── public/ # Public pages
|
|
159
|
+
│ │ └── index.html
|
|
160
|
+
│ ├── auth/ # Auth pages
|
|
161
|
+
│ │ ├── login.html
|
|
162
|
+
│ │ └── register.html
|
|
163
|
+
│ ├── authenticated/ # Protected pages
|
|
164
|
+
│ │ └── dashboard.html
|
|
165
|
+
│ └── error/ # Error pages
|
|
166
|
+
│ └── 404.html
|
|
167
|
+
│
|
|
168
|
+
├── 📂 asset/ # Static assets
|
|
169
|
+
│ ├── css/
|
|
170
|
+
│ │ └── style.css
|
|
171
|
+
│ ├── js/
|
|
172
|
+
│ │ └── script.js
|
|
173
|
+
│ └── images/
|
|
174
|
+
│ └── icon.png
|
|
175
|
+
│
|
|
176
|
+
├── 📂 static/ # Served static files
|
|
177
|
+
│ └── images/
|
|
178
|
+
│ └── logo.png
|
|
179
|
+
│
|
|
180
|
+
├── 📂 utility/ # Helper functions
|
|
181
|
+
│ └── helper_function.py
|
|
182
|
+
│
|
|
183
|
+
├── 📂 migrations/ # Alembic migrations
|
|
184
|
+
│ ├── versions/
|
|
185
|
+
│ └── env.py
|
|
186
|
+
│
|
|
187
|
+
└── 📂 test.db # SQLite database (example)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 🔐 Authentication Features
|
|
193
|
+
|
|
194
|
+
Shafikul CLI comes with **pre-built authentication** out of the box:
|
|
195
|
+
|
|
196
|
+
### ✅ Included
|
|
197
|
+
- **User Registration** — Form validation & password hashing
|
|
198
|
+
- **User Login** — Session management with secure cookies
|
|
199
|
+
- **User Logout** — Session cleanup
|
|
200
|
+
- **Password Security** — Bcrypt & Argon2 hashing
|
|
201
|
+
- **Protected Routes** — Dashboard & user pages
|
|
202
|
+
- **Database Models** — User table with indexes
|
|
203
|
+
|
|
204
|
+
### 🎯 Routes
|
|
205
|
+
```
|
|
206
|
+
GET / → Homepage
|
|
207
|
+
GET /register → Registration form
|
|
208
|
+
POST /register → Handle registration
|
|
209
|
+
GET /login → Login form
|
|
210
|
+
POST /login → Handle login
|
|
211
|
+
GET /dashboard → Protected dashboard
|
|
212
|
+
POST /logout → Logout user
|
|
213
|
+
GET /404 → Not found page
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 🗄️ Database & Migrations
|
|
219
|
+
|
|
220
|
+
The CLI automatically sets up:
|
|
221
|
+
|
|
222
|
+
1. **SQLite Database** (configurable)
|
|
223
|
+
2. **SQLAlchemy ORM** — Type-safe models
|
|
224
|
+
3. **Alembic Migrations** — Version control for schema
|
|
225
|
+
|
|
226
|
+
### Run Migrations
|
|
227
|
+
```bash
|
|
228
|
+
alembic upgrade head
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Create New Migration
|
|
232
|
+
```bash
|
|
233
|
+
alembic revision --autogenerate -m "Add new column"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Rollback
|
|
237
|
+
```bash
|
|
238
|
+
alembic downgrade -1
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## 📦 Dependencies
|
|
244
|
+
|
|
245
|
+
Shafikul CLI installs the following packages:
|
|
246
|
+
|
|
247
|
+
| Package | Purpose |
|
|
248
|
+
|---------|---------|
|
|
249
|
+
| **FastAPI** | Web framework |
|
|
250
|
+
| **Uvicorn** | ASGI server |
|
|
251
|
+
| **Jinja2** | Template engine |
|
|
252
|
+
| **SQLAlchemy** | ORM |
|
|
253
|
+
| **Alembic** | Migrations |
|
|
254
|
+
| **Passlib + Bcrypt** | Password hashing |
|
|
255
|
+
| **Argon2-CFFI** | Advanced password hashing |
|
|
256
|
+
| **python-dotenv** | Environment variables |
|
|
257
|
+
| **python-multipart** | Form data parsing |
|
|
258
|
+
|
|
259
|
+
See `requirements.txt` for the complete list.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 🛠️ Development
|
|
264
|
+
|
|
265
|
+
### Fork & Contribute
|
|
266
|
+
|
|
267
|
+
1. **Fork** the [repository](https://github.com/build-with-shafikul/shafikul_cli/fork)
|
|
268
|
+
2. **Create a feature branch:**
|
|
269
|
+
```bash
|
|
270
|
+
git checkout -b feature/your-feature-name
|
|
271
|
+
```
|
|
272
|
+
3. **Make your changes** and test thoroughly
|
|
273
|
+
4. **Commit with clear messages:**
|
|
274
|
+
```bash
|
|
275
|
+
git commit -m "Add: description of your feature"
|
|
276
|
+
```
|
|
277
|
+
5. **Push to your fork:**
|
|
278
|
+
```bash
|
|
279
|
+
git push origin feature/your-feature-name
|
|
280
|
+
```
|
|
281
|
+
6. **Open a Pull Request** with a clear description
|
|
282
|
+
|
|
283
|
+
### Development Setup
|
|
284
|
+
```bash
|
|
285
|
+
git clone https://github.com/build-with-shafikul/shafikul_cli.git
|
|
286
|
+
cd shafikul_cli
|
|
287
|
+
pip install -e ".[dev]" # Install with dev dependencies
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 📚 Example Usage
|
|
293
|
+
|
|
294
|
+
### Generate a Complete Blog Project
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# Create project
|
|
298
|
+
shafikul_cli create app
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 🐛 Troubleshooting
|
|
304
|
+
|
|
305
|
+
### Command not found: `shafikul_cli`
|
|
306
|
+
Make sure you've installed the package:
|
|
307
|
+
```bash
|
|
308
|
+
pip install shafikul_cli
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Port 8000 already in use
|
|
312
|
+
Change the port in `main.py`:
|
|
313
|
+
```python
|
|
314
|
+
uvicorn.run("main:app", host="127.0.0.1", port=8001, reload=True)
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Database migration failed
|
|
318
|
+
Reset your database:
|
|
319
|
+
```bash
|
|
320
|
+
rm test.db
|
|
321
|
+
alembic upgrade head
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## 📄 License
|
|
327
|
+
|
|
328
|
+
MIT License — See [LICENSE](LICENSE) for details.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## 👤 Author
|
|
333
|
+
|
|
334
|
+
**Md Shafikul Islam**
|
|
335
|
+
|
|
336
|
+
- 🔗 [GitHub](https://github.com/build-with-shafikul)
|
|
337
|
+
- 📧 [Email](mailto:buildwithshafikul@gmail.com)
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## ⭐ Show Your Support
|
|
342
|
+
|
|
343
|
+
If you find this tool helpful, please give it a star on [GitHub](https://github.com/build-with-shafikul/shafikul_cli) — it means a lot! 🙌
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
<div align="center">
|
|
348
|
+
|
|
349
|
+
**Made with ❤️ by Md Shafikul Islam**
|
|
350
|
+
|
|
351
|
+
*Simplifying FastAPI development, one command at a time.*
|
|
352
|
+
|
|
353
|
+
</div>
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# 🚀 Shafikul CLI
|
|
2
|
+
|
|
3
|
+
> **Lightning-fast FastAPI Project Scaffolding** — Generate production-ready boilerplate with user authentication, database models, and a complete folder structure in seconds.
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
[](https://github.com/build-with-shafikul/shafikul_cli)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 📋 What is Shafikul CLI?
|
|
17
|
+
|
|
18
|
+
Shafikul CLI is a **command-line scaffolding tool** that generates **complete FastAPI projects** with best practices built-in. Instead of manually creating routers, models, templates, and configurations, let the CLI do it for you—instantly.
|
|
19
|
+
|
|
20
|
+
Perfect for:
|
|
21
|
+
- 🎯 **Rapid Prototyping** — Start building features, not boilerplate
|
|
22
|
+
- 👥 **User Authentication** — Pre-configured login, logout, and registration
|
|
23
|
+
- 🗄️ **Database Setup** — SQLAlchemy models, Alembic migrations, auto-generated
|
|
24
|
+
- 🎨 **Templates Ready** — Organized template structure for web routes
|
|
25
|
+
- ⚡ **Zero Config** — Works out of the box with sensible defaults
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## ✨ Features
|
|
30
|
+
|
|
31
|
+
| Feature | Status |
|
|
32
|
+
|---------|--------|
|
|
33
|
+
| 🏗️ Auto-generate FastAPI project structure | ✅ |
|
|
34
|
+
| 🔐 Built-in user authentication (login, logout, registration) | ✅ |
|
|
35
|
+
| 🗄️ SQLAlchemy models & Alembic migrations | ✅ |
|
|
36
|
+
| 🛣️ Auto-generate routers (Web & API) | ✅ |
|
|
37
|
+
| 📝 HTML templates (layouts, pages, error handling) | ✅ |
|
|
38
|
+
| ⚙️ Auto-update `main.py` and `.env` | ✅ |
|
|
39
|
+
| 🎨 CSS, JavaScript, and static assets folders | ✅ |
|
|
40
|
+
| 🧩 Interactive CLI with multiple input options | ✅ |
|
|
41
|
+
| 🌈 Colored console output | ✅ |
|
|
42
|
+
| 📦 Pip installable package | ✅ |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 📦 Installation
|
|
47
|
+
|
|
48
|
+
### From PyPI (Recommended)
|
|
49
|
+
```bash
|
|
50
|
+
pip install shafikul_cli
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### From Source (Development)
|
|
54
|
+
```bash
|
|
55
|
+
git clone https://github.com/build-with-shafikul/shafikul_cli.git
|
|
56
|
+
cd shafikul_cli
|
|
57
|
+
pip install -e .
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 🚀 Quick Start
|
|
63
|
+
|
|
64
|
+
### 1️⃣ Create a New FastAPI Project
|
|
65
|
+
```bash
|
|
66
|
+
mkdir project_name
|
|
67
|
+
shafikul_cli create app
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2️⃣ Follow the Interactive Prompts
|
|
71
|
+
The CLI will create folders, files, install dependencies, and initialize the database automatically.
|
|
72
|
+
|
|
73
|
+
### 3️⃣ Start the Development Server
|
|
74
|
+
```bash
|
|
75
|
+
python main.py
|
|
76
|
+
```
|
|
77
|
+
Then visit **`http://127.0.0.1:8000`** in your browser.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 📖 CLI Commands
|
|
82
|
+
|
|
83
|
+
### View Help
|
|
84
|
+
```bash
|
|
85
|
+
shafikul_cli --help
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Check Version
|
|
89
|
+
```bash
|
|
90
|
+
shafikul_cli --version
|
|
91
|
+
# or
|
|
92
|
+
shafikul_cli -v
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### About
|
|
96
|
+
```bash
|
|
97
|
+
shafikul_cli --about
|
|
98
|
+
# or
|
|
99
|
+
shafikul_cli -a
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Create Resources (Interactive)
|
|
103
|
+
```bash
|
|
104
|
+
shafikul_cli create app
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 📁 Project Structure
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
your-project/
|
|
113
|
+
│
|
|
114
|
+
├── 📄 main.py # FastAPI application entry point
|
|
115
|
+
├── 📄 requirements.txt # Python dependencies
|
|
116
|
+
├── 📄 .env # Environment variables (gitignored)
|
|
117
|
+
├── 📄 .env.example # Environment template
|
|
118
|
+
├── 📄 .gitignore # Git ignore rules
|
|
119
|
+
├── 📄 alembic.ini # Database migration config
|
|
120
|
+
│
|
|
121
|
+
├── 📂 app/ # Application core
|
|
122
|
+
│ ├── database.py # Database connection & session
|
|
123
|
+
│ └── models.py # SQLAlchemy ORM models
|
|
124
|
+
│
|
|
125
|
+
├── 📂 config/ # Configuration
|
|
126
|
+
│ └── app.py # App settings & constants
|
|
127
|
+
│
|
|
128
|
+
├── 📂 router/ # Route handlers
|
|
129
|
+
│ ├── web/ # Web routes (HTML responses)
|
|
130
|
+
│ │ ├── auth.py # Login, logout, register
|
|
131
|
+
│ │ ├── public.py # Public pages
|
|
132
|
+
│ │ └── error.py # Error pages
|
|
133
|
+
│ └── api/ # API routes (JSON responses)
|
|
134
|
+
│ └── users.py # User API endpoints
|
|
135
|
+
│
|
|
136
|
+
├── 📂 templates/ # Jinja2 HTML templates
|
|
137
|
+
│ ├── layouts/ # Base templates
|
|
138
|
+
│ │ ├── main.html # Main layout
|
|
139
|
+
│ │ └── auth.html # Auth layout
|
|
140
|
+
│ └── pages/ # Page templates
|
|
141
|
+
│ ├── public/ # Public pages
|
|
142
|
+
│ │ └── index.html
|
|
143
|
+
│ ├── auth/ # Auth pages
|
|
144
|
+
│ │ ├── login.html
|
|
145
|
+
│ │ └── register.html
|
|
146
|
+
│ ├── authenticated/ # Protected pages
|
|
147
|
+
│ │ └── dashboard.html
|
|
148
|
+
│ └── error/ # Error pages
|
|
149
|
+
│ └── 404.html
|
|
150
|
+
│
|
|
151
|
+
├── 📂 asset/ # Static assets
|
|
152
|
+
│ ├── css/
|
|
153
|
+
│ │ └── style.css
|
|
154
|
+
│ ├── js/
|
|
155
|
+
│ │ └── script.js
|
|
156
|
+
│ └── images/
|
|
157
|
+
│ └── icon.png
|
|
158
|
+
│
|
|
159
|
+
├── 📂 static/ # Served static files
|
|
160
|
+
│ └── images/
|
|
161
|
+
│ └── logo.png
|
|
162
|
+
│
|
|
163
|
+
├── 📂 utility/ # Helper functions
|
|
164
|
+
│ └── helper_function.py
|
|
165
|
+
│
|
|
166
|
+
├── 📂 migrations/ # Alembic migrations
|
|
167
|
+
│ ├── versions/
|
|
168
|
+
│ └── env.py
|
|
169
|
+
│
|
|
170
|
+
└── 📂 test.db # SQLite database (example)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 🔐 Authentication Features
|
|
176
|
+
|
|
177
|
+
Shafikul CLI comes with **pre-built authentication** out of the box:
|
|
178
|
+
|
|
179
|
+
### ✅ Included
|
|
180
|
+
- **User Registration** — Form validation & password hashing
|
|
181
|
+
- **User Login** — Session management with secure cookies
|
|
182
|
+
- **User Logout** — Session cleanup
|
|
183
|
+
- **Password Security** — Bcrypt & Argon2 hashing
|
|
184
|
+
- **Protected Routes** — Dashboard & user pages
|
|
185
|
+
- **Database Models** — User table with indexes
|
|
186
|
+
|
|
187
|
+
### 🎯 Routes
|
|
188
|
+
```
|
|
189
|
+
GET / → Homepage
|
|
190
|
+
GET /register → Registration form
|
|
191
|
+
POST /register → Handle registration
|
|
192
|
+
GET /login → Login form
|
|
193
|
+
POST /login → Handle login
|
|
194
|
+
GET /dashboard → Protected dashboard
|
|
195
|
+
POST /logout → Logout user
|
|
196
|
+
GET /404 → Not found page
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 🗄️ Database & Migrations
|
|
202
|
+
|
|
203
|
+
The CLI automatically sets up:
|
|
204
|
+
|
|
205
|
+
1. **SQLite Database** (configurable)
|
|
206
|
+
2. **SQLAlchemy ORM** — Type-safe models
|
|
207
|
+
3. **Alembic Migrations** — Version control for schema
|
|
208
|
+
|
|
209
|
+
### Run Migrations
|
|
210
|
+
```bash
|
|
211
|
+
alembic upgrade head
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Create New Migration
|
|
215
|
+
```bash
|
|
216
|
+
alembic revision --autogenerate -m "Add new column"
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Rollback
|
|
220
|
+
```bash
|
|
221
|
+
alembic downgrade -1
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 📦 Dependencies
|
|
227
|
+
|
|
228
|
+
Shafikul CLI installs the following packages:
|
|
229
|
+
|
|
230
|
+
| Package | Purpose |
|
|
231
|
+
|---------|---------|
|
|
232
|
+
| **FastAPI** | Web framework |
|
|
233
|
+
| **Uvicorn** | ASGI server |
|
|
234
|
+
| **Jinja2** | Template engine |
|
|
235
|
+
| **SQLAlchemy** | ORM |
|
|
236
|
+
| **Alembic** | Migrations |
|
|
237
|
+
| **Passlib + Bcrypt** | Password hashing |
|
|
238
|
+
| **Argon2-CFFI** | Advanced password hashing |
|
|
239
|
+
| **python-dotenv** | Environment variables |
|
|
240
|
+
| **python-multipart** | Form data parsing |
|
|
241
|
+
|
|
242
|
+
See `requirements.txt` for the complete list.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## 🛠️ Development
|
|
247
|
+
|
|
248
|
+
### Fork & Contribute
|
|
249
|
+
|
|
250
|
+
1. **Fork** the [repository](https://github.com/build-with-shafikul/shafikul_cli/fork)
|
|
251
|
+
2. **Create a feature branch:**
|
|
252
|
+
```bash
|
|
253
|
+
git checkout -b feature/your-feature-name
|
|
254
|
+
```
|
|
255
|
+
3. **Make your changes** and test thoroughly
|
|
256
|
+
4. **Commit with clear messages:**
|
|
257
|
+
```bash
|
|
258
|
+
git commit -m "Add: description of your feature"
|
|
259
|
+
```
|
|
260
|
+
5. **Push to your fork:**
|
|
261
|
+
```bash
|
|
262
|
+
git push origin feature/your-feature-name
|
|
263
|
+
```
|
|
264
|
+
6. **Open a Pull Request** with a clear description
|
|
265
|
+
|
|
266
|
+
### Development Setup
|
|
267
|
+
```bash
|
|
268
|
+
git clone https://github.com/build-with-shafikul/shafikul_cli.git
|
|
269
|
+
cd shafikul_cli
|
|
270
|
+
pip install -e ".[dev]" # Install with dev dependencies
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 📚 Example Usage
|
|
276
|
+
|
|
277
|
+
### Generate a Complete Blog Project
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Create project
|
|
281
|
+
shafikul_cli create app
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## 🐛 Troubleshooting
|
|
287
|
+
|
|
288
|
+
### Command not found: `shafikul_cli`
|
|
289
|
+
Make sure you've installed the package:
|
|
290
|
+
```bash
|
|
291
|
+
pip install shafikul_cli
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Port 8000 already in use
|
|
295
|
+
Change the port in `main.py`:
|
|
296
|
+
```python
|
|
297
|
+
uvicorn.run("main:app", host="127.0.0.1", port=8001, reload=True)
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Database migration failed
|
|
301
|
+
Reset your database:
|
|
302
|
+
```bash
|
|
303
|
+
rm test.db
|
|
304
|
+
alembic upgrade head
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 📄 License
|
|
310
|
+
|
|
311
|
+
MIT License — See [LICENSE](LICENSE) for details.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## 👤 Author
|
|
316
|
+
|
|
317
|
+
**Md Shafikul Islam**
|
|
318
|
+
|
|
319
|
+
- 🔗 [GitHub](https://github.com/build-with-shafikul)
|
|
320
|
+
- 📧 [Email](mailto:buildwithshafikul@gmail.com)
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## ⭐ Show Your Support
|
|
325
|
+
|
|
326
|
+
If you find this tool helpful, please give it a star on [GitHub](https://github.com/build-with-shafikul/shafikul_cli) — it means a lot! 🙌
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
<div align="center">
|
|
331
|
+
|
|
332
|
+
**Made with ❤️ by Md Shafikul Islam**
|
|
333
|
+
|
|
334
|
+
*Simplifying FastAPI development, one command at a time.*
|
|
335
|
+
|
|
336
|
+
</div>
|