hytek/framex
Composer 安装命令:
composer create-project hytek/framex
包简介
FrameX is a production-ready Laravel starter kit featuring Inertia, TypeScript, authentication, billing, real-time features, testing, and modern developer tooling.
README 文档
README
A modern full-stack web application built with Laravel 13, React, TypeScript, and Inertia.js. FrameX provides comprehensive team management, user authentication, billing integration, and real-time collaboration features.
Features
Core Features
- User Authentication - Secure authentication with two-factor authentication (2FA) support
- Team Management - Create, manage, and collaborate within teams
- Role-Based Access Control - Fine-grained permission system for team members
- User Profiles - Customizable user profiles with team switching
- Activity Logging - Track and audit team activities
- Notification Preferences - Configurable notification settings per user
Advanced Features
- Payment Integration - Stripe integration via Laravel Cashier for subscription management
- API Authentication - Sanctum-based API tokens for secure third-party integrations
- Real-Time Features - WebSocket support via Laravel Reverb for live updates
- File Management - Team file storage and management
- Team Invitations - Invite and manage team members with email invitations
- Two-Factor Authentication - Enhanced security with 2FA support
🚀 Tech Stack
Backend
- PHP 8.3+
- Laravel Framework 13.7 - Modern PHP web framework
- Laravel Fortify - Authentication backend
- Laravel Sanctum - API token authentication
- Laravel Cashier - Stripe payment processing
- Laravel Reverb - Real-time WebSocket server
- Pest - Modern PHP testing framework
Frontend
- React - Modern UI library
- Inertia.js - Server-driven SPA framework
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Headless UI components
- Vite - Fast build tool
Database & Tools
- Laravel Migrations - Database schema management
- Faker - Seed data generation
- Pest - Testing framework
- Laravel Pint - Code style formatter
- ESLint - JavaScript linter
- Prettier - Code formatter
📋 Project Structure
├── app/
│ ├── Actions/ # Action classes (Fortify, Teams)
│ ├── Concerns/ # Reusable traits for models
│ ├── Enums/ # Enumeration classes
│ ├── Events/ # Event classes
│ ├── Http/ # Controllers, Middleware, Requests, Responses
│ ├── Models/ # Eloquent models
│ ├── Notifications/ # Notification classes
│ ├── Policies/ # Authorization policies
│ ├── Providers/ # Service providers
│ ├── Rules/ # Custom validation rules
│ └── Support/ # Helper classes
├── bootstrap/ # Application bootstrapping
├── config/ # Configuration files
├── database/
│ ├── factories/ # Model factories
│ ├── migrations/ # Database migrations
│ └── seeders/ # Database seeders
├── public/ # Public assets
├── resources/
│ ├── css/ # Stylesheets
│ ├── js/ # React components and pages
│ └── views/ # Blade view templates
├── routes/ # Application routes
├── storage/ # Application storage
├── tests/ # Test files
│ ├── Feature/ # Feature tests
│ └── Unit/ # Unit tests
└── vendor/ # Composer dependencies
Key Models
- User - User accounts with team support, 2FA, and billing
- Team - Team records with permissions and roles
- Membership - Join table linking users to teams
- TeamInvitation - Pending team invitations
- ActivityLog - Team activity history
- TeamFile - Team file storage
- NotificationPreference - User notification settings
🔐 Authorization & Permissions
Team Roles
- Owner - Full control over team
- Admin - Administrative access
- Member - Basic member access
- Custom roles with granular permissions
Policies
- TeamPolicy - Controls team access and management
- Authorization middleware for protected routes
🛠️ Installation
Prerequisites
- PHP 8.3 or higher
- Composer
- Node.js 18+ and npm/pnpm
- Git
Setup Instructions
Creating an Application Using a Starter Kit
laravel new my-app --using=hytek/framex
Docker Setup (Optional)
./vendor/bin/sail up -d sail composer install sail npm install sail artisan migrate sail npm run dev
📦 Available Commands
Frontend Development
pnpm run dev # Start Vite dev server with hot reload pnpm run build # Build production assets pnpm run build:ssr # Build with SSR support pnpm run lint # Run ESLint with auto-fix pnpm run lint:check # Check code style without fixing pnpm run format # Format code with Prettier pnpm run format:check # Check formatting without fixing pnpm run types:check # Check TypeScript types
Backend Development
php artisan migrate # Run database migrations php artisan db:seed # Seed the database php artisan tinker # Interactive shell php artisan serve # Start development server php artisan reverb:start # Start WebSocket server php artisan horizon # Start queue worker php artisan sail up -d # Start Docker containers
Testing
./vendor/bin/pest # Run all tests ./vendor/bin/pest --filter=TestName # Run specific test ./vendor/bin/pest --coverage # Generate coverage report php artisan test # Alternative test runner
Code Quality
composer pint # Fix PHP code style pnpm run lint # Fix JavaScript/TypeScript style pnpm run format # Format code with Prettier
🔌 Configuration
Key Configuration Files
- config/app.php - Application settings
- config/auth.php - Authentication configuration
- config/database.php - Database configuration
- config/fortify.php - Fortify authentication settings
- config/inertia.php - Inertia.js settings
- config/cashier.php - Stripe payment configuration
- config/reverb.php - WebSocket configuration
Environment Variables
APP_NAME=FrameX APP_ENV=local APP_DEBUG=true APP_URL=http://localhost DB_CONNECTION=sqlite # or DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=framex DB_USERNAME=root DB_PASSWORD= STRIPE_PUBLIC_KEY=your_stripe_public_key STRIPE_SECRET_KEY=your_stripe_secret_key SANCTUM_STATEFUL_DOMAINS=localhost:3000
🧪 Testing
Running Tests
# All tests ./vendor/bin/pest # Specific test file ./vendor/bin/pest tests/Feature/AuthenticationTest.php # With coverage report ./vendor/bin/pest --coverage
Test Structure
- Feature Tests - Integration tests for API endpoints and features
- Unit Tests - Individual component and method tests
🔄 API Endpoints
Authentication
POST /login- User loginPOST /register- User registrationPOST /logout- User logoutPOST /two-factor-challenge- 2FA verification
Teams
GET /teams- List user's teamsPOST /teams- Create new teamPUT /teams/{id}- Update teamDELETE /teams/{id}- Delete team
Team Members
GET /teams/{id}/members- List team membersPOST /teams/{id}/members- Add team memberPUT /teams/{id}/members/{id}- Update member roleDELETE /teams/{id}/members/{id}- Remove member
Files
GET /teams/{id}/files- List team filesPOST /teams/{id}/files- Upload fileDELETE /teams/{id}/files/{id}- Delete file
📚 Documentation
Laravel Packages
- Laravel Documentation
- Laravel Fortify - Authentication backend
- Laravel Sanctum - API authentication
- Laravel Cashier - Payment processing
- Laravel Reverb - WebSocket server
Frontend
- Inertia.js - Server-driven SPA
- React Documentation
- TypeScript
- Tailwind CSS
- Radix UI
🚨 Troubleshooting
Common Issues
Port 3000 already in use
# Kill process on port 3000 lsof -i :3000 | grep LISTEN | awk '{print $2}' | xargs kill -9 # Or use a different port pnpm run dev -- --port 3001
Database connection error
- Verify
.envdatabase credentials - Ensure database server is running
- Check database user permissions
Node modules issues
rm -rf node_modules pnpm-lock.yaml pnpm install
Composer issues
composer clear-cache composer install
📝 Development Workflow
-
Create Feature Branch
git checkout -b feature/feature-name
-
Make Changes
- Follow PSR-12 PHP coding standards (enforced by Pint)
- Follow ESLint rules for JavaScript/TypeScript
- Write tests for new features
-
Run Code Quality Checks
composer pint pnpm run lint pnpm run format pnpm run types:check ./vendor/bin/pest
-
Commit and Push
git add . git commit -m "feat: description of changes" git push origin feature/feature-name
-
Create Pull Request
🔒 Security Considerations
- Keep Laravel and dependencies updated
- Use HTTPS in production
- Configure CORS properly for API requests
- Implement rate limiting on sensitive endpoints
- Use strong database passwords
- Keep Stripe keys secure and never commit them
- Regular security audits and vulnerability scanning
- Enable CSRF protection (default in Laravel)
- SQL injection protection via Eloquent ORM
📄 License
This project is open-source software licensed under the MIT license.
🤝 Contributing
Contributions are welcome! Please follow the development workflow:
- Fork the repository
- Create a feature branch
- Make your changes
- Ensure all tests pass and code style is correct
- Commit with clear messages
- Push to your fork
- Submit a pull request
📞 Support
For questions or issues, please:
- Check existing Issues
- Create a new issue with detailed information
- Contact the development team
🎉 Acknowledgments
Built with:
- Laravel - The PHP Framework
- React - UI Library
- Inertia.js - Modern SPA Framework
- Tailwind CSS - Utility-first CSS
- Radix UI - Headless Components
Last Updated: May 2026 Version: 1.0.0
hytek/framex 适用场景与选型建议
hytek/framex 是一款 基于 TypeScript 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「saas」 「typescript」 「cashier」 「starter-kit」 「inertia」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hytek/framex 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hytek/framex 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hytek/framex 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generate typescript rpc from php
Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.
Transforms Laravel Models to Typescript Interfaces/Types
Asaas.com PHP API v3 Wrapper
Adaptaçao Asaas.com PHP API Wrapper para PHP 5.6
Minimal Laravel authentication scaffolding with Vue, Vite, Typescript and Tailwind.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-14