create-prisma-php-app 1.28.8 → 2.0.0-alpha.10
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.
- package/README.md +17 -5
- package/composer.json +8 -6
- package/dist/.htaccess +49 -4
- package/dist/bootstrap.php +652 -682
- package/dist/index.js +78 -58
- package/dist/postcss.config.js +4 -6
- package/dist/prisma-php.js +2 -42
- package/dist/settings/project-name.ts +26 -2
- package/dist/src/Lib/AI/ChatGPTClient.php +32 -103
- package/dist/src/Lib/CacheHandler.php +121 -0
- package/dist/src/Lib/ErrorHandler.php +123 -0
- package/dist/src/Lib/MainLayout.php +23 -22
- package/dist/src/Lib/PHPX/TemplateCompiler.php +47 -24
- package/dist/src/Lib/PHPX/TwMerge.php +7 -1
- package/dist/src/Lib/PrismaPHPSettings.php +44 -9
- package/dist/src/Lib/Request.php +33 -37
- package/dist/src/Lib/Validator.php +35 -7
- package/dist/src/app/css/tailwind.css +1 -3
- package/dist/src/app/index.php +2 -2
- package/dist/src/app/js/index.js +12 -1
- package/dist/src/app/layout.php +4 -7
- package/dist/src/app/not-found.php +1 -1
- package/package.json +1 -1
- package/tsconfig.json +5 -6
- package/dist/prisma/schema.prisma +0 -37
- package/dist/prisma/seed.ts +0 -74
- package/dist/prisma-client-php/index.enc +0 -1
- package/dist/prisma-client-php/index.js +0 -19
- package/dist/prisma-client-php/key.enc +0 -1
- package/dist/settings/prisma-schema.json +0 -103
- package/dist/settings/prisma-sdk.ts +0 -24
- package/dist/src/Lib/Prisma/Classes/PPHPUtility.php +0 -725
- package/dist/src/Lib/Prisma/Model/IModel.php +0 -20
- package/dist/tailwind.config.js +0 -8
package/README.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
# Create Prisma PHP App
|
|
1
|
+
# 🚀 Create Prisma PHP App
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Prisma PHP**: The Next-Gen Framework Merging PHP’s Power with Prisma's ORM Mastery
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
## Introduction
|
|
7
|
+
## **Introduction**
|
|
8
8
|
|
|
9
|
-
`create-prisma-php-app` is a
|
|
9
|
+
`create-prisma-php-app` is a game-changing command-line tool tailored for modern PHP developers. It seamlessly merges the power of PHP with Prisma's ORM excellence, delivering an unparalleled development experience. From blazing-fast routing to dynamic component-based integration, Prisma PHP revolutionizes how you build web applications—just like Next.js and React, but with PHP's unmatched server-side power.
|
|
10
|
+
|
|
11
|
+
### **Why Choose Prisma PHP?**
|
|
12
|
+
|
|
13
|
+
- **Effortless Routing:** Manage complex routes with ease, supporting dynamic patterns and nested structures.
|
|
14
|
+
- **Component-Based Architecture:** Integrate reusable components effortlessly, just like React.
|
|
15
|
+
- **Flexible Integration:** Choose and integrate only the packages you need, such as:
|
|
16
|
+
- 🧁 **Tailwind CSS** for modern UI styling
|
|
17
|
+
- 📘 **Swagger Docs** for powerful API documentation
|
|
18
|
+
- 🔌 **WebSocket** for real-time interactions
|
|
19
|
+
- 🚀 **Prisma ORM** for robust database management
|
|
20
|
+
- **Out-of-the-Box Authentication:** Role-based sign-in and sign-out mechanisms ready to go.
|
|
21
|
+
- **Advanced Caching:** Supercharge performance with built-in caching options.
|
|
10
22
|
|
|
11
23
|
## Quick Start
|
|
12
24
|
|
package/composer.json
CHANGED
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
}
|
|
16
16
|
],
|
|
17
17
|
"require": {
|
|
18
|
-
"php": "^8.
|
|
19
|
-
"vlucas/phpdotenv": "^5.6
|
|
20
|
-
"firebase/php-jwt": "
|
|
21
|
-
"phpmailer/phpmailer": "^6.9",
|
|
22
|
-
"guzzlehttp/guzzle": "7.
|
|
23
|
-
"ezyang/htmlpurifier": "^4.
|
|
18
|
+
"php": "^8.2",
|
|
19
|
+
"vlucas/phpdotenv": "^5.6.1",
|
|
20
|
+
"firebase/php-jwt": "^6.10.2",
|
|
21
|
+
"phpmailer/phpmailer": "^6.9.3",
|
|
22
|
+
"guzzlehttp/guzzle": "^7.9.2",
|
|
23
|
+
"ezyang/htmlpurifier": "^4.18.0",
|
|
24
|
+
"symfony/uid": "^7.2.0",
|
|
25
|
+
"brick/math": "^0.12.1"
|
|
24
26
|
}
|
|
25
27
|
}
|
package/dist/.htaccess
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Turn on rewrite engine
|
|
2
2
|
RewriteEngine On
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
<
|
|
4
|
+
# Prevent access to sensitive files
|
|
5
|
+
<FilesMatch "(^\.htaccess|\.git|\.env|composer\.(json|lock)|package(-lock)?\.json|phpunit\.xml)$">
|
|
6
6
|
Order allow,deny
|
|
7
7
|
Deny from all
|
|
8
|
-
</
|
|
8
|
+
</FilesMatch>
|
|
9
9
|
|
|
10
10
|
# Allow cross-origin requests (CORS) for all routes
|
|
11
11
|
<IfModule mod_headers.c>
|
|
@@ -14,11 +14,56 @@ RewriteEngine On
|
|
|
14
14
|
Header set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"
|
|
15
15
|
</IfModule>
|
|
16
16
|
|
|
17
|
+
# Set Content-Type with charset UTF-8 for HTML, CSS, and JS files
|
|
18
|
+
<IfModule mod_headers.c>
|
|
19
|
+
# For HTML files
|
|
20
|
+
<FilesMatch "\.(html|htm)$">
|
|
21
|
+
Header set Content-Type "text/html; charset=UTF-8"
|
|
22
|
+
</FilesMatch>
|
|
23
|
+
|
|
24
|
+
# For CSS files
|
|
25
|
+
<FilesMatch "\.(css)$">
|
|
26
|
+
Header set Content-Type "text/css; charset=UTF-8"
|
|
27
|
+
</FilesMatch>
|
|
28
|
+
|
|
29
|
+
# For JavaScript files
|
|
30
|
+
<FilesMatch "\.(js)$">
|
|
31
|
+
Header set Content-Type "application/javascript; charset=UTF-8"
|
|
32
|
+
</FilesMatch>
|
|
33
|
+
</IfModule>
|
|
34
|
+
|
|
35
|
+
# Add important security headers
|
|
36
|
+
<IfModule mod_headers.c>
|
|
37
|
+
# Enforce HTTPS and prevent protocol downgrade attacks
|
|
38
|
+
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
|
39
|
+
|
|
40
|
+
# Protect against Cross-Site Scripting (XSS) attacks
|
|
41
|
+
Header set X-XSS-Protection "1; mode=block"
|
|
42
|
+
|
|
43
|
+
# Prevent MIME-type sniffing
|
|
44
|
+
Header set X-Content-Type-Options "nosniff"
|
|
45
|
+
|
|
46
|
+
# Clickjacking protection
|
|
47
|
+
Header always set X-Frame-Options "DENY"
|
|
48
|
+
|
|
49
|
+
# Implement a basic Content Security Policy (CSP)
|
|
50
|
+
Header set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:;"
|
|
51
|
+
|
|
52
|
+
# Restrict form submissions
|
|
53
|
+
Header set Content-Security-Policy "form-action 'self'"
|
|
54
|
+
|
|
55
|
+
# Set a strict Referrer Policy
|
|
56
|
+
Header set Referrer-Policy "strict-origin-when-cross-origin"
|
|
57
|
+
|
|
58
|
+
# Control browser permissions (optional but recommended)
|
|
59
|
+
Header set Permissions-Policy "geolocation=(), microphone=(), camera=(), autoplay=()"
|
|
60
|
+
</IfModule>
|
|
61
|
+
|
|
17
62
|
# Exclude static files from being redirected
|
|
18
63
|
RewriteCond %{REQUEST_URI} !\.(css|js|png|jpe?g|gif|svg|webp|woff2?|ttf|eot|ico|pdf|mp4|webm|mp3|ogg)$ [NC]
|
|
19
64
|
RewriteCond %{REQUEST_URI} !^/bootstrap.php
|
|
20
65
|
RewriteRule ^(.*)$ bootstrap.php [QSA,L]
|
|
21
66
|
|
|
22
|
-
#
|
|
67
|
+
# Ensure OPTIONS requests are handled correctly
|
|
23
68
|
RewriteCond %{REQUEST_METHOD} OPTIONS
|
|
24
69
|
RewriteRule ^ - [R=200,L]
|