# Project Overview

This is a Laravel 12 application using PHP 8.2, Laravel Breeze authentication scaffolding, Blade views, Bootstrap 5, and a custom bilingual English/Assamese frontend language dictionary.

The public Srimanta Sankaradeva Kalakshetra frontend is currently mostly static/demo data rendered from `routes/web.php` closures and Blade views. Future backend modules must follow the project rule:

```text
Controller -> Service -> Repository -> Model
```

At the time of this document, project-specific public frontend modules do not yet have dedicated Controllers, Services, Repositories, or database-backed Models.

# Frontend Structure

## Layouts

- `resources/views/layouts/frontend.blade.php`: shared public site layout with Bootstrap, fonts, shared styles, header, footer, language script, and script stack.
- `resources/views/layouts/app.blade.php`: authenticated Breeze app layout.
- `resources/views/layouts/guest.blade.php`: guest/auth layout.
- `resources/views/layouts/navigation.blade.php`: Breeze authenticated navigation.

## Public Homepage

- `resources/views/landing.blade.php`: public homepage shell that includes frontend sections.
- `resources/views/landing-v2.blade.php`: preview-only alternate homepage shell available at `/home-v2`; it reuses the existing frontend header, footer, shared styles, language script, routes, and static project assets without replacing the current homepage.
- `resources/views/frontend/hero.blade.php`
- `resources/views/frontend/visitor-info.blade.php`
- `resources/views/frontend/quick-links.blade.php`
- `resources/views/frontend/about.blade.php`
- `resources/views/frontend/leadership-message.blade.php`
- `resources/views/frontend/attractions.blade.php`
- `resources/views/frontend/cultural-segments.blade.php`
- `resources/views/frontend/featured-exhibitions.blade.php`
- `resources/views/frontend/digital-museum-highlights.blade.php`
- `resources/views/frontend/featured-artefacts.blade.php`
- `resources/views/frontend/featured-books.blade.php`
- `resources/views/frontend/unique-works.blade.php`
- `resources/views/frontend/featured-videos.blade.php`
- `resources/views/frontend/featured-articles.blade.php`
- `resources/views/frontend/upcoming-events.blade.php`
- `resources/views/frontend/latest-notifications.blade.php`
- `resources/views/frontend/news-events.blade.php`
- `resources/views/frontend/campus-walkthrough.blade.php`
- `resources/views/frontend/online-ticket-cta.blade.php`
- `resources/views/frontend/tenders-booking.blade.php`
- `resources/views/frontend/plan-visit.blade.php`
- `resources/views/frontend-v2/*`: alternate homepage-only static preview sections in the approved order: Hero, Plan Your Visit, About, Explore Kalakshetra, Explore Our Collections, Message, News & Events, Latest Notifications, Walkthrough, and Final CTA.

## Shared Public Components

- `resources/views/frontend/header.blade.php`: public navbar/header, desktop dropdown nav, mobile/tablet menu, language buttons, and SOW1-ready navigation structure.
- `resources/views/frontend/footer.blade.php`: public footer.
- `resources/views/frontend/partials/styles.blade.php`: public frontend CSS utilities and responsive styling.
- `resources/views/frontend/partials/language-script.blade.php`: existing browser-side English/Assamese dictionary switcher using `lang/en/landing.php` and `lang/as/landing.php`.
- `resources/views/frontend/partials/inner-hero.blade.php`: reusable inner page banner and breadcrumb.
- `resources/views/frontend/partials/section-heading.blade.php`: reusable section heading.
- `resources/views/frontend/partials/cards.blade.php`: reusable image/content card.
- `resources/views/frontend/partials/form-field.blade.php`: reusable form field partial.
- `resources/views/frontend/partials/static-gallery.blade.php`: reusable static image gallery for wing and museum pages.
- `resources/views/frontend/partials/museum-card.blade.php`: reusable museum listing card.
- `resources/views/frontend/partials/auditorium-card.blade.php`: reusable Halls & Auditoriums listing card.
- `resources/views/frontend/partials/rental-facility-card.blade.php`: reusable public rental facility listing card.
- `resources/data/frontend-static.php`: static frontend data for Phase 3 wings/museums pages, Phase 4 Halls & Auditoriums pages, and Phase 5 Public Rental Facilities pages.

## Public Navigation Structure

