# BCS Portal

BCS Portal is a PHP-based web app that provides a unified public site, client portal, shop, donations, blog, video library, and admin backend in one Bootstrap interface.

## Overview
- Public-facing site and client portal
- E-commerce shop and donations
- Blog and video library
- RBAC-protected admin backend

## Administrative Features (RBAC)
Admin Panel
- User management (create/edit/deactivate)
- Role and permission management
- Audit logs
- System settings
- Built-in file manager
- Live HTML editor with preview

Shop Admin
- Product catalog management (services, digital, physical)
- Order management and fulfillment
- Coupon code creation
- Tax/shipping settings

Additional Consoles
- Donations dashboard (view/refund)
- Stripe console (recent transactions)
- Content, blog, and video management (full CRUD)

## Requirements
- PHP 8.x
- MySQL/MariaDB
- Composer (vendor dependencies already included in `vendor/`)
- Local web server (XAMPP/LAMPP works)

## Configuration
1) Database config: create `config/db_config.ini` (see comments in `config/database.php`).
2) Environment: edit `.env` for runtime keys.
   - `STRIPE_PUBLISHABLE_KEY`
   - `STRIPE_SECRET_KEY`
   - `STRIPE_WEBHOOK_SECRET` (if using webhooks)

## Local Run (LAMPP/XAMPP)
- Point your web root at `/opt/lampp/htdocs/bcs`.
- Ensure MySQL is running and `config/db_config.ini` is correct.
- Open `http://127.0.0.1/bcs/`.

## Notes
- The app reads `.env` in `config/database.php`.
- Blog, videos, content, service requests, and shop all route through `api/api_endpoints.php`.
- Stripe client-side key is exposed in `index.php` and used by `app.js`.

## Common Issues
- If you see “Stripe is not configured”, verify `.env` and restart Apache.
- If you see table-related errors, confirm your database schema matches the expected tables (see references inside `api/api_endpoints.php` and related API files).
