PHPackages                             cimembership/cimembership - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. cimembership/cimembership

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

cimembership/cimembership
=========================

CodeIgniter 4 Membership Management System - Base Platform

4.0.18(3mo ago)032MITPHPPHP ^8.1

Since Apr 9Pushed 3mo agoCompare

[ Source](https://github.com/cimembership/cimembership)[ Packagist](https://packagist.org/packages/cimembership/cimembership)[ Docs](https://cimembership.io)[ RSS](/packages/cimembership-cimembership/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (13)Versions (18)Used By (0)

CIMembership v4
===============

[](#cimembership-v4)

A modern, secure membership management system built with **CodeIgniter 4**.

[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)[![CodeIgniter](https://camo.githubusercontent.com/1688bd8abfa814c522d14c4cce19b623180fa7495706c9682da22aa21f336197/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f646549676e697465722d342e782d6f72616e67652e737667)](https://codeigniter.com)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Features
--------

[](#features)

- **Modern CodeIgniter 4** - Built on the latest CodeIgniter 4.x framework
- **PHP 8.1+** - Uses modern PHP features for better performance and security
- **Secure Authentication** - Password hashing with bcrypt, CSRF protection, rate limiting
- **OAuth Social Login** - Facebook, Google, GitHub, LinkedIn, Twitter, Microsoft
- **Role-Based Access Control** - Flexible user groups and permissions
- **User Profiles** - Complete user profile management with avatar upload
- **Admin Dashboard** - Beautiful dashboard with user management
- **Email Activation** - Optional email verification for new accounts
- **Password Reset** - Secure password reset via email
- **API Ready** - RESTful API with API key authentication
- **CLI Installer** - Modern command-line installation
- **Upgrade Path** - Migrate from CI3 CIMembership seamlessly

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- MySQL 5.7+ or MariaDB 10.3+
- Composer
- Web server (Apache/Nginx)

Installation
------------

[](#installation)

### Quick Start

[](#quick-start)

```
# Install via Composer
composer create-project cimembership/cimembership cimembership
cd cimembership

# Run the installer
php spark install:app
```

### Manual Installation

[](#manual-installation)

1. Download the latest release
2. Extract to your web server directory
3. Run `composer install`
4. Copy `.env.example` to `.env` and configure
5. Run `php spark migrate`
6. Create an admin user

For detailed instructions, see [INSTALL.md](INSTALL.md).

Upgrading from v3 (CI3)
-----------------------

[](#upgrading-from-v3-ci3)

If you're upgrading from CIMembership v3 (CodeIgniter 3):

```
# After installing v4, run the upgrade command
php spark upgrade:fromv3
```

This will migrate your users, groups, profiles, and settings from CI3 to CI4.

See [UPGRADE.md](UPGRADE.md) for detailed upgrade instructions.

Directory Structure
-------------------

[](#directory-structure)

```
cimembership/
├── app/
│   ├── Commands/           # CLI commands (installer, upgrade)
│   ├── Config/            # Configuration files
│   ├── Controllers/       # Base controllers
│   ├── Database/
│   │   └── Migrations/    # Database migrations
│   ├── Filters/           # Authentication & security filters
│   ├── Libraries/         # Core libraries
│   │   ├── Auth/         # Authentication classes
│   │   ├── Captcha/      # Captcha handling
│   │   └── OAuth/        # OAuth providers
│   ├── Models/           # Database models
│   └── Modules/
│       ├── Admin/         # Admin module (Dashboard, Users, Settings)
│       └── Auth/          # Auth module (Login, Register, OAuth)
├── public/               # Web root
├── tests/                # Unit tests
├── writable/             # Cache, logs, uploads
├── composer.json
└── spark                 # CLI entry point

```

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

Copy `.env.example` to `.env` and configure:

```
cp .env.example .env
```

#### Required Settings

[](#required-settings)

```
# Environment (production for live sites)
CI_ENVIRONMENT = production

# Database (required)
database.default.hostname = localhost
database.default.database = your_database_name
database.default.username = your_database_user
database.default.password = your_secure_password
database.default.DBPrefix = ci_

# Application URL (required)
app.baseURL = 'https://yourdomain.com/'
app.timezone = 'UTC'
```

#### Optional Settings

[](#optional-settings)

```
# Email (for user activation, password reset)
email.protocol = smtp
email.SMTPHost = smtp.yourdomain.com
email.SMTPUser = noreply@yourdomain.com
email.SMTPPass = your_email_password
email.SMTPPort = 587
email.SMTPCrypto = tls

# OAuth - Facebook
cimembership.oauth.facebook.enabled = true
cimembership.oauth.facebook.clientId = your_facebook_app_id
cimembership.oauth.facebook.clientSecret = your_facebook_app_secret

# OAuth - Google
cimembership.oauth.google.enabled = true
cimembership.oauth.google.clientId = your_google_client_id
cimembership.oauth.google.clientSecret = your_google_client_secret

# reCAPTCHA (for spam protection)
cimembership.recaptcha.enabled = true
cimembership.recaptcha.siteKey = your_recaptcha_site_key
cimembership.recaptcha.secretKey = your_recaptcha_secret_key
```

### OAuth Configuration

[](#oauth-configuration)

Enable OAuth providers in Admin &gt; Settings &gt; OAuth:

1. Go to Admin Dashboard
2. Navigate to Settings &gt; OAuth
3. Enter your Client ID and Client Secret for each provider
4. Enable the providers you want to use

**Note:** Configure redirect URLs in your OAuth app:

- Facebook: `https://example.com/auth/oauth/facebook/callback`
- Google: `https://example.com/auth/oauth/google/callback`
- GitHub: `https://example.com/auth/oauth/github/callback`
- LinkedIn: `https://example.com/auth/oauth/linkedin/callback`

CLI Commands
------------

[](#cli-commands)

```
# Installation
php spark install:app

# Upgrade from v3
php spark upgrade:fromv3 --source-db=old_cimembership_db --source-prefix=ci_

# Database
php spark migrate
php spark migrate:rollback
php spark migrate:refresh

# Seeds
php spark db:seed UserSeeder
```

Security Features
-----------------

[](#security-features)

- **Password Hashing**: bcrypt with cost factor 12
- **CSRF Protection**: All forms protected by default
- **Rate Limiting**: Login attempts limited per IP
- **Session Security**: Regenerated on login
- **XSS Protection**: Output escaping by default
- **SQL Injection Prevention**: Parameterized queries
- **Password Strength**: Configurable minimum requirements

API Usage
---------

[](#api-usage)

CIMembership v4 includes a RESTful API:

```
# Get API key from Admin panel
curl -H "X-API-Key: your-api-key" \
     https://example.com/api/users

# Create user
curl -X POST \
     -H "X-API-Key: your-api-key" \
     -H "Content-Type: application/json" \
     -d '{"username":"john","email":"john@example.com","password":"secret"}' \
     https://example.com/api/users
```

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

**Installation fails with database error:**

- Check MySQL credentials in `.env`
- Ensure database exists and user has privileges
- Check MySQL version (5.7+ required)

**OAuth not working:**

- Verify redirect URLs are configured correctly
- Check Client ID and Secret are correct
- Ensure callback URLs are HTTPS in production

**Emails not sending:**

- Configure SMTP settings in `.env`
- Check server allows outgoing SMTP connections
- Review logs in `writable/logs/`

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

Please ensure:

- Code follows PSR-12 coding standards
- All tests pass
- Documentation is updated

License
-------

[](#license)

CIMembership is open-source software licensed under the [MIT license](LICENSE).

Support
-------

[](#support)

- **Documentation**:
- **Issues**: [GitHub Issues](https://github.com/cimembership/cimembership/issues)
- **Discussions**: [GitHub Discussions](https://github.com/cimembership/cimembership/discussions)

---

**Note**: This is a complete rewrite from the original CIMembership v3. While we've provided an upgrade path, please backup your data before migrating.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance82

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

16

Last Release

90d ago

PHP version history (2 changes)v4.0.0PHP ^8.1

4.0.16PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47398446?v=4)[CIMembership](/maintainers/cimembership)[@cimembership](https://github.com/cimembership)

---

Top Contributors

[![cimembership](https://avatars.githubusercontent.com/u/47398446?v=4)](https://github.com/cimembership "cimembership (35 commits)")

---

Tags

authAuthenticationcodeigniteroauthplatformUser managementbasemembershipcodeigniter4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cimembership-cimembership/health.svg)

```
[![Health](https://phpackages.com/badges/cimembership-cimembership/health.svg)](https://phpackages.com/packages/cimembership-cimembership)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[codeigniter4/shield

Authentication and Authorization for CodeIgniter 4

424436.1k29](/packages/codeigniter4-shield)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k46](/packages/civicrm-civicrm-core)[casdoor/casdoor-php-sdk

PHP client SDK for Casdoor

2420.3k](/packages/casdoor-casdoor-php-sdk)[bedita/manager

BEdita Manager - official admin webapp for BEdita4 API

131.2k](/packages/bedita-manager)[agungsugiarto/codeigniter4-authentication

Provides an API for authentication and includes concrete authentication adapters for common use case scenarios

494.6k2](/packages/agungsugiarto-codeigniter4-authentication)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