The frontend header currently supports these top-level menu groups: Home, Explore Kala, About, Museums, Facilities, Beyond Kalakshetra, Events & News, Gallery, Artefacts, Tenders, and More.

Existing routes are reused where available. Museums links to the static museum listing and existing museum detail pages. Facilities groups International Convention Centre, Halls & Auditorium, Damodara Deva, accommodation, art gallery, recording studio, open air venues, and public rental facilities. Explore Kala and Plan Your Visit are static public pages. SOW1 items without developed pages remain disabled placeholders instead of fake routes.

## Public Inner Pages

- `resources/views/pages/about-society.blade.php`
- `resources/views/pages/organisation.blade.php`
- `resources/views/pages/explore-kala.blade.php`
- `resources/views/pages/plan-your-visit.blade.php`
- `resources/views/pages/facilities/index.blade.php`
- `resources/views/pages/facilities/show.blade.php`
- `resources/views/pages/listing.blade.php`: shared listing template for Events & News, Books, and Artefacts.
- `resources/views/pages/detail.blade.php`: shared detail template for Events & News, Books, and Artefacts.
- `resources/views/pages/gallery.blade.php`
- `resources/views/pages/form-page.blade.php`: shared Booking and Contact form page.
- `resources/views/pages/tenders.blade.php`
- `resources/views/pages/wings/show.blade.php`: reusable static internal wing detail page.
- `resources/views/pages/museums/index.blade.php`: static museums listing page.
- `resources/views/pages/museums/show.blade.php`: reusable static museum detail page.
- `resources/views/pages/halls-auditoriums/index.blade.php`: static Halls & Auditoriums listing page.
- `resources/views/pages/halls-auditoriums/show.blade.php`: reusable static auditorium detail page.
- `resources/views/pages/public-rental-facilities/index.blade.php`: static Public Rental Facilities listing page with category sections and Narayanpur placeholder.
- `resources/views/pages/public-rental-facilities/show.blade.php`: reusable static rental facility detail page.

## Breeze/Auth Views

- `resources/views/auth/*`: login, register, password reset, email verification, and confirmation views.
- `resources/views/dashboard_new.blade.php`: design-only admin dashboard shell that includes the admin view partials.
- `resources/views/admin/partials/head.blade.php`: admin dashboard head, fonts, Bootstrap 5/Lucide setup, and scoped dark/light theme styles.
- `resources/views/admin/partials/sidebar.blade.php`: admin dashboard sidebar navigation.
- `resources/views/admin/partials/topbar.blade.php`: admin dashboard topbar with search, dark/light switcher, English/Assamese switcher, profile link, and logout form.
- `resources/views/admin/partials/scripts.blade.php`: admin dashboard Lucide initialization, theme persistence, user menu interaction, and client-side English/Assamese dictionary.
- `resources/views/admin/dashboard/overview.blade.php`: dashboard title, summary, and quick actions.
- `resources/views/admin/dashboard/metrics.blade.php`: dashboard key operational metrics cards.
- `resources/views/admin/dashboard/featured-content-manager.blade.php`: dashboard live featured content manager section.
- `resources/views/profile/edit.blade.php`
- `resources/views/profile/partials/*`
- `resources/views/components/*`: reusable Breeze Blade components.

## Language System

- `lang/en/landing.php`: English dictionary.
- `lang/as/landing.php`: Assamese dictionary.
- The active public frontend language system is the script in `resources/views/frontend/partials/language-script.blade.php`.
- New user-facing public text should be added to the existing dictionaries and should not create a second translation system.

# Backend Structure

## Controllers

- `app/Http/Controllers/Controller.php`: base controller.
- `app/Http/Controllers/ProfileController.php`: Breeze profile edit/update/delete flow.
- `app/Http/Controllers/Auth/*`: Breeze authentication controllers:
  - `AuthenticatedSessionController`
  - `ConfirmablePasswordController`
  - `EmailVerificationNotificationController`
  - `EmailVerificationPromptController`
  - `NewPasswordController`
  - `PasswordController`
  - `PasswordResetLinkController`
  - `RegisteredUserController`
  - `VerifyEmailController`

## Services

No project-specific `app/Services` directory exists currently.

Future backend modules must add Services for business logic.

## Repositories

No project-specific `app/Repositories` directory exists currently.

