Metadata-Version: 2.4
Name: aipostify
Version: 1.0.3
Summary: Laravel-Style Python MVC Framework with PTL (Postify Template Language)
Author: AIPostify Contributors
License-Expression: MIT
Project-URL: Homepage, https://github.com/aipostify/aipostify
Project-URL: Documentation, https://github.com/aipostify/aipostify#readme
Project-URL: Repository, https://github.com/aipostify/aipostify.git
Project-URL: Issues, https://github.com/aipostify/aipostify/issues
Keywords: laravel,python,mvc,django,ptl,blade,artisan,template-engine,web-framework
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Framework :: Django
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Environment :: Web Environment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django<6.2,>=5.0
Requires-Dist: PyMySQL>=1.1.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: pytest>=8.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# AIPostify – Laravel-Style Python MVC Framework

> Brings the elegant, productive developer experience of **Laravel** (`artisan`, `.env`, `routes/web.py`, Controllers, Models, Migrations, Seeders) to **Python and Django**, powered by **PTL (Postify Template Language)**.

---

## 🚀 Key Features

- **PTL (Postify Template Language):** Native `.ptl` view engine with Blade-like `@if`, `@foreach`, `@extends`, `<x-components>`, pipe filters (`| upper`), and auto-escaped security.
- **Zero Django Boilerplate:** Never edit `settings.py`, `INSTALLED_APPS`, or `urls.py`. Core configuration is completely abstracted.
- **Artisan CLI Engine:** Run `python artisan make:...`, `python artisan migrate`, `python artisan db:...`, and `python artisan serve`.
- **Instant SQLite ↔ MySQL Switching:** Switch databases effortlessly by changing `DB_CONNECTION=sqlite` to `DB_CONNECTION=mysql` in `.env`.
- **Docker-Free & Dependency-Light:** Runs locally on SQLite with zero external services required.
- **Auto-Discovery Engine:** Automatically scans and connects models in `app/models/`, controllers in `app/http/controllers/`, commands in `app/console/commands/`, and views in `resources/views/`.
- **Database Queue & Task Scheduler:** Integrated database queue worker (`python artisan queue:work`) and cron task runner (`python artisan schedule:run`).
- **Automatic VS Code Tooling:** Automatic syntax highlighting, `{ P }` file icon, and snippet setup on first run/clone.

---

## 📁 Directory Structure

```text
aipostify/
├── artisan                          # CLI entry point (python artisan ...)
├── .env                             # Environment configuration
├── .env.example
├── .gitattributes                   # GitHub language syntax detection
├── .vscode/                         # VS Code settings & extensions
├── requirements.txt
├── app/                             # User Application Code
│   ├── http/
│   │   ├── controllers/             # Controller, WelcomeController
│   │   ├── middleware/              # Custom HTTP Middlewares
│   │   └── requests/                # Form validation classes
│   ├── models/                      # User model
│   ├── services/                    # Application services
│   ├── jobs/                        # Queueable background jobs
│   └── console/commands/            # Custom Artisan CLI commands
├── config/                          # app.py, database.py, queue.py, mail.py
├── database/
│   ├── migrations/                  # Database migrations (0001_initial.py)
│   ├── seeders/                     # DatabaseSeeder, UserSeeder
│   └── database.sqlite              # Default SQLite database file
├── resources/
│   ├── views/                       # PTL Templates (.ptl)
│   │   ├── components/              # Reusable <x-component> templates
│   │   ├── layouts/app.ptl          # Base layout template
│   │   └── welcome.ptl              # Welcome landing page
│   └── lang/                        # en.json, gu.json, hi.json
├── routes/
│   ├── web.py                       # Web routes (Route.get, Route.resource)
│   ├── api.py                       # API routes (prefixed with /api)
│   └── console.py                   # Scheduled tasks
├── public/                          # Static assets (css, js)
├── storage/                         # App logs, sessions, and view cache
├── tools/
│   └── vscode-postify/              # PTL VS Code Extension (Icon + Grammar)
└── tests/                           # Pytest test suite
```

---

## ⚡ Quick Start

### 1. Installation
```bash
# Clone the repository
git clone <repo-url> myapp && cd myapp

# Install dependencies
pip install -r requirements.txt

# Setup environment key and database
cp .env.example .env
python artisan key:generate
python artisan migrate
python artisan db:seed
```

### 2. Start Development Server
```bash
python artisan serve
```
Open [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser.

---

## 🛠️ Artisan CLI Commands

| Command | Description |
|---|---|
| `python artisan list` | Display all available commands |
| `python artisan serve [--host --port]` | Start development server with live reload |
| `python artisan route:list` | Show all registered routes in a formatted table |
| `python artisan make:view <name>` | Generate new `.ptl` template view |
| `python artisan make:component <name>`| Generate new `.ptl` component |
| `python artisan make:layout <name>` | Generate new `.ptl` layout |
| `python artisan view:cache` | Compile and cache all PTL templates |
| `python artisan view:clear` | Clear compiled template cache |
| `python artisan view:check` | Validate syntax of all PTL templates |
| `python artisan ptl:install-vscode` | Install PTL VS Code extension (Icon + Grammar) |
| `python artisan make:model <Model>` | Create new Eloquent-style model |
| `python artisan make:controller <Name>`| Create standard or resource controller |
| `python artisan make:crud <Model>` | Scaffold full CRUD resource in 1 command |
| `python artisan make:migration <name>` | Generate database migration |
| `python artisan make:auth` | Scaffold complete authentication system |
| `python artisan migrate` | Run pending database migrations |
| `python artisan migrate:fresh [--seed]` | Drop all tables and re-run all migrations |
| `python artisan db:check` | Diagnose database connection and health |
| `python artisan db:seed` | Run seeders |
| `python artisan queue:work` | Start background queue worker daemon |
| `python artisan schedule:run` | Execute scheduled cron tasks |
| `python artisan tinker` | Interactive Python REPL with models preloaded |
| `python artisan test` | Run pytest test suite |

---

## 🧪 Running Tests

```bash
python artisan test
# or
pytest
```
