An example project demonstrating a MultiTenant Single Database system fully built in Laravel and Filament, integrated with Stripe for Subscription management. The system includes the following features:
- Creation of Plans, Prices, and Features stored in the database and integrated via the Stripe API.
- Admin Panel for Managing Tenants and Subscriptions.
- API-based Client Creation when registering the Tenant
- Modal for Tenant to choose Plans and Complete the Subscription (Stripe Management)
- Feature for Tenant to create tickets for the Tenant's manager.
- Profile editing with theme color customization.
- Integration of Icons with FontAwesome.
- Tested and working with MySQL and Postgresql
- See Video - Administrative panel presentation
- See Video - Creation of Products, prices and Features
- See Video - Registering a new tenant
-
Create a Stripe account and enable trial mode - Stripe
-
Docker and docker-compose (The Dockerfile for this project already includes all the necessary resources to run the project.)
- The Docker File include all resources for execute this project.
- Clone the repository
git clone https://github.com/wallacemartinss/core_tenant.git
cd core_tenant
- Copy .ENV file
cp .env.example .env
- Configure your database in
.env
:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db_coretenant_system
DB_USERNAME=your_username
DB_PASSWORD=your_password
- Configure Stripe keys in
.env
STRIPE_KEY=your_stripe_key
STRIPE_SECRET=your_stripe_secret
- Run Docker
docker compose up -d
- Access docker App container
docker compose exec app bash
- Inside the container, Install PHP dependencies
composer install
- Inside the container, configure environment variables
php artisan key:generate
- Inside the container, Run migrations and seeders
php artisan migrate --seed
- Inside the container, Link storage for file uploads
php artisan storage:link
- Inside the container run the command below (To Listen Webhook stripe events) Ip 172.17.0.1 It is the default gateway for containers to communicate with the host.
stripe listen --forward-to http://172.17.0.1/stripe/webhook
- The first time you run it, it will generate your webhook key. copy and paste it into your env file.
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
When a user is registered (new tenant) they are asked to validate their email. use the address below to access the mailpit
- Fork the repository
- Create your feature changes in your branch
- Commit your changes
- Push to the branch
- Open a Pull Request
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
This project is licensed under the MIT License - see the LICENSE.md file for details.
For support, please email [email protected] or create an issue in the GitHub repository.