ntc-dev-kit 1.0.0__py3-none-any.whl

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 (148) hide show
  1. ntc/__init__.py +5 -0
  2. ntc/app_creator.py +296 -0
  3. ntc/cli.py +4 -0
  4. ntc/cli_enhanced.py +820 -0
  5. ntc/composer/__init__.py +0 -0
  6. ntc/composer/main.py +443 -0
  7. ntc/deployment/__init__.py +0 -0
  8. ntc/templates/__init__.py +2 -0
  9. ntc/templates/auth_app/__init__.py +0 -0
  10. ntc/templates/auth_app/admin.py +24 -0
  11. ntc/templates/auth_app/apps.py +6 -0
  12. ntc/templates/auth_app/models.py +30 -0
  13. ntc/templates/auth_app/serializers.py +101 -0
  14. ntc/templates/auth_app/urls.py +19 -0
  15. ntc/templates/auth_app/views.py +175 -0
  16. ntc/templates/drf_structure/__init__.py +1 -0
  17. ntc/templates/drf_structure/drf_structure.md +83 -0
  18. ntc/templates/drf_structure/main.py +389 -0
  19. ntc/templates/drf_structure/structure.json +126 -0
  20. ntc/templates/drf_structure/templates/.entry/start_core_backend.sh +37 -0
  21. ntc/templates/drf_structure/templates/.entry/start_tasks_backend.sh +30 -0
  22. ntc/templates/drf_structure/templates/CLAUDE.md +194 -0
  23. ntc/templates/drf_structure/templates/README.md +117 -0
  24. ntc/templates/drf_structure/templates/apps/app_admin.py +3 -0
  25. ntc/templates/drf_structure/templates/apps/app_apps.py +6 -0
  26. ntc/templates/drf_structure/templates/apps/app_models.py +4 -0
  27. ntc/templates/drf_structure/templates/apps/app_urls.py +8 -0
  28. ntc/templates/drf_structure/templates/apps/app_views.py +6 -0
  29. ntc/templates/drf_structure/templates/apps/common_apps.py +6 -0
  30. ntc/templates/drf_structure/templates/apps/common_models.py +8 -0
  31. ntc/templates/drf_structure/templates/config/gunicorn_config.py +9 -0
  32. ntc/templates/drf_structure/templates/config/http.conf +33 -0
  33. ntc/templates/drf_structure/templates/core/base_model.py +9 -0
  34. ntc/templates/drf_structure/templates/core/formatter.py +5 -0
  35. ntc/templates/drf_structure/templates/core/logger.py +8 -0
  36. ntc/templates/drf_structure/templates/core/pagination.py +6 -0
  37. ntc/templates/drf_structure/templates/core/response_wrapper.py +7 -0
  38. ntc/templates/drf_structure/templates/core/services/azure/email/backend.py +108 -0
  39. ntc/templates/drf_structure/templates/core/services/azure/email/client.py +296 -0
  40. ntc/templates/drf_structure/templates/core/services/azure/email/notifier.py +102 -0
  41. ntc/templates/drf_structure/templates/core/services/object_storage.py +285 -0
  42. ntc/templates/drf_structure/templates/django_project/asgi.py +5 -0
  43. ntc/templates/drf_structure/templates/django_project/celery.py +8 -0
  44. ntc/templates/drf_structure/templates/django_project/dev_settings.py +2 -0
  45. ntc/templates/drf_structure/templates/django_project/django_settings.txt +322 -0
  46. ntc/templates/drf_structure/templates/django_project/management_command.py +114 -0
  47. ntc/templates/drf_structure/templates/django_project/prod_settings.py +3 -0
  48. ntc/templates/drf_structure/templates/django_project/schema.py +7 -0
  49. ntc/templates/drf_structure/templates/django_project/urls.py +6 -0
  50. ntc/templates/drf_structure/templates/django_project/wsgi.py +5 -0
  51. ntc/templates/drf_structure/templates/docker/docker-compose.yml +11 -0
  52. ntc/templates/drf_structure/templates/knowledge/knowledge_description.md +201 -0
  53. ntc/templates/drf_structure/templates/knowledge/knowledge_design_pattern.md +722 -0
  54. ntc/templates/drf_structure/templates/knowledge/knowledge_structure.md +151 -0
  55. ntc/templates/drf_structure/templates/root/README.md +307 -0
  56. ntc/templates/drf_structure/templates/root/django_env.txt +98 -0
  57. ntc/templates/drf_structure/templates/root/django_requirements.txt +24 -0
  58. ntc/templates/drf_structure/templates/root/gitignore.txt +6 -0
  59. ntc/templates/drf_structure/templates/root/manage.py +11 -0
  60. ntc/templates/flutter/.gitignore +44 -0
  61. ntc/templates/flutter/.knowledge/knowledge_description.md +215 -0
  62. ntc/templates/flutter/.knowledge/knowledge_design_pattern.md +310 -0
  63. ntc/templates/flutter/.knowledge/knowledge_structure.md +83 -0
  64. ntc/templates/flutter/CLAUDE.md +190 -0
  65. ntc/templates/flutter/__init__.py +0 -0
  66. ntc/templates/flutter/analysis_options.yaml +9 -0
  67. ntc/templates/flutter/main.py +187 -0
  68. ntc/templates/flutter/pubspec.yaml +65 -0
  69. ntc/templates/flutter/structure.json +51 -0
  70. ntc/templates/nextjs/.env.example +10 -0
  71. ntc/templates/nextjs/.gitignore +36 -0
  72. ntc/templates/nextjs/CLAUDE.md +181 -0
  73. ntc/templates/nextjs/README.md +94 -0
  74. ntc/templates/nextjs/__init__.py +0 -0
  75. ntc/templates/nextjs/knowledge/knowledge_description.md +208 -0
  76. ntc/templates/nextjs/knowledge/knowledge_design_pattern.md +460 -0
  77. ntc/templates/nextjs/knowledge/knowledge_structure.md +75 -0
  78. ntc/templates/nextjs/main.py +224 -0
  79. ntc/templates/nextjs/package.json +25 -0
  80. ntc/templates/nextjs/src/app/globals.css +26 -0
  81. ntc/templates/nextjs/src/app/layout.tsx +59 -0
  82. ntc/templates/nextjs/src/app/page.tsx +21 -0
  83. ntc/templates/nextjs/src/components/Header.tsx +16 -0
  84. ntc/templates/nextjs/src/services/api.ts +81 -0
  85. ntc/templates/nextjs/src/utils/constants.ts +1 -0
  86. ntc/templates/nextjs/structure.json +32 -0
  87. ntc/templates/nextjs/tsconfig.json +27 -0
  88. ntc/templates/react_admin/.env.example +1 -0
  89. ntc/templates/react_admin/.gitignore +10 -0
  90. ntc/templates/react_admin/CLAUDE.md +210 -0
  91. ntc/templates/react_admin/README.md +72 -0
  92. ntc/templates/react_admin/__init__.py +0 -0
  93. ntc/templates/react_admin/index.html +13 -0
  94. ntc/templates/react_admin/knowledge/knowledge_description.md +202 -0
  95. ntc/templates/react_admin/knowledge/knowledge_design_pattern.md +448 -0
  96. ntc/templates/react_admin/knowledge/knowledge_structure.md +97 -0
  97. ntc/templates/react_admin/main.py +208 -0
  98. ntc/templates/react_admin/package.json +35 -0
  99. ntc/templates/react_admin/src/App.tsx +60 -0
  100. ntc/templates/react_admin/src/components/ProtectedRoute.tsx +16 -0
  101. ntc/templates/react_admin/src/components/Sidebar.tsx +90 -0
  102. ntc/templates/react_admin/src/components/TopNav.tsx +44 -0
  103. ntc/templates/react_admin/src/context/AuthContext.tsx +107 -0
  104. ntc/templates/react_admin/src/context/ThemeContext.tsx +34 -0
  105. ntc/templates/react_admin/src/context/WorkspaceContext.tsx +28 -0
  106. ntc/templates/react_admin/src/hooks/useApi.ts +39 -0
  107. ntc/templates/react_admin/src/index.css +34 -0
  108. ntc/templates/react_admin/src/layouts/AuthLayout.tsx +23 -0
  109. ntc/templates/react_admin/src/layouts/DashboardLayout.tsx +24 -0
  110. ntc/templates/react_admin/src/main.tsx +5 -0
  111. ntc/templates/react_admin/src/pages/DashboardPage.tsx +10 -0
  112. ntc/templates/react_admin/src/pages/auth/LoginPage.tsx +79 -0
  113. ntc/templates/react_admin/src/pages/auth/RegisterPage.tsx +93 -0
  114. ntc/templates/react_admin/src/services/api.service.ts +44 -0
  115. ntc/templates/react_admin/src/services/base.service.ts +193 -0
  116. ntc/templates/react_admin/structure.json +52 -0
  117. ntc/templates/react_admin/tsconfig.app.json +25 -0
  118. ntc/templates/react_admin/tsconfig.json +7 -0
  119. ntc/templates/react_admin/tsconfig.node.json +19 -0
  120. ntc/templates/react_admin/vite.config.ts +13 -0
  121. ntc/templates/react_structure/CLAUDE.md +176 -0
  122. ntc/templates/react_structure/__init__.py +1 -0
  123. ntc/templates/react_structure/index.css +21 -0
  124. ntc/templates/react_structure/index.html +13 -0
  125. ntc/templates/react_structure/knowledge/knowledge_description.md +170 -0
  126. ntc/templates/react_structure/knowledge/knowledge_design_pattern.md +411 -0
  127. ntc/templates/react_structure/knowledge/knowledge_structure.md +74 -0
  128. ntc/templates/react_structure/main.py +217 -0
  129. ntc/templates/react_structure/package.json +32 -0
  130. ntc/templates/react_structure/src/App.tsx +63 -0
  131. ntc/templates/react_structure/src/components/Header.tsx +51 -0
  132. ntc/templates/react_structure/src/main.tsx +5 -0
  133. ntc/templates/react_structure/src/services/api.ts +90 -0
  134. ntc/templates/react_structure/src/utils/constants.ts +1 -0
  135. ntc/templates/react_structure/structure.json +65 -0
  136. ntc/templates/react_structure/tsconfig.app.json +25 -0
  137. ntc/templates/react_structure/tsconfig.json +7 -0
  138. ntc/templates/react_structure/tsconfig.node.json +19 -0
  139. ntc/templates/react_structure/vite.config.ts +12 -0
  140. ntc/utils/__init__.py +1 -0
  141. ntc/utils/environment.py +67 -0
  142. ntc/utils/output.py +41 -0
  143. ntc_dev_kit-1.0.0.dist-info/METADATA +188 -0
  144. ntc_dev_kit-1.0.0.dist-info/RECORD +148 -0
  145. ntc_dev_kit-1.0.0.dist-info/WHEEL +5 -0
  146. ntc_dev_kit-1.0.0.dist-info/entry_points.txt +2 -0
  147. ntc_dev_kit-1.0.0.dist-info/licenses/LICENSE +21 -0
  148. ntc_dev_kit-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "{project_name}",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite --host=127.0.0.1",
