A complete Python framework for full-stack development with FastAPI and Vue.js
Project description
JLFramework
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.
โจ Features
- ๐ Rapid Scaffolding - Create full-stack projects in under 5 minutes
- ๐๏ธ Production-Ready Templates - FastAPI backend + Vue.js frontends with best practices
- ๐ง Flexible & Modular - Use only what you need, mix and match templates
- ๐ฆ Batteries Included - Database, auth, logging, middleware, and more
- ๐ Django-like Experience - Clean imports and intuitive CLI commands
- ๐จ Multiple Frontend Options - Embedded, features, and marketplace templates
- ๐ Security First - Tenant isolation, OIDC auth, audit logging built-in
- ๐ณ Docker Ready - Dockerfiles included for all templates
๐ฆ Installation
pip install jlframework
๐ Quick Start
Create a New Project
# Initialize a new project
jlframework init my-awesome-app
cd my-awesome-app
# Add backend
jlframework add backend
# Add frontend
jlframework add frontend-embedded
# List available templates
jlframework list
Use Importable Utilities
from fastapi import FastAPI, Request, Depends
from sqlalchemy.orm import Session
from jlframework import (
get_db,
CommonManager,
AuditManager,
AuditStatus,
AuditAction,
EntityType,
restrict_access_middleware,
)
app = FastAPI()
# Add middleware
app.middleware("http")(restrict_access_middleware)
@app.get("/api/v1/items")
async def get_items(
request: Request,
db: Session = Depends(get_db)
):
# Get tenant ID from request
tenant_id = CommonManager.get_tenant_id(request)
# Query database
items = db.query(Item).filter_by(tenant_id=tenant_id).all()
return {"items": items}
๐ Available Templates
Backend
FastAPI backend with:
- Domain-driven design structure
- SQLAlchemy ORM with multiple database support
- Tenant-based access control middleware
- Audit logging with MongoDB
- Azure integration (optional)
- Docker support
- Environment-based configuration
Frontend - Embedded
Vue.js 3 embedded application with:
- Vite build system
- TypeScript support
- Vue Router
- OIDC authentication (optional)
- API service layer
- Tailwind CSS
- Docker + Nginx deployment
Frontend - Features
Vue.js 3 micro-frontend features:
- Modular component architecture
- Custom event system
- Shared state management
- Independent deployment
Frontend - Marketplace
Vue.js 3 marketplace application:
- Full marketplace UI
- Product catalog
- User management
- OIDC authentication
๐ฏ CLI Commands
jlframework init
Initialize a new project with configuration files.
jlframework init my-project
jlframework init my-project --no-git # Skip git initialization
jlframework add
Add a template to your project.
jlframework add backend
jlframework add frontend-embedded
jlframework add frontend-features
jlframework add frontend-marketplace
jlframework add backend --skip-install # Skip dependency installation
jlframework list
List all available templates.
jlframework list
๐ Importable Utilities
Database
from jlframework import get_db, get_db_session, database_middleware
# Use as FastAPI dependency
@app.get("/items")
def get_items(db: Session = Depends(get_db)):
return db.query(Item).all()
# Use as middleware
app.middleware("http")(database_middleware)
Handlers
from jlframework import CommonManager, AuditManager, AuditData
# Get tenant ID from request
tenant_id = CommonManager.get_tenant_id(request)
# Get client information
client_info = CommonManager.get_client_info(request)
# Validate pagination
CommonManager.validate_pagination(page_index=1, page_size=50)
# Audit logging
audit = AuditManager(app_id=1, tenant_id=tenant_id, mongo_connection_string=config)
await audit.save_audit(AuditData(...))
Enums
from jlframework import AuditStatus, AuditAction, EntityType
# Use in your code
status = AuditStatus.SUCCESS
action = AuditAction.CREATE
entity = EntityType.Customer
Middleware
from jlframework import restrict_access_middleware, get_tenant_id
# Add tenant validation middleware
app.middleware("http")(restrict_access_middleware)
# Get tenant ID from request state
tenant_id = get_tenant_id(request)
Configuration
from jlframework import Settings, get_settings
# Get application settings
settings = get_settings()
print(settings.app_name)
print(settings.debug)
๐๏ธ Project Structure
After running jlframework init and adding templates:
my-project/
โโโ .jlframework.json # Project configuration
โโโ README.md # Project documentation
โโโ .gitignore # Git ignore patterns
โโโ backend/ # FastAPI backend
โ โโโ main.py
โ โโโ routes.py
โ โโโ requirements.txt
โ โโโ Dockerfile
โ โโโ configs/
โ โโโ domains/
โ โโโ middlewares/
โ โโโ shared/
โโโ frontend/
โโโ embedded/ # Embedded Vue.js app
โโโ features/ # Micro-frontend features
โโโ marketplace/ # Marketplace Vue.js app
๐ง Configuration
Backend Configuration
The backend template uses environment variables for configuration. Create a .env file:
# Application
APP_NAME=My Awesome API
DEBUG=false
HOST=0.0.0.0
PORT=8000
# Database
DATABASE_URL=mssql+pyodbc://user:pass@server/db?driver=ODBC+Driver+17+for+SQL+Server
# Azure (optional)
AZURE_APP_CONFIG_CONNECTION_STRING=...
# MongoDB (for audit logging)
MONGO_CONNECTION_STRING={"connection_string": "...", "database_name": "..."}
Frontend Configuration
Frontend templates use .env files for configuration:
VITE_API_URL=http://localhost:8000
VITE_OIDC_AUTHORITY=https://your-oidc-provider
VITE_OIDC_CLIENT_ID=your-client-id
๐ณ Docker Support
All templates include Dockerfiles for containerization:
# Backend
cd backend
docker build -t my-backend .
docker run -p 8000:8000 my-backend
# Frontend
cd frontend/embedded
docker build -t my-frontend .
docker run -p 80:80 my-frontend
๐งช Development
Running Backend
cd backend
pip install -r requirements.txt
python main.py
Running Frontend
cd frontend/embedded
npm install
npm run dev
๐ Examples
Complete FastAPI Application
from fastapi import FastAPI, Request, Depends
from sqlalchemy.orm import Session
from jlframework import (
get_db,
CommonManager,
restrict_access_middleware,
database_middleware,
)
app = FastAPI(title="My API")
# Add middlewares
app.middleware("http")(database_middleware)
app.middleware("http")(restrict_access_middleware)
@app.get("/api/v1/customers")
async def get_customers(
request: Request,
db: Session = Depends(get_db)
):
tenant_id = CommonManager.get_tenant_id(request)
customers = db.query(Customer).filter_by(tenant_id=tenant_id).all()
return {"customers": customers}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
๐ Support
- ๐ง Email: Shamsh@joblogic.com
- ๐จโ๐ป Developer: Shamasulhaq
- ๐ Issues: GitHub Issues
- ๐ Documentation: Read the Docs
๐บ๏ธ Roadmap
- Additional database support (MongoDB, PostgreSQL)
- More frontend templates (React, Angular)
- Code generators for models, routes, services
- Database migration tools
- Testing utilities
- Deployment helpers (Kubernetes, Docker Compose)
- VS Code extension
- Web-based project configurator
Made with โค๏ธ by the JLFramework Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jlframework-1.0.7.tar.gz.
File metadata
- Download URL: jlframework-1.0.7.tar.gz
- Upload date:
- Size: 211.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9f2339b60ed3b0834e6353f7b2731418860f0b6c1d9282c5847d4feb5e8f08b
|
|
| MD5 |
fd39f9e948ff982c8049c533f85481f1
|
|
| BLAKE2b-256 |
0a931c4c28d25be823309560b1d7c35fb11fbc3e0aed45614bb18025c4ae8221
|
File details
Details for the file jlframework-1.0.7-py3-none-any.whl.
File metadata
- Download URL: jlframework-1.0.7-py3-none-any.whl
- Upload date:
- Size: 248.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a929043ccda8b9c581b06d0170a30b384e4b018d500b468c6bb505bc14f96e2d
|
|
| MD5 |
18d11bfc9fe336838abd2d66569d06d9
|
|
| BLAKE2b-256 |
f1215fde73581bf7c972e265ed605fbc5a8d7431d888f8f8e36b2cf123708e77
|