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 CHANGED
@@ -1,12 +1,24 @@
1
- # Create Prisma PHP App
1
+ # 🚀 Create Prisma PHP App
2
2
 
3
- 🚀 Launch Your Next-Level PHP Project with Prisma PHP
3
+ **Prisma PHP**: The Next-Gen Framework Merging PHP’s Power with Prisma's ORM Mastery
4
4
 
5
- **Prisma PHP**: A Cutting-Edge Framework Merging PHP's Power with Prisma's ORM Excellence
5
+ ---
6
6
 
7
- ## Introduction
7
+ ## **Introduction**
8
8
 
9
- `create-prisma-php-app` is a groundbreaking command-line tool designed to empower PHP developers with the modern ORM capabilities of Prisma. With this tool, you’ll be able to harness the full potential of PHP’s server-side robustness alongside Prisma’s cutting-edge database management. Whether you’re working on small-scale projects or building complex, enterprise-level applications, `create-prisma-php-app` offers unmatched flexibility and ease to elevate your development experience.
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.1",
19
- "vlucas/phpdotenv": "^5.6@dev",
20
- "firebase/php-jwt": "dev-main",
21
- "phpmailer/phpmailer": "^6.9",
22
- "guzzlehttp/guzzle": "7.8",
23
- "ezyang/htmlpurifier": "^4.17"
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
- # Deny access to .env file for security
5
- <Files .env>
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
- </Files>
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
- # Add this to ensure OPTIONS requests are handled correctly
67
+ # Ensure OPTIONS requests are handled correctly
23
68
  RewriteCond %{REQUEST_METHOD} OPTIONS
24
69
  RewriteRule ^ - [R=200,L]