8
+ "build": "tsc -b && vite build",
9
+ "lint": "eslint .",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "axios": "^1.13.6",
14
+ "react": "^19.2.4",
15
+ "react-dom": "^19.2.4",
16
+ "react-router-dom": "^7.13.1"
17
+ },
18
+ "devDependencies": {
19
+ "@eslint/js": "^9.39.4",
20
+ "@types/node": "^24.12.0",
21
+ "@types/react": "^19.2.14",
22
+ "@types/react-dom": "^19.2.3",
23
+ "@vitejs/plugin-react": "^6.0.0",
24
+ "eslint": "^9.39.4",
25
+ "eslint-plugin-react-hooks": "^7.0.1",
26
+ "eslint-plugin-react-refresh": "^0.5.2",
27
+ "globals": "^17.4.0",
28
+ "typescript": "~5.9.3",
29
+ "typescript-eslint": "^8.56.1",
30
+ "vite": "^8.0.0"
31
+ }
32
+ }
@@ -0,0 +1,63 @@
1
+ import { useState, useEffect } from 'react'
2
+ import './App.css'
3
+ import Header from './components/Header'
4
+ import { apiService } from './services/api'
5
+
6
+ function App() {
7
+ const [apiStatus, setApiStatus] = useState<'checking' | 'connected' | 'disconnected'>('checking')
8
+ const [data, setData] = useState<any>(null)
9
+
10
+ useEffect(() => {
11
+ const checkApiConnection = async () => {
12
+ try {
13
+ const response = await apiService.get('/health')
14
+ setApiStatus('connected')
15
+ setData(response.data)
16
+ } catch (error) {
17
+ setApiStatus('disconnected')
18
+ console.error('API connection failed:', error)
19
+ }
20
+ }
21
+
22
+ checkApiConnection()
23
+ }, [])
24
+
25
+ return (
26
+ <div className="App">
27
+ <Header />
28
+ <main className="App-main">
29
+ <div className="welcome-section">
30
+ <h1>Welcome to {import.meta.env.VITE_APP_NAME || '{project_name}'}</h1>
31
+ <p>Your API-driven React application is ready!</p>
32
+
33
+ <div className="api-status">
34
+ <h3>API Connection Status:</h3>
35
+ <div className={`status-indicator ${apiStatus}`}>
36
+ {apiStatus === 'checking' && '🔄 Checking...'}
37
+ {apiStatus === 'connected' && '✅ Connected'}
38
+ {apiStatus === 'disconnected' && '❌ Disconnected'}
39
+ </div>
40
+ {data && (
41
+ <div className="api-data">
42
+ <h4>API Response:</h4>
43
+ <pre>{JSON.stringify(data, null, 2)}</pre>
44
+ </div>
45
+ )}
46
+ </div>
47
+
48
+ <div className="getting-started">
49
+ <h3>Getting Started:</h3>
50
+ <ol>
51
+ <li>Start your backend API server</li>
52
+ <li>Update API_BASE_URL in .env file if needed</li>
53
+ <li>Begin building your components in src/components/</li>
54
+ <li>Add API calls using the apiService in src/services/</li>
55
+ </ol>
56
+ </div>
57
+ </div>
58
+ </main>
59
+ </div>
60
+ )
61
+ }
62
+
63
+ export default App
@@ -0,0 +1,51 @@
1
+ const Header = () => {
2
+ return (
3
+ <header style={headerStyle}>
4
+ <div style={containerStyle}>
5
+ <h2 style={logoStyle}>🚀 {import.meta.env.VITE_APP_NAME || '{project_name}'}</h2>
6
+ <nav style={navStyle}>
7
+ <a href="#home" style={linkStyle}>Home</a>
8
+ <a href="#about" style={linkStyle}>About</a>
9
+ <a href="#contact" style={linkStyle}>Contact</a>
10
+ </nav>
11
+ </div>
12
+ </header>
13
+ )
14
+ }
15
+
16
+ const headerStyle = {
17
+ background: 'rgba(255, 255, 255, 0.1)',
18
+ backdropFilter: 'blur(10px)',
19
+ padding: '1rem 0',
20
+ borderBottom: '1px solid rgba(255, 255, 255, 0.2)'
21
+ }
22
+
23
+ const containerStyle = {
24
+ maxWidth: '1200px',
25
+ margin: '0 auto',
26
+ display: 'flex',
27
+ justifyContent: 'space-between',
28
+ alignItems: 'center',
29
+ padding: '0 20px'
30
+ }
31
+
32
+ const logoStyle = {
33
+ color: 'white',
34
+ margin: 0,
35
+ fontSize: '1.5rem'
36
+ }
37
+
38
+ const navStyle = {
39
+ display: 'flex',
40
+ gap: '2rem'
41
+ }
42
+
43
+ const linkStyle = {
44
+ color: 'white',
45
+ textDecoration: 'none',
46
+ fontSize: '1.1rem',
47
+ transition: 'opacity 0.3s ease',
48
+ opacity: 0.8
49
+ }
50
+
51
+ export default Header
@@ -0,0 +1,5 @@
1
+ import { createRoot } from 'react-dom/client'
2
+ import './index.css'
3
+ import App from './App.tsx'
4
+
5
+ createRoot(document.getElementById('root')!).render(<App />)
@@ -0,0 +1,90 @@
1
+ import axios from 'axios'
2
+ import { API_BASE_URL } from '../utils/constants'
3
+
4
+ const apiClient = axios.create({
5
+ baseURL: API_BASE_URL,
6
+ timeout: 10000,
7
+ headers: {
8
+ 'Content-Type': 'application/json',
9
+ },
10
+ })
11
+
12
+ apiClient.interceptors.request.use(
13
+ (config) => {
14
+ const token = localStorage.getItem('authToken')
15
+ if (token) {
16
+ config.headers.Authorization = `Bearer ${token}`
17
+ }
18
+ return config
19
+ },
20
+ (error) => {
21
+ return Promise.reject(error)
22
+ }
23
+ )
24
+
25
+ apiClient.interceptors.response.use(
26
+ (response) => {
27
+ return response
28
+ },
29
+ (error) => {
30
+ if (error.response?.status === 401) {
31
+ localStorage.removeItem('authToken')
32
+ }
33
+ return Promise.reject(error)
34
+ }
35
+ )
36
+
37
+ export const apiService = {
38
+ get: (url: string, config = {}) => {
39
+ return apiClient.get(url, config)
40
+ },
41
+
42
+ post: (url: string, data = {}, config = {}) => {
43
+ return apiClient.post(url, data, config)
44
+ },
45
+
46
+ put: (url: string, data = {}, config = {}) => {
47
+ return apiClient.put(url, data, config)
48
+ },
49
+
50
+ patch: (url: string, data = {}, config = {}) => {
51
+ return apiClient.patch(url, data, config)
52
+ },
53
+
54
+ delete: (url: string, config = {}) => {
55
+ return apiClient.delete(url, config)
56
+ },
57
+
58
+ uploadFile: (url: string, formData: FormData, onUploadProgress: any = null) => {
59
+ return apiClient.post(url, formData, {
60
+ headers: {
61
+ 'Content-Type': 'multipart/form-data',
62
+ },
63
+ onUploadProgress,
64
+ })
65
+ },
66
+ }
67
+
68
+ export const authService = {
69
+ login: async (credentials: any) => {
70
+ const response = await apiService.post('/auth/login/', credentials)
71
+ if (response.data.token) {
72
+ localStorage.setItem('authToken', response.data.token)
73
+ }
74
+ return response
75
+ },
76
+
77
+ logout: () => {
78
+ localStorage.removeItem('authToken')
79
+ },
80
+
81
+ getCurrentUser: () => {
82
+ return apiService.get('/auth/user/')
83
+ },
84
+
85
+ isAuthenticated: () => {
86
+ return !!localStorage.getItem('authToken')
87
+ },
88
+ }
89
+
90
+ export default apiService
@@ -0,0 +1 @@
1
+ export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8000'
@@ -0,0 +1,65 @@
1
+ {
2
+ "Project": {
3
+ "package.json": {
4
+ "template": "react_structure/package.json"
5
+ },
6
+ ".gitignore": "node_modules/\ndist/\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n.DS_Store\n",
7
+ "README.md": "# {project_name}\n\nA React + TypeScript + Vite application initialized by `ntc init`.\n\n## Getting Started\n\n```bash\nnpm install\nnpm run dev\n```\n\n## Available Scripts\n\n- `npm run dev` - Runs the app in development mode (Vite)\n- `npm run build` - Builds the app for production\n- `npm run lint` - Runs ESLint\n- `npm run preview` - Previews the production build\n",
8
+ "index.html": {
9
+ "template": "react_structure/index.html"
10
+ },
11
+ "vite.config.ts": {
12
+ "template": "react_structure/vite.config.ts"
13
+ },
14
+ "tsconfig.json": {
15
+ "template": "react_structure/tsconfig.json"
16
+ },
17
+ "tsconfig.app.json": {
18
+ "template": "react_structure/tsconfig.app.json"
19
+ },
20
+ "tsconfig.node.json": {
21
+ "template": "react_structure/tsconfig.node.json"
22
+ },
23
+ ".env.example": "VITE_API_BASE_URL=http://localhost:8000\nVITE_APP_NAME={project_name}\n",
24
+ "CLAUDE.md": {
25
+ "template": "react_structure/CLAUDE.md"
26
+ },
27
+ ".knowledge": {
28
+ "knowledge_structure.md": {
29
+ "template": "react_structure/knowledge/knowledge_structure.md"
30
+ },
31
+ "knowledge_description.md": {
32
+ "template": "react_structure/knowledge/knowledge_description.md"
33
+ },
34
+ "knowledge_design_pattern.md": {
35
+ "template": "react_structure/knowledge/knowledge_design_pattern.md"
36
+ }
37
+ },
38
+ "src": {
39
+ "main.tsx": {
40
+ "template": "react_structure/src/main.tsx"
41
+ },
42
+ "App.tsx": {
43
+ "template": "react_structure/src/App.tsx"
44
+ },
45
+ "index.css": {
46
+ "template": "react_structure/index.css"
47
+ },
48
+ "components": {
49
+ "Header.tsx": {
50
+ "template": "react_structure/src/components/Header.tsx"
51
+ }
52
+ },
53
+ "services": {
54
+ "api.ts": {
55
+ "template": "react_structure/src/services/api.ts"
56
+ }
57
+ },
58
+ "utils": {
59
+ "constants.ts": {
60
+ "template": "react_structure/src/utils/constants.ts"
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "isolatedModules": true,
11
+ "moduleDetection": "force",
12
+ "noEmit": true,
13
+ "jsx": "react-jsx",
14
+ "strict": true,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noUncheckedSideEffectImports": true,
19
+ "baseUrl": ".",
20
+ "paths": {
21
+ "@/*": ["./src/*"]
22
+ }
23
+ },
24
+ "include": ["src"]
25
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["ES2023"],
5
+ "module": "ESNext",
6
+ "skipLibCheck": true,
7
+ "moduleResolution": "bundler",
8
+ "allowImportingTsExtensions": true,
9
+ "isolatedModules": true,
10
+ "moduleDetection": "force",
11
+ "noEmit": true,
12
+ "strict": true,
13
+ "noUnusedLocals": true,
14
+ "noUnusedParameters": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "noUncheckedSideEffectImports": true
17
+ },
18
+ "include": ["vite.config.ts"]
19
+ }
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+ import path from 'path'
4
+
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ resolve: {
8
+ alias: {
9
+ '@': path.resolve(__dirname, './src'),
10
+ },
11
+ },
12
+ })
ntc/utils/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Shared utilities for NTC toolkit."""
@@ -0,0 +1,67 @@
1
+ """Shared environment setup utilities."""
2
+
3
+ import os
4
+ import sys
5
+ import subprocess
6
+ import shutil
7
+ from colorama import Fore, Style
8
+ from ntc.utils.output import print_info, print_error, print_success
9
+ from ntc.templates.drf_structure.main import create_virtual_env, install_requirements, find_conda_executable
10
+
11
+
12
+ def setup_environment(project_root: str, env_type: str = "venv") -> None:
13
+ """
14
+ Shared environment setup logic for both init functions.
15
+
16
+ Args:
17
+ project_root: Path to the project root directory
18
+ env_type: Type of environment to create ('venv' or 'conda')
19
+ """
20
+ print(f"\n{Fore.CYAN}{Style.BRIGHT}🐍 PYTHON ENVIRONMENT SETUP{Style.RESET_ALL}")
21
+ print("─" * 40)
22
+ print(f"{Fore.YELLOW}{Style.BRIGHT}[1]{Style.RESET_ALL} {Fore.WHITE}Create new virtual environment{Style.RESET_ALL}")
23
+ print(f"{Fore.YELLOW}{Style.BRIGHT}[2]{Style.RESET_ALL} {Fore.WHITE}Use existing active environment{Style.RESET_ALL}")
24
+ print(f"{Fore.YELLOW}{Style.BRIGHT}[3]{Style.RESET_ALL} {Fore.WHITE}Skip environment setup{Style.RESET_ALL}")
25
+
26
+ while True:
27
+ env_choice = input(f"{Fore.WHITE}{Style.BRIGHT}❓ Select environment option (1-3): {Style.RESET_ALL}").strip()
28
+
29
+ # Clear screen after selection
30
+ os.system('cls' if os.name == 'nt' else 'clear')
31
+
32
+ if env_choice == "1":
33
+ # Create new environment
34
+ os.system('cls' if os.name == 'nt' else 'clear')
35
+ env_type = input(f"{Fore.WHITE}{Style.BRIGHT}❓ Which environment to create? (venv/conda) [default: venv]: {Style.RESET_ALL}").strip().lower() or "venv"
36
+ env_dir = create_virtual_env(env_type, project_root)
37
+ install_requirements(env_type, env_dir, project_root)
38
+ break
39
+
40
+ elif env_choice == "2":
41
+ # Use existing active environment
42
+ print_info("Using existing active environment...")
43
+
44
+ # Check if we're in a virtual environment
45
+ if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix):
46
+ print_success("Detected active virtual environment!")
47
+
48
+ # Install requirements in current environment
49
+ from ntc.cli_enhanced import animate_dependency_install
50
+ requirements_path = os.path.join(project_root, "requirements.txt")
51
+ animate_dependency_install(requirements_path)
52
+ else:
53
+ print_error("No active virtual environment detected!")
54
+ print_info("Make sure you have activated your environment before running this.")
55
+ print_info("You can install dependencies later with: pip install -r requirements.txt")
56
+ break
57
+
58
+ elif env_choice == "3":
59
+ # Skip environment setup
60
+ print_info("Skipping environment setup.")
61
+ print_info("Remember to:")
62
+ print_info(" 1. Activate your preferred Python environment")
63
+ print_info(" 2. Install dependencies: pip install -r requirements.txt")
64
+ break
65
+
66
+ else:
67
+ print_error("Invalid choice. Please select 1, 2, or 3.")
ntc/utils/output.py ADDED
@@ -0,0 +1,41 @@
1
+ """Shared output utilities for consistent colored terminal output."""
2
+
3
+ from colorama import Fore, Style, init
4
+
5
+ # Initialize colorama for cross-platform colored output
6
+ init(autoreset=True)
7
+
8
+
9
+ def print_success(message: str) -> None:
10
+ """Print success message with green color and checkmark."""
11
+ print(f"{Fore.GREEN}✅ {message}{Style.RESET_ALL}")
12
+
13
+
14
+ def print_error(message: str) -> None:
15
+ """Print error message with red color and X mark."""
16
+ print(f"{Fore.RED}❌ {message}{Style.RESET_ALL}")
17
+
18
+
19
+ def print_warning(message: str) -> None:
20
+ """Print warning message with yellow color and warning sign."""
21
+ print(f"{Fore.YELLOW}⚠️ {message}{Style.RESET_ALL}")
22
+
23
+
24
+ def print_info(message: str) -> None:
25
+ """Print info message with blue color and info icon."""
26
+ print(f"{Fore.CYAN}ℹ️ {message}{Style.RESET_ALL}")
27
+
28
+
29
+ def print_progress(message: str) -> None:
30
+ """Print progress message with blue color and rocket."""
31
+ print(f"{Fore.BLUE}🚀 {message}{Style.RESET_ALL}")
32
+
33
+
34
+ def print_package(message: str) -> None:
35
+ """Print package-related message with magenta color and package icon."""
36
+ print(f"{Fore.MAGENTA}📦 {message}{Style.RESET_ALL}")
37
+
38
+
39
+ def print_download(message: str) -> None:
40
+ """Print download message with green color and download icon."""
41
+ print(f"{Fore.GREEN}📥 {message}{Style.RESET_ALL}")
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.4
2
+ Name: ntc-dev-kit
3
+ Version: 1.0.0
4
+ Summary: Nexent Toolkit Console - A CLI tool for scaffolding Django REST Framework, React, Next.js, and Flutter projects
5
+ Home-page: https://github.com/nexent/ntc
6
+ Author: Nexent
7
+ Author-email: Nexent <dev@nexent.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/nexent/ntc
10
+ Project-URL: Repository, https://github.com/nexent/ntc
11
+ Project-URL: Issues, https://github.com/nexent/ntc/issues
12
+ Keywords: cli,scaffold,django,drf,react,nextjs,flutter,generator,boilerplate
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Software Development :: Code Generators
23
+ Classifier: Topic :: Utilities
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: colorama>=0.4.6
28
+ Requires-Dist: pyyaml>=6.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: build>=1.0; extra == "dev"
31
+ Requires-Dist: twine>=4.0; extra == "dev"
32
+ Requires-Dist: pytest>=7.0; extra == "dev"
33
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
34
+ Requires-Dist: black>=23.0; extra == "dev"
35
+ Dynamic: author
36
+ Dynamic: home-page
37
+ Dynamic: license-file
38
+ Dynamic: requires-python
39
+
40
+ # NTC - Nexent Toolkit Console
41
+
42
+ A powerful CLI scaffolding tool for rapidly bootstrapping modern web and mobile projects.
43
+
44
+ ## Overview
45
+
46
+ NTC (Nexent Toolkit Console) is a command-line interface that generates production-ready project boilerplates for:
47
+
48
+ - **Backend**: Django REST Framework with authentication, Celery, Docker support
49
+ - **Frontend**: React, React Admin, Next.js
50
+ - **Mobile**: Flutter
51
+
52
+ ## Features
53
+
54
+ - **Interactive project initialization** with step-by-step prompts
55
+ - **Django REST Framework scaffolding** with JWT authentication, custom User models, and API documentation
56
+ - **Environment setup automation** (virtual environments, dependency installation)
57
+ - **Docker & Docker Compose** configuration included
58
+ - **Authentication app generator** with login, register, password reset endpoints
59
+ - **Modular app architecture** with pre-configured common utilities
60
+
61
+ ## Installation
62
+
63
+ ```bash
64
+ pip install ntc-dev-kit
65
+ ```
66
+
67
+ ## Quick Start
68
+
69
+ Create a new project interactively:
70
+
71
+ ```bash
72
+ ntc init
73
+ ```
74
+
75
+ Or specify technology directly:
76
+
77
+ ```bash
78
+ # Django REST API backend
79
+ ntc init --technology django
80
+
81
+ # React frontend
82
+ ntc init --technology react
83
+
84
+ # Next.js full-stack
85
+ ntc init --technology nextjs
86
+
87
+ # Flutter mobile
88
+ ntc init --technology flutter
89
+ ```
90
+
91
+ ## Usage
92
+
93
+ ### Interactive Mode
94
+
95
+ ```bash
96
+ ntc init
97
+ ```
98
+
99
+ Navigate menus with **arrow keys**, select with **Enter**, exit with **Escape**.
100
+
101
+ ### Technology Options
102
+
103
+ | Technology | Description |
104
+ |-----------|-------------|
105
+ | `django` | Django REST Framework with JWT auth, Celery, Docker |
106
+ | `react` | React Vite project with TypeScript |
107
+ | `react-admin` | React Admin dashboard template |
108
+ | `nextjs` | Next.js full-stack application |
109
+ | `flutter` | Flutter mobile application |
110
+
111
+ ### Additional Commands
112
+
113
+ ```bash
114
+ # Create a new Django app within your project
115
+ ntc create app <app_name>
116
+
117
+ # Show help
118
+ ntc --help
119
+ ```
120
+
121
+ ## Django Project Structure
122
+
123
+ When you create a Django project, you get:
124
+
125
+ ```
126
+ myproject/
127
+ ├── .env # Environment variables
128
+ ├── .gitignore
129
+ ├── requirements.txt
130
+ ├── manage.py
131
+ ├── Dockerfile
132
+ ├── docker-compose.yml
133
+ ├── config/ # Gunicorn & nginx config
134
+ ├── .entry/ # Startup scripts
135
+ ├── .knowledge/ # AI documentation
136
+ ├── apps/
137
+ │ ├── __init__.py
138
+ │ ├── common/ # Common utilities
139
+ │ └── authentication/ # (Optional) Auth app
140
+ ├── core/ # Core utilities
141
+ │ ├── pagination.py
142
+ │ ├── base_model.py
143
+ │ ├── response_wrapper.py
144
+ │ └── services/ # Azure/AWS services
145
+ └── myproject/ # Django project settings
146
+ ├── settings/
147
+ ├── urls.py
148
+ ├── asgi.py
149
+ ├── wsgi.py
150
+ └── commands/ # Management commands
151
+ ```
152
+
153
+ ## Requirements
154
+
155
+ - **Python**: >= 3.10
156
+ - **Operating System**: Windows, macOS, Linux
157
+
158
+ ## Dependencies
159
+
160
+ - `colorama` - Cross-platform colored terminal output
161
+ - `pyyaml` - YAML configuration parsing
162
+
163
+ ## Development
164
+
165
+ ```bash
166
+ # Clone repository
167
+ git clone https://github.com/nexent/ntc.git
168
+ cd ntc
169
+
170
+ # Install in development mode
171
+ pip install -e ".[dev]"
172
+
173
+ # Run tests
174
+ pytest
175
+
176
+ # Code formatting
177
+ black ntc/
178
+ ruff check ntc/
179
+ ```
180
+
181
+ ## License
182
+
183
+ MIT License - see [LICENSE](LICENSE) for details.
184
+
185
+ ## Support
186
+
187
+ - **Issues**: [GitHub Issues](https://github.com/nexent/ntc/issues)
188
+ - **Repository**: [GitHub](https://github.com/nexent/ntc)