Skip to content

Latest commit

 

History

History
194 lines (139 loc) · 5.14 KB

File metadata and controls

194 lines (139 loc) · 5.14 KB

Jiny Profiles

User Profile Management package for JinyPHP - Comprehensive social profiles, personal information, and profile management system.

Features

Profile Management

  • Phone Management: Multi-phone number support with sharded database architecture
  • Address Management: Multiple address storage with type categorization (home, work, shipping, billing)
  • Social Profiles: Social media account integration and management
  • Privacy Settings: Granular privacy control for user information
  • Security Settings: Password and email management
  • Linked Accounts: External account connection management

Admin Interface

  • User Phone Management: Administrative interface for managing user phone numbers
  • User Address Management: Administrative interface for managing user addresses
  • Bulk Operations: Efficient management tools for administrators

Requirements

  • PHP 8.2+
  • Laravel 12.0+
  • jiny/auth: Required dependency for authentication and user management

Installation

  1. Install the package via Composer:
composer require jiny/profiles
  1. The service provider will be automatically registered via Laravel's package discovery.

  2. Run migrations to create required tables:

php artisan migrate

Database Structure

Sharded Tables

This package uses sharded tables for optimal performance:

  • Phone Numbers: phones_001 to phones_016
  • Addresses: addresses_001 to addresses_016

Users are distributed across shards based on their shard_id for improved database performance.

Usage

Routes

User Routes (Home Interface)

/home/profile/phone       - Phone number management
/home/profile/address     - Address management
/home/profile/social      - Social profile settings
/home/profile/privacy     - Privacy settings
/home/profile/security    - Security settings
/home/profile/linked-accounts - External account management

Admin Routes

/admin/user-phone    - Admin phone management
/admin/user-address  - Admin address management

Controllers

Home Profile Controllers

// Phone Management
Jiny\Profiles\Http\Controllers\Home\Profile\Phone\IndexController
Jiny\Profiles\Http\Controllers\Home\Profile\Phone\StoreController
Jiny\Profiles\Http\Controllers\Home\Profile\Phone\SetPrimaryController
Jiny\Profiles\Http\Controllers\Home\Profile\Phone\DeleteController

// Address Management
Jiny\Profiles\Http\Controllers\Home\Profile\Address\IndexController
Jiny\Profiles\Http\Controllers\Home\Profile\Address\StoreController
Jiny\Profiles\Http\Controllers\Home\Profile\Address\SetDefaultController
Jiny\Profiles\Http\Controllers\Home\Profile\Address\DeleteController

Admin Controllers

// User Phone Management
Jiny\Profiles\Http\Controllers\Admin\UserPhone\*

// User Address Management
Jiny\Profiles\Http\Controllers\Admin\UserAddress\*

Views

Views are available under the jiny-profiles:: namespace:

// Home views
'jiny-profiles::home.profile.phone.index'
'jiny-profiles::home.profile.address.index'
'jiny-profiles::home.social.index'
'jiny-profiles::home.privacy.index'
'jiny-profiles::home.security.index'
'jiny-profiles::home.linked-accounts.index'

// Admin views
'jiny-profiles::admin.user-phone.index'
'jiny-profiles::admin.user-address.index'

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="Jiny\Profiles\JinyProfilesServiceProvider" --tag="config"

Key Features

Phone Number Management

  • Multiple phone numbers per user
  • Country code support
  • Primary phone designation
  • Phone verification status
  • Sharded storage for performance

Address Management

  • Multiple addresses per user
  • Address categorization (home, work, shipping, billing)
  • Default address selection
  • International address support
  • Sharded storage for performance

Social Integration

  • Social media profile management
  • External account linking
  • Privacy control for social information

Security & Privacy

  • Password management
  • Email updates
  • Privacy settings control
  • Account security monitoring

Dependencies

This package requires the following Jiny packages:

  • jiny/auth: Core authentication and user management functionality

Architecture

Sharding Strategy

The package implements database sharding for scalability:

  • Users are assigned to shards (1-16) based on their shard_id
  • Phone numbers and addresses are stored in corresponding shard tables
  • This approach distributes database load and improves query performance

Middleware Integration

  • Uses jwt middleware for API authentication
  • Compatible with jiny/auth authentication system
  • Supports session-based and token-based authentication

Testing

Run the test suite:

vendor/bin/phpunit

License

This package is open-sourced software licensed under the MIT license.

Author

Contributing

Please see CONTRIBUTING.md for details on how to contribute to this project.

Changelog

Please see CHANGELOG.md for recent changes.