create-prisma-php-app 4.0.0-alpha.9 → 4.0.0-alpha.90

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.
Files changed (80) hide show
  1. package/README.md +45 -28
  2. package/dist/.htaccess +1 -74
  3. package/dist/app-gitignore +1 -1
  4. package/dist/bootstrap.php +162 -141
  5. package/dist/index.js +1 -453
  6. package/dist/prisma-php.js +1 -60
  7. package/dist/public/.htaccess +72 -0
  8. package/dist/public/index.php +5 -0
  9. package/dist/public/js/index.js +1 -0
  10. package/dist/settings/auto-swagger-docs.ts +211 -147
  11. package/dist/settings/bs-config.json +5 -5
  12. package/dist/settings/bs-config.ts +59 -62
  13. package/dist/settings/build.ts +0 -3
  14. package/dist/settings/class-imports.ts +0 -11
  15. package/dist/settings/class-log.ts +169 -70
  16. package/dist/settings/component-import-checker.ts +14 -6
  17. package/dist/settings/files-list.ts +13 -15
  18. package/dist/settings/paths.php +36 -12
  19. package/dist/settings/prisma-schema-config.json +15 -15
  20. package/dist/settings/project-name.ts +4 -14
  21. package/dist/settings/restart-mcp.ts +54 -0
  22. package/dist/settings/restart-websocket.ts +39 -45
  23. package/dist/settings/swagger-config.ts +5 -7
  24. package/dist/settings/utils.ts +231 -6
  25. package/dist/src/Lib/Auth/Auth.php +4 -4
  26. package/dist/src/Lib/MCP/WeatherTools.php +104 -0
  27. package/dist/src/Lib/MCP/mcp-server.php +80 -0
  28. package/dist/src/Lib/Middleware/AuthMiddleware.php +7 -4
  29. package/dist/src/Lib/Middleware/CorsMiddleware.php +130 -0
  30. package/dist/src/Lib/Websocket/websocket-server.php +106 -14
  31. package/dist/src/app/error.php +1 -1
  32. package/dist/src/app/index.php +24 -9
  33. package/dist/src/app/layout.php +3 -3
  34. package/package.json +1 -1
  35. package/composer.json +0 -27
  36. package/composer.lock +0 -884
  37. package/dist/settings/restart-websocket.bat +0 -28
  38. package/dist/src/Lib/AI/ChatGPTClient.php +0 -147
  39. package/dist/src/Lib/CacheHandler.php +0 -121
  40. package/dist/src/Lib/ErrorHandler.php +0 -322
  41. package/dist/src/Lib/FileManager/UploadFile.php +0 -383
  42. package/dist/src/Lib/Headers/Boom.php +0 -208
  43. package/dist/src/Lib/IncludeTracker.php +0 -59
  44. package/dist/src/Lib/MainLayout.php +0 -215
  45. package/dist/src/Lib/PHPMailer/Mailer.php +0 -169
  46. package/dist/src/Lib/PHPX/Exceptions/ComponentValidationException.php +0 -49
  47. package/dist/src/Lib/PHPX/IPHPX.php +0 -22
  48. package/dist/src/Lib/PHPX/PHPX.php +0 -173
  49. package/dist/src/Lib/PHPX/TemplateCompiler.php +0 -584
  50. package/dist/src/Lib/PHPX/TwMerge.php +0 -195
  51. package/dist/src/Lib/PHPX/TypeCoercer.php +0 -490
  52. package/dist/src/Lib/PartialRenderer.php +0 -40
  53. package/dist/src/Lib/PrismaPHPSettings.php +0 -181
  54. package/dist/src/Lib/Request.php +0 -476
  55. package/dist/src/Lib/Set.php +0 -102
  56. package/dist/src/Lib/StateManager.php +0 -127
  57. package/dist/src/Lib/Validator.php +0 -738
  58. package/dist/src/app/assets/images/prisma-php-black.svg +0 -6
  59. package/dist/src/app/js/index.js +0 -1
  60. package/dist/src/app/js/json5.min.js +0 -1
  61. package/dist/src/app/js/morphdom-umd.min.js +0 -1
  62. package/vendor/autoload.php +0 -25
  63. package/vendor/composer/ClassLoader.php +0 -579
  64. package/vendor/composer/InstalledVersions.php +0 -359
  65. package/vendor/composer/LICENSE +0 -21
  66. package/vendor/composer/autoload_classmap.php +0 -10
  67. package/vendor/composer/autoload_namespaces.php +0 -9
  68. package/vendor/composer/autoload_psr4.php +0 -10
  69. package/vendor/composer/autoload_real.php +0 -38
  70. package/vendor/composer/autoload_static.php +0 -25
  71. package/vendor/composer/installed.json +0 -825
  72. package/vendor/composer/installed.php +0 -132
  73. package/vendor/composer/platform_check.php +0 -26
  74. /package/dist/{src/app → public}/assets/images/file.svg +0 -0
  75. /package/dist/{src/app → public}/assets/images/globe.svg +0 -0
  76. /package/dist/{src/app → public}/assets/images/prisma-php.svg +0 -0
  77. /package/dist/{src/app → public}/assets/images/window.svg +0 -0
  78. /package/dist/{src/app → public}/css/index.css +0 -0
  79. /package/dist/{src/app → public}/css/styles.css +0 -0
  80. /package/dist/src/app/{css/tailwind.css → globals.css} +0 -0