Future backend modules must add Repositories for database access.

## Models

- `app/Models/User.php`: default authenticated user model.

## Requests

- `app/Http/Requests/ProfileUpdateRequest.php`
- `app/Http/Requests/Auth/LoginRequest.php`

## Middleware

No project-specific middleware files were identified in `app/Http` during the targeted structure inspection. The application uses Laravel/Breeze framework middleware through routing and bootstrap configuration.

## View Components

- `app/View/Components/AppLayout.php`
- `app/View/Components/GuestLayout.php`

# Routes

## Public Frontend Routes

Defined in `routes/web.php`:

- `GET /`: homepage, returns `landing`.
- `GET /home-v2`: preview-only alternate homepage, returns `landing-v2`.
- `GET /language/{locale}`: switches session locale for `en` and `as`.
- `GET /about/kalakshetra-society`
- `GET /about/organisation`
- `GET /facilities`
- `GET /facilities/halls-auditorium`
- `GET /facilities/halls-auditorium/damodara-deva`
- `GET /facilities/{slug}`
- `GET /explore-kala`
- `GET /plan-your-visit`
- `GET /wings/{slug}`
- `GET /study-centre`
- `GET /av-library`
- `GET /museums`
- `GET /museums/{slug}`
- `GET /halls-auditoriums`
- `GET /halls-auditoriums/{slug}`
- `GET /public-rental-facilities`
- `GET /public-rental-facilities/{slug}`
- `GET /events-news`
- `GET /events-news/{slug}`
- `GET /books`
- `GET /books/{slug}`
- `GET /artefacts`
- `GET /artefacts/{slug}`
- `GET /gallery`
- `GET /booking`
- `GET /contact`
- `GET /tenders`

These public frontend routes currently use static/demo arrays and route closures.

## Authenticated Routes

Defined in `routes/web.php`:

- `GET /dashboard`: Bootstrap 5 admin dashboard view (`dashboard_new`), requires `auth` and `verified`.
- `GET /profile`: profile edit, requires `auth`.
- `PATCH /profile`: profile update, requires `auth`.
- `DELETE /profile`: profile deletion, requires `auth`.

## Authentication Routes

Defined in `routes/auth.php`:

- `GET /register`
- `POST /register`
- `GET /login`
- `POST /login`
- `GET /forgot-password`
- `POST /forgot-password`
- `GET /reset-password/{token}`
- `POST /reset-password`
- `GET /verify-email`
- `GET /verify-email/{id}/{hash}`
- `POST /email/verification-notification`
- `GET /confirm-password`
- `POST /confirm-password`
- `PUT /password`
- `POST /logout`

# Database Tables

The project now has the default Laravel tables plus long-term CMS/admin tables. New CMS migrations are `2026_09_19_000001` through `2026_09_19_000015`.

## Laravel/System Tables

- `users`: `id`, `name`, `email`, `email_verified_at`, `password`, `status`, `remember_token`, timestamps.
- `password_reset_tokens`: `email`, `token`, `created_at`.
- `sessions`: `id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`.
- `cache`: `key`, `value`, `expiration`.
- `cache_locks`: `key`, `owner`, `expiration`.
- `jobs`: `id`, `queue`, `payload`, `attempts`, `reserved_at`, `available_at`, `created_at`.
- `job_batches`: `id`, `name`, job counters, failed IDs, `options`, lifecycle timestamps.
- `failed_jobs`: `id`, `uuid`, `connection`, `queue`, `payload`, `exception`, `failed_at`.

## Permission Tables

Spatie-compatible schema is present, but the Spatie package is not yet installed/wired into `User`.

- `roles`: `id`, `name`, `guard_name`, timestamps.
- `permissions`: `id`, `name`, `guard_name`, timestamps.
- `model_has_roles`: `role_id`, `model_type`, `model_id`.
- `model_has_permissions`: `permission_id`, `model_type`, `model_id`.
- `role_has_permissions`: `permission_id`, `role_id`.

## CMS Tables

