3.2 KiB
3.2 KiB
Component-Based Laravel Infrastructure Project Progress Summary
Technical Environment
- Laravel 10
- PostgreSQL 12 (dev) / 16 (prod)
- PHP 8.1
- Ubuntu 22.04 (dev) / Alma Linux (prod)
Database Schema Implementation
-
Created and using schemas:
- public: Laravel system tables
- auth: Role/permission tables
- org: Organization structure tables
-
Key Tables Created:
- public.users
- auth.roles
- auth.permissions
- auth.role_permissions
- org.tbl_stores
- org.tbl_user_access_roles (with constraint requiring store_id OR group_id)
Component Structure
app/
├── Components/
│ ├── Api/ # API functionality
│ │ ├── Http/
│ │ │ ├── Controllers/
│ │ │ │ └── v1/ # Version-specific controllers
│ │ │ └── Middleware/
│ │ └── routes/
│ │ └── v1/
│ └── Admin/ # Admin interface
│ ├── Http/
│ │ └── Controllers/
│ ├── Providers/
│ └── resources/
└── views/
Current Working State
- API endpoints functional with versioning and authentication
- Admin interface operating with:
- User CRUD complete
- Role CRUD complete
- Permission CRUD complete
- Role-to-user assignments partially working (needs store/group handling)
Specific Implementation Details
- Models contain explicit schema references:
protected $table = 'auth.roles';
protected $connection = 'pgsql';
- Validation includes explicit schema references:
Rule::unique('pgsql.auth.roles', 'code')
- Current challenge: User-role assignments need to handle the constraint:
CONSTRAINT chk_store_group_ids CHECK (store_id IS NOT NULL OR group_id IS NOT NULL)
Authentication & Authorization Implementation Progress
Completed Components
- Set up basic API structure with versioning
- Implemented domain-specific "Hello World" endpoints for:
- Loyalty
- Management Reporting
- Cafe Menu Products
- Trading Desk
Admin Interface Development
-
Created Admin component separate from API component
-
Implemented User Management:
- CRUD operations
- Integration with auth schema
- Role assignment interface (partially complete)
-
Implemented Role Management:
- CRUD operations
- Proper schema handling
- Validation with explicit schema references
-
Implemented Permission Management:
- Basic CRUD operations
- Schema-aware validation
- Views and controllers established
Key Technical Decisions & Solutions
- Explicit schema handling in PostgreSQL
- Proper validation rules for cross-schema operations
- Separation of web admin interface from API components
Current Challenges
- Role assignments need to handle:
- Store/group associations
- System-wide roles without store/group requirement
- UI updates for store/group selection
Next Steps
- Modify user-role assignments to handle store/group relationships
- Update database constraints for system-wide roles
- Enhance role assignment interface to include store/group selection
- Implement permission assignment to roles
- Set up role-based access control for API endpoints