# REDD+ Dev Project Knowledge

## Project Structure
- **Laravel app** at `C:\laragon\www\dynaweb4\dev new\redd-plus-dev`
- **Database**: MySQL, configured in `.env`
- **Admin panel**: Tailadmin theme, CSS at `public/tailadmin/src/css/style.css`

## Frontend Theme (REDD+ portal)
CSS variables defined in: `database/seeders/redd-plus/ReddPlusSiteLayoutSeeder.php`
```
--green-900: #22392a
--green-800: #2e4a35
--green-700: #3d5c44
--green-200: #cddac9
--green-100: #e4ecdf
--gold: #b9975b
--cream: #f7f5ee (body background)
--ink: #3a4a3f (text color)
--card-bg: #ffffff (card background, recently added)
```

## Info Card Styling
- `.info-card` CSS is embedded inline in article content stored in DB
- Defined in seeders:
  - `database/seeders/redd-plus/ReddPlusArticleSeeder.php` (articles with info-card HTML)
  - `database/seeders/redd-plus/ReddPlusPageSeeder.php` (pages with info-card HTML)
- Also in cached view files under `storage/framework/views/` (auto-regenerated)
- Recent update (2026-07-29): strengthened card with white bg, stronger border `#d8d4c8`, added `box-shadow`

## Database Tables
- `content_article` - articles (PK: `article_id`)
- `content_article_translation` - translations including HTML content (`article_translation_content`)
- `theme_rules` / `theme_settings` - dynamic theme configuration
- `settings` - key-value app settings (sidebar colors, etc.)
- `data_dashboard` - dashboard widgets
- `frontend_sites` - site layouts (header, footer, layout HTML)

## Key Models
- `app/Models/Backend/ContentArticle.php` - article model, hasMany translations
- `app/Models/Backend/ContentArticleTranslation.php` - translation model
- `app/Models/Backend/ThemeSetting.php` / `ThemeRule.php` - theme config
- `app/Models/Backend/Setting.php` - key-value settings
- `app/Models/Backend/FrontendSite.php` - frontend sites

## Key Controllers
- `app/Http/Controllers/Backend/ContentArticleController.php` - article CRUD

## Helpers
- `app/Http/Helpers/SettingHelper.php` - `get()`/`set()` for settings with cache
- `app/Helpers/DashboardHelper.php` - `render()` for dashboard widgets

## To Update Card Styles in Future
1. Edit seeders: `ReddPlusArticleSeeder.php` and `ReddPlusPageSeeder.php`
2. Create a new migration with `DB::raw("REPLACE(...)")` to update existing DB content
3. Run `php artisan migrate`
4. Clear view cache: `php artisan view:clear`
5. If theme settings changed, clear app cache: `php artisan cache:clear`

## Migrations
- Article tables: `2026_05_13_142707_create_content_article_table.php`, `2026_05_13_142708_create_content_article_translation_table.php`
- Theme: `2026_07_01_000001_create_theme_tables.php`
- Settings: `2026_06_18_154226_create_settings_table.php`
- Dashboard: `2026_05_21_045007_create_data_dashboard_table.php`