- `categories`: `id`, `module`, bilingual name/description, `slug`, `status`, `sort_order`, `created_by`, `updated_by`, soft deletes, timestamps. Model: `App\Models\Category`.
- `media_assets`: bilingual title/alt text, `file_path`, `file_type`, `mime_type`, `file_size`, `disk`, `status`, `created_by`, `updated_by`, soft deletes, timestamps. Model: `App\Models\MediaAsset`.
- `books`: `category_id`, bilingual title/author/description, `slug`, `cover_image_id`, `pdf_file_id`, `is_featured`, `status`, `sort_order`, user tracking, soft deletes, timestamps. Model: `App\Models\Book`.
- `artefacts`: `category_id`, bilingual title/material/description, `slug`, `period`, `image_id`, `is_featured`, `status`, `sort_order`, user tracking, soft deletes, timestamps. Model: `App\Models\Artefact`.
- `articles`: `category_id`, bilingual title/excerpt/content, `slug`, `featured_image_id`, `author_name`, `is_featured`, `status`, `published_at`, user tracking, soft deletes, timestamps. Model: `App\Models\Article`.
- `news_events`: `category_id`, `type`, bilingual title/description/content/venue, `slug`, `image_id`, `event_date`, `event_time`, `is_featured`, `status`, `published_at`, user tracking, soft deletes, timestamps. Model: `App\Models\NewsEvent`.
- `gallery_albums`: `category_id`, bilingual title/description, `slug`, `cover_image_id`, `status`, `sort_order`, user tracking, soft deletes, timestamps. Model: `App\Models\GalleryAlbum`.
- `gallery_images`: `album_id`, `category_id`, `image_id`, bilingual title/caption, `sort_order`, `status`, user tracking, soft deletes, timestamps. Model: `App\Models\GalleryImage`.
- `documents`: `category_id`, `type`, bilingual title/description, `slug`, `file_id`, `cover_image_id`, `published_at`, `last_date`, `status`, `sort_order`, user tracking, soft deletes, timestamps. Model: `App\Models\Document`.
- `form_submissions`: `type`, contact fields, `metadata`, `status`, `admin_note`, `assigned_to`, soft deletes, timestamps. Model: `App\Models\FormSubmission`.
- `visitor_stats`: `page_url`, `page_title`, `ip_address`, `user_agent`, `referrer`, `visited_on`, timestamps. Model: `App\Models\VisitorStat`.
- `activity_logs`: `user_id`, `module`, `action`, `record_type`, `record_id`, `description`, request metadata, JSON `metadata`, timestamps. Model: `App\Models\ActivityLog`.
- `site_settings`: `group`, `key`, bilingual values, `value_type`, `status`, `sort_order`, user tracking, timestamps. Model: `App\Models\SiteSetting`.

# ALL JOINS

## CMS User Tracking

- `categories.created_by`, `categories.updated_by` -> `users.id`
- `media_assets.created_by`, `media_assets.updated_by` -> `users.id`
- `books.created_by`, `books.updated_by` -> `users.id`
- `artefacts.created_by`, `artefacts.updated_by` -> `users.id`
- `articles.created_by`, `articles.updated_by` -> `users.id`
- `news_events.created_by`, `news_events.updated_by` -> `users.id`
- `gallery_albums.created_by`, `gallery_albums.updated_by` -> `users.id`
- `gallery_images.created_by`, `gallery_images.updated_by` -> `users.id`
- `documents.created_by`, `documents.updated_by` -> `users.id`
- `site_settings.created_by`, `site_settings.updated_by` -> `users.id`
- `form_submissions.assigned_to` -> `users.id`
- `activity_logs.user_id` -> `users.id`

## CMS Classification And Media

- `books.category_id`, `artefacts.category_id`, `articles.category_id`, `news_events.category_id`, `gallery_albums.category_id`, `gallery_images.category_id`, `documents.category_id` -> `categories.id`
- `books.cover_image_id`, `books.pdf_file_id`, `artefacts.image_id`, `articles.featured_image_id`, `news_events.image_id`, `gallery_albums.cover_image_id`, `gallery_images.image_id`, `documents.file_id`, `documents.cover_image_id` -> `media_assets.id`
- `gallery_images.album_id` -> `gallery_albums.id`

## Permissions

- `model_has_roles.role_id`, `role_has_permissions.role_id` -> `roles.id`
- `model_has_permissions.permission_id`, `role_has_permissions.permission_id` -> `permissions.id`

## System Logical Joins

- `sessions.user_id` logically references `users.id`, but the default Laravel sessions migration does not enforce a database foreign key.
