start-it-cli 1.0.0

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.
@@ -0,0 +1,558 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pythonTemplates = void 0;
4
+ exports.pythonTemplates = {
5
+ Django: {
6
+ name: "Django",
7
+ description: "A Django web application",
8
+ files: [
9
+ {
10
+ path: "requirements.txt",
11
+ content: `Django==4.2.7
12
+ djangorestframework==3.14.0
13
+ python-dotenv==1.0.0
14
+ `,
15
+ },
16
+ {
17
+ path: "manage.py",
18
+ content: `#!/usr/bin/env python
19
+ import os
20
+ import sys
21
+
22
+ def main():
23
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
24
+ try:
25
+ from django.core.management import execute_from_command_line
26
+ except ImportError as exc:
27
+ raise ImportError(
28
+ "Couldn't import Django. Are you sure it's installed and "
29
+ "available on your PYTHONPATH environment variable? Did you "
30
+ "forget to activate a virtual environment?"
31
+ ) from exc
32
+ execute_from_command_line(sys.argv)
33
+
34
+ if __name__ == '__main__':
35
+ main()
36
+ `,
37
+ isExecutable: true,
38
+ },
39
+ {
40
+ path: "config/settings.py",
41
+ content: `import os
42
+ from pathlib import Path
43
+
44
+ BASE_DIR = Path(__file__).resolve().parent.parent
45
+
46
+ SECRET_KEY = 'django-insecure-your-secret-key-here'
47
+
48
+ DEBUG = True
49
+
50
+ ALLOWED_HOSTS = ['*']
51
+
52
+ INSTALLED_APPS = [
53
+ 'django.contrib.admin',
54
+ 'django.contrib.auth',
55
+ 'django.contrib.contenttypes',
56
+ 'django.contrib.sessions',
57
+ 'django.contrib.messages',
58
+ 'django.contrib.staticfiles',
59
+ 'rest_framework',
60
+ ]
61
+
62
+ MIDDLEWARE = [
63
+ 'django.middleware.security.SecurityMiddleware',
64
+ 'django.contrib.sessions.middleware.SessionMiddleware',
65
+ 'django.middleware.common.CommonMiddleware',
66
+ 'django.middleware.csrf.CsrfViewMiddleware',
67
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
68
+ 'django.contrib.messages.middleware.MessageMiddleware',
69
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
70
+ ]
71
+
72
+ ROOT_URLCONF = 'config.urls'
73
+
74
+ TEMPLATES = [
75
+ {
76
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
77
+ 'DIRS': [BASE_DIR / 'templates'],
78
+ 'APP_DIRS': True,
79
+ 'OPTIONS': {
80
+ 'context_processors': [
81
+ 'django.template.context_processors.debug',
82
+ 'django.template.context_processors.request',
83
+ 'django.contrib.auth.context_processors.auth',
84
+ 'django.contrib.messages.context_processors.messages',
85
+ ],
86
+ },
87
+ },
88
+ ]
89
+
90
+ WSGI_APPLICATION = 'config.wsgi.application'
91
+
92
+ DATABASES = {
93
+ 'default': {
94
+ 'ENGINE': 'django.db.backends.sqlite3',
95
+ 'NAME': BASE_DIR / 'db.sqlite3',
96
+ }
97
+ }
98
+
99
+ AUTH_PASSWORD_VALIDATORS = [
100
+ {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
101
+ {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
102
+ {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
103
+ {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
104
+ ]
105
+
106
+ LANGUAGE_CODE = 'en-us'
107
+ TIME_ZONE = 'UTC'
108
+ USE_I18N = True
109
+ USE_TZ = True
110
+
111
+ STATIC_URL = '/static/'
112
+ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
113
+ `,
114
+ },
115
+ {
116
+ path: "config/urls.py",
117
+ content: `from django.contrib import admin
118
+ from django.urls import path
119
+ from django.views.generic import TemplateView
120
+
121
+ urlpatterns = [
122
+ path('admin/', admin.site.urls),
123
+ path('', TemplateView.as_view(template_name='index.html')),
124
+ ]
125
+ `,
126
+ },
127
+ {
128
+ path: "config/wsgi.py",
129
+ content: `import os
130
+ from django.core.wsgi import get_wsgi_application
131
+
132
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
133
+ application = get_wsgi_application()
134
+ `,
135
+ },
136
+ {
137
+ path: "templates/index.html",
138
+ content: `<!DOCTYPE html>
139
+ <html>
140
+ <head>
141
+ <meta charset="utf-8">
142
+ <meta name="viewport" content="width=device-width, initial-scale=1">
143
+ <title>Django App</title>
144
+ <style>
145
+ body {
146
+ font-family: Arial, sans-serif;
147
+ margin: 0;
148
+ padding: 20px;
149
+ background-color: #f5f5f5;
150
+ }
151
+ .container {
152
+ max-width: 800px;
153
+ margin: 0 auto;
154
+ background-color: white;
155
+ padding: 20px;
156
+ border-radius: 8px;
157
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
158
+ }
159
+ h1 {
160
+ color: #333;
161
+ }
162
+ p {
163
+ color: #666;
164
+ }
165
+ </style>
166
+ </head>
167
+ <body>
168
+ <div class="container">
169
+ <h1>Welcome to Django!</h1>
170
+ <p>Edit templates/index.html to get started</p>
171
+ </div>
172
+ </body>
173
+ </html>
174
+ `,
175
+ },
176
+ {
177
+ path: "README.md",
178
+ content: `# Django Application
179
+
180
+ A Django web application.
181
+
182
+ ## Setup
183
+
184
+ \`\`\`bash
185
+ python -m venv venv
186
+ source venv/bin/activate # On Windows: venv\\\\Scripts\\\\activate
187
+ pip install -r requirements.txt
188
+ \`\`\`
189
+
190
+ ## Run
191
+
192
+ \`\`\`bash
193
+ python manage.py runserver
194
+ \`\`\`
195
+
196
+ The application will be available at \`http://localhost:8000\`
197
+
198
+ ## Migrations
199
+
200
+ \`\`\`bash
201
+ python manage.py migrate
202
+ python manage.py createsuperuser
203
+ \`\`\`
204
+
205
+ ## Project Structure
206
+
207
+ - \`config/\` - Project configuration
208
+ - \`templates/\` - HTML templates
209
+ - \`manage.py\` - Django management script
210
+ `,
211
+ },
212
+ {
213
+ path: ".gitignore",
214
+ content: `# Python
215
+ __pycache__/
216
+ *.py[cod]
217
+ *$py.class
218
+ *.so
219
+ .Python
220
+ env/
221
+ venv/
222
+ ENV/
223
+ build/
224
+ develop-eggs/
225
+ dist/
226
+ downloads/
227
+ eggs/
228
+ .eggs/
229
+ lib/
230
+ lib64/
231
+ parts/
232
+ sdist/
233
+ var/
234
+ wheels/
235
+ *.egg-info/
236
+ .installed.cfg
237
+ *.egg
238
+
239
+ # Django
240
+ *.log
241
+ local_settings.py
242
+ db.sqlite3
243
+ /media
244
+ /staticfiles
245
+
246
+ # IDE
247
+ .vscode/
248
+ .idea/
249
+ *.swp
250
+ *.swo
251
+ *~
252
+
253
+ # OS
254
+ .DS_Store
255
+ Thumbs.db
256
+
257
+ # Environment
258
+ .env
259
+ .env.local
260
+ `,
261
+ },
262
+ ],
263
+ },
264
+ Flask: {
265
+ name: "Flask",
266
+ description: "A Flask web application",
267
+ files: [
268
+ {
269
+ path: "requirements.txt",
270
+ content: `Flask==3.0.0
271
+ python-dotenv==1.0.0
272
+ `,
273
+ },
274
+ {
275
+ path: "app.py",
276
+ content: `from flask import Flask, render_template, jsonify, request
277
+
278
+ app = Flask(__name__)
279
+
280
+ @app.route('/')
281
+ def index():
282
+ return render_template('index.html')
283
+
284
+ @app.route('/api/hello')
285
+ def hello():
286
+ return jsonify({'message': 'Hello from Flask!'})
287
+
288
+ @app.route('/api/health')
289
+ def health():
290
+ return jsonify({'status': 'ok'})
291
+
292
+ @app.route('/api/echo', methods=['POST'])
293
+ def echo():
294
+ data = request.get_json()
295
+ return jsonify(data)
296
+
297
+ if __name__ == '__main__':
298
+ app.run(debug=True, port=5000)
299
+ `,
300
+ },
301
+ {
302
+ path: "templates/index.html",
303
+ content: `<!DOCTYPE html>
304
+ <html>
305
+ <head>
306
+ <meta charset="utf-8">
307
+ <meta name="viewport" content="width=device-width, initial-scale=1">
308
+ <title>Flask App</title>
309
+ <style>
310
+ body {
311
+ font-family: Arial, sans-serif;
312
+ margin: 0;
313
+ padding: 20px;
314
+ background-color: #f5f5f5;
315
+ }
316
+ .container {
317
+ max-width: 800px;
318
+ margin: 0 auto;
319
+ background-color: white;
320
+ padding: 20px;
321
+ border-radius: 8px;
322
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
323
+ }
324
+ h1 {
325
+ color: #333;
326
+ }
327
+ p {
328
+ color: #666;
329
+ }
330
+ </style>
331
+ </head>
332
+ <body>
333
+ <div class="container">
334
+ <h1>Welcome to Flask!</h1>
335
+ <p>Edit templates/index.html to get started</p>
336
+ </div>
337
+ </body>
338
+ </html>
339
+ `,
340
+ },
341
+ {
342
+ path: "README.md",
343
+ content: `# Flask Application
344
+
345
+ A Flask web application.
346
+
347
+ ## Setup
348
+
349
+ \`\`\`bash
350
+ python -m venv venv
351
+ source venv/bin/activate # On Windows: venv\\\\Scripts\\\\activate
352
+ pip install -r requirements.txt
353
+ \`\`\`
354
+
355
+ ## Run
356
+
357
+ \`\`\`bash
358
+ python app.py
359
+ \`\`\`
360
+
361
+ The application will be available at \`http://localhost:5000\`
362
+
363
+ ## Endpoints
364
+
365
+ - \`GET /\` - Home page
366
+ - \`GET /api/hello\` - Hello endpoint
367
+ - \`GET /api/health\` - Health check
368
+ - \`POST /api/echo\` - Echo endpoint
369
+
370
+ ## Project Structure
371
+
372
+ - \`app.py\` - Main application file
373
+ - \`templates/\` - HTML templates
374
+ - \`requirements.txt\` - Python dependencies
375
+ `,
376
+ },
377
+ {
378
+ path: ".gitignore",
379
+ content: `# Python
380
+ __pycache__/
381
+ *.py[cod]
382
+ *$py.class
383
+ *.so
384
+ .Python
385
+ env/
386
+ venv/
387
+ ENV/
388
+ build/
389
+ develop-eggs/
390
+ dist/
391
+ downloads/
392
+ eggs/
393
+ .eggs/
394
+ lib/
395
+ lib64/
396
+ parts/
397
+ sdist/
398
+ var/
399
+ wheels/
400
+ *.egg-info/
401
+ .installed.cfg
402
+ *.egg
403
+
404
+ # Flask
405
+ instance/
406
+ .webassets-cache
407
+
408
+ # IDE
409
+ .vscode/
410
+ .idea/
411
+ *.swp
412
+ *.swo
413
+ *~
414
+
415
+ # OS
416
+ .DS_Store
417
+ Thumbs.db
418
+
419
+ # Environment
420
+ .env
421
+ .env.local
422
+ `,
423
+ },
424
+ ],
425
+ },
426
+ FastAPI: {
427
+ name: "FastAPI",
428
+ description: "A FastAPI service",
429
+ files: [
430
+ {
431
+ path: "requirements.txt",
432
+ content: `fastapi==0.104.1
433
+ uvicorn==0.24.0
434
+ python-dotenv==1.0.0
435
+ `,
436
+ },
437
+ {
438
+ path: "main.py",
439
+ content: `from fastapi import FastAPI
440
+ from fastapi.middleware.cors import CORSMiddleware
441
+
442
+ app = FastAPI(title="FastAPI Service", version="1.0.0")
443
+
444
+ app.add_middleware(
445
+ CORSMiddleware,
446
+ allow_origins=["*"],
447
+ allow_credentials=True,
448
+ allow_methods=["*"],
449
+ allow_headers=["*"],
450
+ )
451
+
452
+ @app.get("/health")
453
+ async def health():
454
+ return {"status": "ok"}
455
+
456
+ @app.get("/api/hello")
457
+ async def hello():
458
+ return {"message": "Hello from FastAPI!"}
459
+
460
+ @app.post("/api/echo")
461
+ async def echo(data: dict):
462
+ return data
463
+
464
+ if __name__ == "__main__":
465
+ import uvicorn
466
+ uvicorn.run(app, host="0.0.0.0", port=8000)
467
+ `,
468
+ },
469
+ {
470
+ path: "README.md",
471
+ content: `# FastAPI Service
472
+
473
+ A FastAPI service.
474
+
475
+ ## Setup
476
+
477
+ \`\`\`bash
478
+ python -m venv venv
479
+ source venv/bin/activate # On Windows: venv\\\\Scripts\\\\activate
480
+ pip install -r requirements.txt
481
+ \`\`\`
482
+
483
+ ## Run
484
+
485
+ \`\`\`bash
486
+ python main.py
487
+ \`\`\`
488
+
489
+ Or with uvicorn directly:
490
+
491
+ \`\`\`bash
492
+ uvicorn main:app --reload
493
+ \`\`\`
494
+
495
+ The API will be available at \`http://localhost:8000\`
496
+
497
+ ## API Documentation
498
+
499
+ - Swagger UI: \`http://localhost:8000/docs\`
500
+ - ReDoc: \`http://localhost:8000/redoc\`
501
+
502
+ ## Endpoints
503
+
504
+ - \`GET /health\` - Health check
505
+ - \`GET /api/hello\` - Hello endpoint
506
+ - \`POST /api/echo\` - Echo endpoint
507
+ `,
508
+ },
509
+ {
510
+ path: ".gitignore",
511
+ content: `# Python
512
+ __pycache__/
513
+ *.py[cod]
514
+ *$py.class
515
+ *.so
516
+ .Python
517
+ env/
518
+ venv/
519
+ ENV/
520
+ build/
521
+ develop-eggs/
522
+ dist/
523
+ downloads/
524
+ eggs/
525
+ .eggs/
526
+ lib/
527
+ lib64/
528
+ parts/
529
+ sdist/
530
+ var/
531
+ wheels/
532
+ *.egg-info/
533
+ .installed.cfg
534
+ *.egg
535
+
536
+ # IDE
537
+ .vscode/
538
+ .idea/
539
+ *.swp
540
+ *.swo
541
+ *~
542
+
543
+ # OS
544
+ .DS_Store
545
+ Thumbs.db
546
+
547
+ # Environment
548
+ .env
549
+ .env.local
550
+
551
+ # FastAPI
552
+ .uvicorn_cache
553
+ `,
554
+ },
555
+ ],
556
+ },
557
+ };
558
+ //# sourceMappingURL=python.js.map