jlframework 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jlframework-1.0.0/LICENSE +21 -0
- jlframework-1.0.0/MANIFEST.in +8 -0
- jlframework-1.0.0/PKG-INFO +422 -0
- jlframework-1.0.0/README.md +377 -0
- jlframework-1.0.0/jlframework/__init__.py +77 -0
- jlframework-1.0.0/jlframework/__version__.py +3 -0
- jlframework-1.0.0/jlframework/cli/__init__.py +1 -0
- jlframework-1.0.0/jlframework/cli/commands/__init__.py +1 -0
- jlframework-1.0.0/jlframework/cli/commands/add.py +98 -0
- jlframework-1.0.0/jlframework/cli/commands/init.py +204 -0
- jlframework-1.0.0/jlframework/cli/commands/list_templates.py +28 -0
- jlframework-1.0.0/jlframework/cli/main.py +25 -0
- jlframework-1.0.0/jlframework/cli/utils/__init__.py +1 -0
- jlframework-1.0.0/jlframework/cli/utils/file_operations.py +44 -0
- jlframework-1.0.0/jlframework/cli/utils/template_manager.py +345 -0
- jlframework-1.0.0/jlframework/cli/utils/validators.py +28 -0
- jlframework-1.0.0/jlframework/core/__init__.py +1 -0
- jlframework-1.0.0/jlframework/core/api_client.py +335 -0
- jlframework-1.0.0/jlframework/core/azure_db.py +112 -0
- jlframework-1.0.0/jlframework/core/config.py +41 -0
- jlframework-1.0.0/jlframework/core/database.py +231 -0
- jlframework-1.0.0/jlframework/core/enums.py +224 -0
- jlframework-1.0.0/jlframework/core/handlers.py +411 -0
- jlframework-1.0.0/jlframework/core/middleware.py +211 -0
- jlframework-1.0.0/jlframework/core/utils.py +31 -0
- jlframework-1.0.0/jlframework/templates/__init__.py +1 -0
- jlframework-1.0.0/jlframework/templates/backend/.env.example +6 -0
- jlframework-1.0.0/jlframework/templates/backend/Dockerfile +35 -0
- jlframework-1.0.0/jlframework/templates/backend/configs/app_config.py +43 -0
- jlframework-1.0.0/jlframework/templates/backend/configs/azure_config.py +120 -0
- jlframework-1.0.0/jlframework/templates/backend/configs/azure_insights.py +41 -0
- jlframework-1.0.0/jlframework/templates/backend/domains/__init__.py +1 -0
- jlframework-1.0.0/jlframework/templates/backend/domains/company/__init__.py +1 -0
- jlframework-1.0.0/jlframework/templates/backend/domains/company/routers.py +121 -0
- jlframework-1.0.0/jlframework/templates/backend/domains/company/services.py +196 -0
- jlframework-1.0.0/jlframework/templates/backend/main.py +141 -0
- jlframework-1.0.0/jlframework/templates/backend/requirements.txt +17 -0
- jlframework-1.0.0/jlframework/templates/backend/routes.py +11 -0
- jlframework-1.0.0/jlframework/templates/backend/shared/__init__.py +1 -0
- jlframework-1.0.0/jlframework/templates/backend/shared/database.py +212 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/.env.docker +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/.env.embed-docker +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/.env.example +10 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/Dockerfile +34 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/deploy/entrypoint.sh +11 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/deploy/nginx.conf +32 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/index.html +17 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/package-lock.json +2849 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/package.json +35 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/public/favicon.ico +0 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/App.vue +6 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/assets/main.css +2 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/components/BaseButton.vue +120 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/components/BaseSelect.vue +177 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/components/DropdownLoader.vue +101 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/custom-typings.d.ts +56 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/idsrvAuth.ts +24 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/main.ts +18 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/router/index.ts +79 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/services/api.ts +106 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/services/company.service.ts +53 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/services/tenant.service.ts +66 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/subAppEntry.js +29 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/utils/const.ts +12 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/utils/notify.ts +54 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/utils/oidc.ts +6 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/views/Company.vue +181 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/views/NotFound.vue +59 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/src/views/ProjectDetails.vue +510 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/tailwind.config.js +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/tsconfig.json +31 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/vite-fede.config.js +70 -0
- jlframework-1.0.0/jlframework/templates/frontend-embedded/vite.config.ts +26 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/.env.docker +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/.env.embed-docker +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/.env.example +10 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/Dockerfile +34 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/build-features-docker.js +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/build-features.js +93 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/deploy/entrypoint.sh +11 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/deploy/nginx.conf +32 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/index.html +17 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/package-lock.json +2849 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/package.json +35 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/public/favicon.ico +0 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/App.vue +6 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/assets/main.css +2 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/components/BaseButton.vue +120 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/components/BaseSelect.vue +177 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/components/DropdownLoader.vue +101 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/custom-typings.d.ts +56 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/features/TabContentAttribute/index.js +17 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/features/TabContentAttribute/index.vue +16 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/features/TabItemRequests/index.js +15 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/features/TabItemRequests/index.vue +8 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/idsrvAuth.ts +24 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/main.ts +18 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/router/index.ts +79 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/services/api.ts +106 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/services/company.service.ts +52 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/services/tenant.service.ts +66 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/utils/const.ts +12 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/utils/notify.ts +54 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/utils/oidc.ts +6 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/views/Company.vue +181 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/views/NotFound.vue +59 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/src/views/ProjectDetails.vue +510 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/tailwind.config.js +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/tsconfig.json +31 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/vite-feature.config.js +45 -0
- jlframework-1.0.0/jlframework/templates/frontend-features/vite.config.ts +26 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/.env.docker +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/.env.example +10 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/Dockerfile +33 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/deploy/entrypoint.sh +11 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/deploy/nginx.conf +32 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/index.html +17 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/package-lock.json +5717 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/package.json +31 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/public/favicon.ico +0 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/App.vue +6 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/assets/main.css +2 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/components/BaseButton.vue +120 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/components/BaseSelect.vue +177 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/components/DropdownLoader.vue +101 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/custom-typings.d.ts +56 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/idsrvAuth.ts +24 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/main.ts +18 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/router/index.ts +79 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/services/api.ts +106 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/services/company.service.ts +30 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/services/tenant.service.ts +66 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/utils/const.ts +12 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/utils/notify.ts +54 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/utils/oidc.ts +6 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/views/Company.vue +181 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/views/NotFound.vue +59 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/src/views/ProjectDetails.vue +510 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/tailwind.config.js +3 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/tsconfig.json +31 -0
- jlframework-1.0.0/jlframework/templates/frontend-marketplace/vite.config.ts +27 -0
- jlframework-1.0.0/jlframework.egg-info/PKG-INFO +422 -0
- jlframework-1.0.0/jlframework.egg-info/SOURCES.txt +148 -0
- jlframework-1.0.0/jlframework.egg-info/dependency_links.txt +1 -0
- jlframework-1.0.0/jlframework.egg-info/entry_points.txt +2 -0
- jlframework-1.0.0/jlframework.egg-info/requires.txt +17 -0
- jlframework-1.0.0/jlframework.egg-info/top_level.txt +1 -0
- jlframework-1.0.0/pyproject.toml +83 -0
- jlframework-1.0.0/setup.cfg +4 -0
- jlframework-1.0.0/setup.py +68 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 JL Framework Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include jlframework/__version__.py
|
|
4
|
+
recursive-include jlframework/templates *
|
|
5
|
+
recursive-exclude jlframework/templates *.pyc
|
|
6
|
+
recursive-exclude jlframework/templates __pycache__
|
|
7
|
+
recursive-exclude jlframework/templates node_modules
|
|
8
|
+
recursive-exclude jlframework/templates .git
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jlframework
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A complete Python framework for full-stack development
|
|
5
|
+
Home-page: https://github.com/jlframework/jlframework
|
|
6
|
+
Author: JL Framework Team
|
|
7
|
+
Author-email: JL Framework Team <contact@jlframework.dev>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/jlframework/jlframework
|
|
10
|
+
Project-URL: Documentation, https://jlframework.readthedocs.io
|
|
11
|
+
Project-URL: Repository, https://github.com/jlframework/jlframework
|
|
12
|
+
Project-URL: Issues, https://github.com/jlframework/jlframework/issues
|
|
13
|
+
Keywords: fastapi,vue,framework,boilerplate,cli,scaffolding
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: click>=8.0.0
|
|
26
|
+
Requires-Dist: jinja2>=3.0.0
|
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
|
28
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
29
|
+
Requires-Dist: fastapi>=0.104.0
|
|
30
|
+
Requires-Dist: sqlalchemy>=2.0.0
|
|
31
|
+
Requires-Dist: uvicorn>=0.24.0
|
|
32
|
+
Requires-Dist: pymongo>=4.0.0
|
|
33
|
+
Requires-Dist: pyodbc>=5.0.0
|
|
34
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
38
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
39
|
+
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
41
|
+
Dynamic: author
|
|
42
|
+
Dynamic: home-page
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
Dynamic: requires-python
|
|
45
|
+
|
|
46
|
+
# JLFramework
|
|
47
|
+
|
|
48
|
+
[](https://badge.fury.io/py/jlframework)
|
|
49
|
+
[](https://www.python.org/downloads/)
|
|
50
|
+
[](https://opensource.org/licenses/MIT)
|
|
51
|
+
|
|
52
|
+
A complete Python framework for full-stack development with FastAPI and Vue.js. Create production-ready applications in minutes with Django-like scaffolding and importable utilities.
|
|
53
|
+
|
|
54
|
+
## ✨ Features
|
|
55
|
+
|
|
56
|
+
- 🚀 **Rapid Scaffolding** - Create full-stack projects in under 5 minutes
|
|
57
|
+
- 🏗️ **Production-Ready Templates** - FastAPI backend + Vue.js frontends with best practices
|
|
58
|
+
- 🔧 **Flexible & Modular** - Use only what you need, mix and match templates
|
|
59
|
+
- 📦 **Batteries Included** - Database, auth, logging, middleware, and more
|
|
60
|
+
- 🐍 **Django-like Experience** - Clean imports and intuitive CLI commands
|
|
61
|
+
- 🎨 **Multiple Frontend Options** - Embedded, features, and marketplace templates
|
|
62
|
+
- 🔒 **Security First** - Tenant isolation, OIDC auth, audit logging built-in
|
|
63
|
+
- 🐳 **Docker Ready** - Dockerfiles included for all templates
|
|
64
|
+
|
|
65
|
+
## 📦 Installation
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install jlframework
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 🚀 Quick Start
|
|
72
|
+
|
|
73
|
+
### Create a New Project
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Initialize a new project
|
|
77
|
+
jlframework init my-awesome-app
|
|
78
|
+
cd my-awesome-app
|
|
79
|
+
|
|
80
|
+
# Add backend
|
|
81
|
+
jlframework add backend
|
|
82
|
+
|
|
83
|
+
# Add frontend
|
|
84
|
+
jlframework add frontend-embedded
|
|
85
|
+
|
|
86
|
+
# List available templates
|
|
87
|
+
jlframework list
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Use Importable Utilities
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from fastapi import FastAPI, Request, Depends
|
|
94
|
+
from sqlalchemy.orm import Session
|
|
95
|
+
from jlframework import (
|
|
96
|
+
get_db,
|
|
97
|
+
CommonManager,
|
|
98
|
+
AuditManager,
|
|
99
|
+
AuditStatus,
|
|
100
|
+
AuditAction,
|
|
101
|
+
EntityType,
|
|
102
|
+
restrict_access_middleware,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
app = FastAPI()
|
|
106
|
+
|
|
107
|
+
# Add middleware
|
|
108
|
+
app.middleware("http")(restrict_access_middleware)
|
|
109
|
+
|
|
110
|
+
@app.get("/api/v1/items")
|
|
111
|
+
async def get_items(
|
|
112
|
+
request: Request,
|
|
113
|
+
db: Session = Depends(get_db)
|
|
114
|
+
):
|
|
115
|
+
# Get tenant ID from request
|
|
116
|
+
tenant_id = CommonManager.get_tenant_id(request)
|
|
117
|
+
|
|
118
|
+
# Query database
|
|
119
|
+
items = db.query(Item).filter_by(tenant_id=tenant_id).all()
|
|
120
|
+
|
|
121
|
+
return {"items": items}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 📚 Available Templates
|
|
125
|
+
|
|
126
|
+
### Backend
|
|
127
|
+
FastAPI backend with:
|
|
128
|
+
- Domain-driven design structure
|
|
129
|
+
- SQLAlchemy ORM with multiple database support
|
|
130
|
+
- Tenant-based access control middleware
|
|
131
|
+
- Audit logging with MongoDB
|
|
132
|
+
- Azure integration (optional)
|
|
133
|
+
- Docker support
|
|
134
|
+
- Environment-based configuration
|
|
135
|
+
|
|
136
|
+
### Frontend - Embedded
|
|
137
|
+
Vue.js 3 embedded application with:
|
|
138
|
+
- Vite build system
|
|
139
|
+
- TypeScript support
|
|
140
|
+
- Vue Router
|
|
141
|
+
- OIDC authentication (optional)
|
|
142
|
+
- API service layer
|
|
143
|
+
- Tailwind CSS
|
|
144
|
+
- Docker + Nginx deployment
|
|
145
|
+
|
|
146
|
+
### Frontend - Features
|
|
147
|
+
Vue.js 3 micro-frontend features:
|
|
148
|
+
- Modular component architecture
|
|
149
|
+
- Custom event system
|
|
150
|
+
- Shared state management
|
|
151
|
+
- Independent deployment
|
|
152
|
+
|
|
153
|
+
### Frontend - Marketplace
|
|
154
|
+
Vue.js 3 marketplace application:
|
|
155
|
+
- Full marketplace UI
|
|
156
|
+
- Product catalog
|
|
157
|
+
- User management
|
|
158
|
+
- OIDC authentication
|
|
159
|
+
|
|
160
|
+
## 🎯 CLI Commands
|
|
161
|
+
|
|
162
|
+
### `jlframework init`
|
|
163
|
+
Initialize a new project with configuration files.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
jlframework init my-project
|
|
167
|
+
jlframework init my-project --no-git # Skip git initialization
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### `jlframework add`
|
|
171
|
+
Add a template to your project.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
jlframework add backend
|
|
175
|
+
jlframework add frontend-embedded
|
|
176
|
+
jlframework add frontend-features
|
|
177
|
+
jlframework add frontend-marketplace
|
|
178
|
+
jlframework add backend --skip-install # Skip dependency installation
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### `jlframework list`
|
|
182
|
+
List all available templates.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
jlframework list
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 📖 Importable Utilities
|
|
189
|
+
|
|
190
|
+
### Database
|
|
191
|
+
|
|
192
|
+
```python
|
|
193
|
+
from jlframework import get_db, get_db_session, database_middleware
|
|
194
|
+
|
|
195
|
+
# Use as FastAPI dependency
|
|
196
|
+
@app.get("/items")
|
|
197
|
+
def get_items(db: Session = Depends(get_db)):
|
|
198
|
+
return db.query(Item).all()
|
|
199
|
+
|
|
200
|
+
# Use as middleware
|
|
201
|
+
app.middleware("http")(database_middleware)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Handlers
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
from jlframework import CommonManager, AuditManager, AuditData
|
|
208
|
+
|
|
209
|
+
# Get tenant ID from request
|
|
210
|
+
tenant_id = CommonManager.get_tenant_id(request)
|
|
211
|
+
|
|
212
|
+
# Get client information
|
|
213
|
+
client_info = CommonManager.get_client_info(request)
|
|
214
|
+
|
|
215
|
+
# Validate pagination
|
|
216
|
+
CommonManager.validate_pagination(page_index=1, page_size=50)
|
|
217
|
+
|
|
218
|
+
# Audit logging
|
|
219
|
+
audit = AuditManager(app_id=1, tenant_id=tenant_id, mongo_connection_string=config)
|
|
220
|
+
await audit.save_audit(AuditData(...))
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Enums
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
from jlframework import AuditStatus, AuditAction, EntityType
|
|
227
|
+
|
|
228
|
+
# Use in your code
|
|
229
|
+
status = AuditStatus.SUCCESS
|
|
230
|
+
action = AuditAction.CREATE
|
|
231
|
+
entity = EntityType.Customer
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Middleware
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
from jlframework import restrict_access_middleware, get_tenant_id
|
|
238
|
+
|
|
239
|
+
# Add tenant validation middleware
|
|
240
|
+
app.middleware("http")(restrict_access_middleware)
|
|
241
|
+
|
|
242
|
+
# Get tenant ID from request state
|
|
243
|
+
tenant_id = get_tenant_id(request)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Configuration
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
from jlframework import Settings, get_settings
|
|
250
|
+
|
|
251
|
+
# Get application settings
|
|
252
|
+
settings = get_settings()
|
|
253
|
+
print(settings.app_name)
|
|
254
|
+
print(settings.debug)
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## 🏗️ Project Structure
|
|
258
|
+
|
|
259
|
+
After running `jlframework init` and adding templates:
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
my-project/
|
|
263
|
+
├── .jlframework.json # Project configuration
|
|
264
|
+
├── README.md # Project documentation
|
|
265
|
+
├── .gitignore # Git ignore patterns
|
|
266
|
+
├── backend/ # FastAPI backend
|
|
267
|
+
│ ├── main.py
|
|
268
|
+
│ ├── routes.py
|
|
269
|
+
│ ├── requirements.txt
|
|
270
|
+
│ ├── Dockerfile
|
|
271
|
+
│ ├── configs/
|
|
272
|
+
│ ├── domains/
|
|
273
|
+
│ ├── middlewares/
|
|
274
|
+
│ └── shared/
|
|
275
|
+
└── frontend/
|
|
276
|
+
├── embedded/ # Embedded Vue.js app
|
|
277
|
+
├── features/ # Micro-frontend features
|
|
278
|
+
└── marketplace/ # Marketplace Vue.js app
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## 🔧 Configuration
|
|
282
|
+
|
|
283
|
+
### Backend Configuration
|
|
284
|
+
|
|
285
|
+
The backend template uses environment variables for configuration. Create a `.env` file:
|
|
286
|
+
|
|
287
|
+
```env
|
|
288
|
+
# Application
|
|
289
|
+
APP_NAME=My Awesome API
|
|
290
|
+
DEBUG=false
|
|
291
|
+
HOST=0.0.0.0
|
|
292
|
+
PORT=8000
|
|
293
|
+
|
|
294
|
+
# Database
|
|
295
|
+
DATABASE_URL=mssql+pyodbc://user:pass@server/db?driver=ODBC+Driver+17+for+SQL+Server
|
|
296
|
+
|
|
297
|
+
# Azure (optional)
|
|
298
|
+
AZURE_APP_CONFIG_CONNECTION_STRING=...
|
|
299
|
+
|
|
300
|
+
# MongoDB (for audit logging)
|
|
301
|
+
MONGO_CONNECTION_STRING={"connection_string": "...", "database_name": "..."}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Frontend Configuration
|
|
305
|
+
|
|
306
|
+
Frontend templates use `.env` files for configuration:
|
|
307
|
+
|
|
308
|
+
```env
|
|
309
|
+
VITE_API_URL=http://localhost:8000
|
|
310
|
+
VITE_OIDC_AUTHORITY=https://your-oidc-provider
|
|
311
|
+
VITE_OIDC_CLIENT_ID=your-client-id
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## 🐳 Docker Support
|
|
315
|
+
|
|
316
|
+
All templates include Dockerfiles for containerization:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
# Backend
|
|
320
|
+
cd backend
|
|
321
|
+
docker build -t my-backend .
|
|
322
|
+
docker run -p 8000:8000 my-backend
|
|
323
|
+
|
|
324
|
+
# Frontend
|
|
325
|
+
cd frontend/embedded
|
|
326
|
+
docker build -t my-frontend .
|
|
327
|
+
docker run -p 80:80 my-frontend
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## 🧪 Development
|
|
331
|
+
|
|
332
|
+
### Running Backend
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
cd backend
|
|
336
|
+
pip install -r requirements.txt
|
|
337
|
+
python main.py
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Running Frontend
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
cd frontend/embedded
|
|
344
|
+
npm install
|
|
345
|
+
npm run dev
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## 📝 Examples
|
|
349
|
+
|
|
350
|
+
### Complete FastAPI Application
|
|
351
|
+
|
|
352
|
+
```python
|
|
353
|
+
from fastapi import FastAPI, Request, Depends
|
|
354
|
+
from sqlalchemy.orm import Session
|
|
355
|
+
from jlframework import (
|
|
356
|
+
get_db,
|
|
357
|
+
CommonManager,
|
|
358
|
+
restrict_access_middleware,
|
|
359
|
+
database_middleware,
|
|
360
|
+
)
|
|
361
|
+
|
|
362
|
+
app = FastAPI(title="My API")
|
|
363
|
+
|
|
364
|
+
# Add middlewares
|
|
365
|
+
app.middleware("http")(database_middleware)
|
|
366
|
+
app.middleware("http")(restrict_access_middleware)
|
|
367
|
+
|
|
368
|
+
@app.get("/api/v1/customers")
|
|
369
|
+
async def get_customers(
|
|
370
|
+
request: Request,
|
|
371
|
+
db: Session = Depends(get_db)
|
|
372
|
+
):
|
|
373
|
+
tenant_id = CommonManager.get_tenant_id(request)
|
|
374
|
+
customers = db.query(Customer).filter_by(tenant_id=tenant_id).all()
|
|
375
|
+
return {"customers": customers}
|
|
376
|
+
|
|
377
|
+
if __name__ == "__main__":
|
|
378
|
+
import uvicorn
|
|
379
|
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## 🤝 Contributing
|
|
383
|
+
|
|
384
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
385
|
+
|
|
386
|
+
1. Fork the repository
|
|
387
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
388
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
389
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
390
|
+
5. Open a Pull Request
|
|
391
|
+
|
|
392
|
+
## 📄 License
|
|
393
|
+
|
|
394
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
395
|
+
|
|
396
|
+
## 🙏 Acknowledgments
|
|
397
|
+
|
|
398
|
+
- Built with [FastAPI](https://fastapi.tiangolo.com/)
|
|
399
|
+
- Frontend powered by [Vue.js](https://vuejs.org/)
|
|
400
|
+
- CLI built with [Click](https://click.palletsprojects.com/)
|
|
401
|
+
- Templates rendered with [Jinja2](https://jinja.palletsprojects.com/)
|
|
402
|
+
|
|
403
|
+
## 📞 Support
|
|
404
|
+
|
|
405
|
+
- 📧 Email: contact@jlframework.dev
|
|
406
|
+
- 🐛 Issues: [GitHub Issues](https://github.com/jlframework/jlframework/issues)
|
|
407
|
+
- 📖 Documentation: [Read the Docs](https://jlframework.readthedocs.io)
|
|
408
|
+
|
|
409
|
+
## 🗺️ Roadmap
|
|
410
|
+
|
|
411
|
+
- [ ] Additional database support (MongoDB, PostgreSQL)
|
|
412
|
+
- [ ] More frontend templates (React, Angular)
|
|
413
|
+
- [ ] Code generators for models, routes, services
|
|
414
|
+
- [ ] Database migration tools
|
|
415
|
+
- [ ] Testing utilities
|
|
416
|
+
- [ ] Deployment helpers (Kubernetes, Docker Compose)
|
|
417
|
+
- [ ] VS Code extension
|
|
418
|
+
- [ ] Web-based project configurator
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
Made with ❤️ by the JLFramework Team
|