package/README.md CHANGED
@@ -1,63 +1,80 @@
1
1
  # 🚀 Create Prisma PHP App
2
2
 
3
- **Prisma PHP**: The Next-Gen Framework Merging PHP’s Power with Prisma's ORM Mastery
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 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.
9
+ `create-prisma-php-app` is a game-changing CLI 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
10
 
11
- ### **Why Choose Prisma PHP?**
11
+ ---
12
+
13
+ ## ✨ Why Choose Prisma PHP?
12
14
 
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.
15
+ - **Effortless Routing:** Manage complex routes with ease, supporting dynamic patterns and nested structures.
16
+ - 🧩 **Component-Based Architecture:** Integrate reusable components effortlessly, just like React.
17
+ - 🛠️ **Flexible Integration:** Choose and integrate only the packages you need, such as:
18
+ - 🧁 **Tailwind CSS** for modern UI styling.
19
+ - 📘 **Swagger Docs** for powerful API documentation.
20
+ - 🔌 **WebSocket** for real-time interactions.
21
+ - 🧠 **MCP (Model Context Protocol)** for AI tool and LLM integration.
22
+ - 🚀 **Prisma ORM** for robust database management.
23
+ - 🔐 **Out-of-the-Box Authentication:** Role-based sign-in and sign-out mechanisms ready to go.
24
+ - 🚀 **Advanced Caching:** Supercharge performance with built-in caching options.
25
+
26
+ ---
22
27
 
23
- ## Quick Start
28
+ ## ⚙️ Quick Start
24
29
 
25
- Creating a new Prisma PHP project is just one command away! Get started by running the following command in your terminal:
30
+ Creating a new Prisma PHP project is just one command away!
26
31
 
27
32
  ```bash
28
33
  npx create-prisma-php-app@latest
29
34
  ```
30
35
 
31
- This interactive process will prompt you for key setup options, including Tailwind CSS integration and other essential features.
36
+ This interactive process will prompt you for setup options like Tailwind CSS, Swagger, Prisma ORM, and other essential features.
37
+
38
+ Example:
32
39
 
33
40
  ```bash
34
41
  ✔ Would you like to use Tailwind CSS? … No / Yes
42
+ ✔ Would you like to use Swagger Docs? … No / Yes
43
+ ✔ Would you like to use MCP (Model Context Protocol)? … No / Yes
44
+ ✔ Would you like to use Prisma PHP ORM? … No / Yes
35
45
  ```
36
46
 
37
- Select "Yes" to include Tailwind CSS in your project.
38
-
39
47
  ## 📚 Documentation
40
48
 
