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.
- ntc/__init__.py +5 -0
- ntc/app_creator.py +296 -0
- ntc/cli.py +4 -0
- ntc/cli_enhanced.py +820 -0
- ntc/composer/__init__.py +0 -0
- ntc/composer/main.py +443 -0
- ntc/deployment/__init__.py +0 -0
- ntc/templates/__init__.py +2 -0
- ntc/templates/auth_app/__init__.py +0 -0
- ntc/templates/auth_app/admin.py +24 -0
- ntc/templates/auth_app/apps.py +6 -0
- ntc/templates/auth_app/models.py +30 -0
- ntc/templates/auth_app/serializers.py +101 -0
- ntc/templates/auth_app/urls.py +19 -0
- ntc/templates/auth_app/views.py +175 -0
- ntc/templates/drf_structure/__init__.py +1 -0
- ntc/templates/drf_structure/drf_structure.md +83 -0
- ntc/templates/drf_structure/main.py +389 -0
- ntc/templates/drf_structure/structure.json +126 -0
- ntc/templates/drf_structure/templates/.entry/start_core_backend.sh +37 -0
- ntc/templates/drf_structure/templates/.entry/start_tasks_backend.sh +30 -0
- ntc/templates/drf_structure/templates/CLAUDE.md +194 -0
- ntc/templates/drf_structure/templates/README.md +117 -0
- ntc/templates/drf_structure/templates/apps/app_admin.py +3 -0
- ntc/templates/drf_structure/templates/apps/app_apps.py +6 -0
- ntc/templates/drf_structure/templates/apps/app_models.py +4 -0
- ntc/templates/drf_structure/templates/apps/app_urls.py +8 -0
- ntc/templates/drf_structure/templates/apps/app_views.py +6 -0
- ntc/templates/drf_structure/templates/apps/common_apps.py +6 -0
- ntc/templates/drf_structure/templates/apps/common_models.py +8 -0
- ntc/templates/drf_structure/templates/config/gunicorn_config.py +9 -0
- ntc/templates/drf_structure/templates/config/http.conf +33 -0
- ntc/templates/drf_structure/templates/core/base_model.py +9 -0
- ntc/templates/drf_structure/templates/core/formatter.py +5 -0
- ntc/templates/drf_structure/templates/core/logger.py +8 -0
- ntc/templates/drf_structure/templates/core/pagination.py +6 -0
- ntc/templates/drf_structure/templates/core/response_wrapper.py +7 -0
- ntc/templates/drf_structure/templates/core/services/azure/email/backend.py +108 -0
- ntc/templates/drf_structure/templates/core/services/azure/email/client.py +296 -0
- ntc/templates/drf_structure/templates/core/services/azure/email/notifier.py +102 -0
- ntc/templates/drf_structure/templates/core/services/object_storage.py +285 -0
- ntc/templates/drf_structure/templates/django_project/asgi.py +5 -0
- ntc/templates/drf_structure/templates/django_project/celery.py +8 -0
- ntc/templates/drf_structure/templates/django_project/dev_settings.py +2 -0
- ntc/templates/drf_structure/templates/django_project/django_settings.txt +322 -0
- ntc/templates/drf_structure/templates/django_project/management_command.py +114 -0
- ntc/templates/drf_structure/templates/django_project/prod_settings.py +3 -0
- ntc/templates/drf_structure/templates/django_project/schema.py +7 -0
- ntc/templates/drf_structure/templates/django_project/urls.py +6 -0
- ntc/templates/drf_structure/templates/django_project/wsgi.py +5 -0
- ntc/templates/drf_structure/templates/docker/docker-compose.yml +11 -0
- ntc/templates/drf_structure/templates/knowledge/knowledge_description.md +201 -0
- ntc/templates/drf_structure/templates/knowledge/knowledge_design_pattern.md +722 -0
- ntc/templates/drf_structure/templates/knowledge/knowledge_structure.md +151 -0
- ntc/templates/drf_structure/templates/root/README.md +307 -0
- ntc/templates/drf_structure/templates/root/django_env.txt +98 -0
- ntc/templates/drf_structure/templates/root/django_requirements.txt +24 -0
- ntc/templates/drf_structure/templates/root/gitignore.txt +6 -0
- ntc/templates/drf_structure/templates/root/manage.py +11 -0
- ntc/templates/flutter/.gitignore +44 -0
- ntc/templates/flutter/.knowledge/knowledge_description.md +215 -0
- ntc/templates/flutter/.knowledge/knowledge_design_pattern.md +310 -0
- ntc/templates/flutter/.knowledge/knowledge_structure.md +83 -0
- ntc/templates/flutter/CLAUDE.md +190 -0
- ntc/templates/flutter/__init__.py +0 -0
- ntc/templates/flutter/analysis_options.yaml +9 -0
- ntc/templates/flutter/main.py +187 -0
- ntc/templates/flutter/pubspec.yaml +65 -0
- ntc/templates/flutter/structure.json +51 -0
- ntc/templates/nextjs/.env.example +10 -0
- ntc/templates/nextjs/.gitignore +36 -0
- ntc/templates/nextjs/CLAUDE.md +181 -0
- ntc/templates/nextjs/README.md +94 -0
- ntc/templates/nextjs/__init__.py +0 -0
- ntc/templates/nextjs/knowledge/knowledge_description.md +208 -0
- ntc/templates/nextjs/knowledge/knowledge_design_pattern.md +460 -0
- ntc/templates/nextjs/knowledge/knowledge_structure.md +75 -0
- ntc/templates/nextjs/main.py +224 -0
- ntc/templates/nextjs/package.json +25 -0
- ntc/templates/nextjs/src/app/globals.css +26 -0
- ntc/templates/nextjs/src/app/layout.tsx +59 -0
- ntc/templates/nextjs/src/app/page.tsx +21 -0
- ntc/templates/nextjs/src/components/Header.tsx +16 -0
- ntc/templates/nextjs/src/services/api.ts +81 -0
- ntc/templates/nextjs/src/utils/constants.ts +1 -0
- ntc/templates/nextjs/structure.json +32 -0
- ntc/templates/nextjs/tsconfig.json +27 -0
- ntc/templates/react_admin/.env.example +1 -0
- ntc/templates/react_admin/.gitignore +10 -0
- ntc/templates/react_admin/CLAUDE.md +210 -0
- ntc/templates/react_admin/README.md +72 -0
- ntc/templates/react_admin/__init__.py +0 -0
- ntc/templates/react_admin/index.html +13 -0
- ntc/templates/react_admin/knowledge/knowledge_description.md +202 -0
- ntc/templates/react_admin/knowledge/knowledge_design_pattern.md +448 -0
- ntc/templates/react_admin/knowledge/knowledge_structure.md +97 -0
- ntc/templates/react_admin/main.py +208 -0
- ntc/templates/react_admin/package.json +35 -0
- ntc/templates/react_admin/src/App.tsx +60 -0
- ntc/templates/react_admin/src/components/ProtectedRoute.tsx +16 -0
- ntc/templates/react_admin/src/components/Sidebar.tsx +90 -0
- ntc/templates/react_admin/src/components/TopNav.tsx +44 -0
- ntc/templates/react_admin/src/context/AuthContext.tsx +107 -0
- ntc/templates/react_admin/src/context/ThemeContext.tsx +34 -0
- ntc/templates/react_admin/src/context/WorkspaceContext.tsx +28 -0
- ntc/templates/react_admin/src/hooks/useApi.ts +39 -0
- ntc/templates/react_admin/src/index.css +34 -0
- ntc/templates/react_admin/src/layouts/AuthLayout.tsx +23 -0
- ntc/templates/react_admin/src/layouts/DashboardLayout.tsx +24 -0
- ntc/templates/react_admin/src/main.tsx +5 -0
- ntc/templates/react_admin/src/pages/DashboardPage.tsx +10 -0
- ntc/templates/react_admin/src/pages/auth/LoginPage.tsx +79 -0
- ntc/templates/react_admin/src/pages/auth/RegisterPage.tsx +93 -0
- ntc/templates/react_admin/src/services/api.service.ts +44 -0
- ntc/templates/react_admin/src/services/base.service.ts +193 -0
- ntc/templates/react_admin/structure.json +52 -0
- ntc/templates/react_admin/tsconfig.app.json +25 -0
- ntc/templates/react_admin/tsconfig.json +7 -0
- ntc/templates/react_admin/tsconfig.node.json +19 -0
- ntc/templates/react_admin/vite.config.ts +13 -0
- ntc/templates/react_structure/CLAUDE.md +176 -0
- ntc/templates/react_structure/__init__.py +1 -0
- ntc/templates/react_structure/index.css +21 -0
- ntc/templates/react_structure/index.html +13 -0
- ntc/templates/react_structure/knowledge/knowledge_description.md +170 -0
- ntc/templates/react_structure/knowledge/knowledge_design_pattern.md +411 -0
- ntc/templates/react_structure/knowledge/knowledge_structure.md +74 -0
- ntc/templates/react_structure/main.py +217 -0
- ntc/templates/react_structure/package.json +32 -0
- ntc/templates/react_structure/src/App.tsx +63 -0
- ntc/templates/react_structure/src/components/Header.tsx +51 -0
- ntc/templates/react_structure/src/main.tsx +5 -0
- ntc/templates/react_structure/src/services/api.ts +90 -0
- ntc/templates/react_structure/src/utils/constants.ts +1 -0
- ntc/templates/react_structure/structure.json +65 -0
- ntc/templates/react_structure/tsconfig.app.json +25 -0
- ntc/templates/react_structure/tsconfig.json +7 -0
- ntc/templates/react_structure/tsconfig.node.json +19 -0
- ntc/templates/react_structure/vite.config.ts +12 -0
- ntc/utils/__init__.py +1 -0
- ntc/utils/environment.py +67 -0
- ntc/utils/output.py +41 -0
- ntc_dev_kit-1.0.0.dist-info/METADATA +188 -0
- ntc_dev_kit-1.0.0.dist-info/RECORD +148 -0
- ntc_dev_kit-1.0.0.dist-info/WHEEL +5 -0
- ntc_dev_kit-1.0.0.dist-info/entry_points.txt +2 -0
- ntc_dev_kit-1.0.0.dist-info/licenses/LICENSE +21 -0
- 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,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,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
|
+
}
|
ntc/utils/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Shared utilities for NTC toolkit."""
|
ntc/utils/environment.py
ADDED
|
@@ -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)
|