41
- For comprehensive guides and full documentation, visit the [Prisma PHP](https://prismaphp.tsnc.tech/) website
49
+ Full docs and guides available at: [https://prismaphp.tsnc.tech](https://prismaphp.tsnc.tech)
42
50
 
43
- ## 🎥 Video Tutorial
51
+ ---
44
52
 
45
- Prefer a visual walkthrough? Check out our video series for a step-by-step guide on how to use `create-prisma-php-app`:
53
+ ## 🎥 Video Tutorials
46
54
 
47
- [Watch the Prisma PHP Video Series](https://www.youtube.com/playlist?list=PLS-62wu4j8sS0Ia7ZkWHQ41W85Ice85PA)
55
+ Check out our complete step-by-step video series here:
56
+ [📺 Prisma PHP YouTube Series](https://www.youtube.com/playlist?list=PLS-62wu4j8sS0Ia7ZkWHQ41W85Ice85PA)
48
57
 
49
- ## 💡 Contributing
58
+ ---
50
59
 
51
- We welcome contributions to improve `create-prisma-php-app`. If you have ideas, found bugs, or want to make improvements, feel free to open an issue or submit a pull request on the repository.
60
+ ## 🤝 Contributing
61
+
62
+ We welcome contributions! Please feel free to open issues and submit pull requests on GitHub to help improve the project.
63
+
64
+ ---
52
65
 
53
66
  ## 📄 License
54
67
 
55
- `create-prisma-php-app` is under the MIT License. See LICENSE for details.
68
+ This project is licensed under the **MIT License**.
69
+
70
+ ---
56
71
 
57
72
  ## 👤 Author
58
73
 
59
- This project is developed and maintained by [The Steel Ninja Code](https://thesteelninjacode.com/), continuously pushing the boundaries of PHP development.
74
+ Created and maintained with ❤️ by The Steel Ninja Code.
75
+
76
+ ---
60
77
 
61
- ## 📧 Contact Us
78
+ ## 📬 Contact
62
79
 
63
- Got questions or feedback? Reach out to us at [thesteelninjacode@gmail.com](mailto:thesteelninjacode@gmail.com). We’d love to hear from you!
80
+ Got questions or feedback? Reach us at [thesteelninjacode@gmail.com](mailto:thesteelninjacode@gmail.com)
package/dist/.htaccess CHANGED
@@ -1,75 +1,2 @@
1
- # Turn on rewrite engine
2
1
  RewriteEngine On
3
-
4
- # Prevent access to sensitive files
5
- <FilesMatch "(^\.htaccess|\.git|\.env|composer\.(json|lock)|package(-lock)?\.json|phpunit\.xml)$">
6
- Order allow,deny
7
- Deny from all
8
- </FilesMatch>
9
-
10
- # Allow cross-origin requests (CORS) for all routes
11
- <IfModule mod_headers.c>
12
- Header set Access-Control-Allow-Origin "*"
13
- Header set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS"
14
- Header set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"
15
- </IfModule>
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
- # Set Content Security Policy (CSP) headers to prevent XSS attacks while allowing CDNs
36
- <IfModule mod_headers.c>
37
- Header set Content-Security-Policy "\
38
- default-src 'self' https:; \
39
- script-src 'self' https: 'unsafe-inline' 'unsafe-eval' blob:; \
40
- style-src 'self' https: 'unsafe-inline'; \
41
- img-src 'self' data: https:; \
42
- connect-src 'self' ws: wss:; \
43
- form-action 'self'; \
44
- object-src 'none';"
45
- </IfModule>
46
-
47
- # Add important security headers
48
- <IfModule mod_headers.c>
49
- # Enforce HTTPS and prevent protocol downgrade attacks
50
- Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
51
-
52
- # Protect against Cross-Site Scripting (XSS) attacks
53
- Header set X-XSS-Protection "1; mode=block"
54
-
55
- # Prevent MIME-type sniffing
56
- Header set X-Content-Type-Options "nosniff"
57
-
58
- # Clickjacking protection
59
- Header always set X-Frame-Options "DENY"
60
-
61
- # Set a strict Referrer Policy
62
- Header set Referrer-Policy "strict-origin-when-cross-origin"
63
-
64
- # Control browser permissions (optional but recommended)
65
- Header set Permissions-Policy "geolocation=(), microphone=(), camera=(), autoplay=()"
66
- </IfModule>
67
-
68
- # Exclude static files from being redirected
69
- RewriteCond %{REQUEST_URI} !\.(css|js|png|jpe?g|gif|svg|webp|woff2?|ttf|eot|ico|pdf|mp4|webm|mp3|ogg)$ [NC]
70
- RewriteCond %{REQUEST_URI} !^/bootstrap.php
71
- RewriteRule ^(.*)$ bootstrap.php [QSA,L]
72
-
73
- # Ensure OPTIONS requests are handled correctly
74
- RewriteCond %{REQUEST_METHOD} OPTIONS
75
- RewriteRule ^ - [R=200,L]
2
+ RewriteRule ^(.*)$ public/$1 [QSA,L]
@@ -29,6 +29,6 @@ composer.lock
29
29
  *.swp
30
30
 
31
31
  # Prisma PHP settings files
32
- .pphp/
32
+ .pp/
33
33
  caches/
34
34
  settings/bs-config.json