# Startup SPA প্রজেক্ট ডকুমেন্টেশন

## ১. প্রজেক্টটি কিসের

এই প্রজেক্টটি একটি Laravel 12 + Vue 3 + Inertia.js ভিত্তিক Single Page Application (SPA)। কোড, ডেটাবেস মাইগ্রেশন, কন্ট্রোলার, Vue প্যানেল এবং পারমিশন দেখে বোঝা যায় এটি মূলত একটি শিক্ষা প্রতিষ্ঠান, কোচিং সেন্টার, ট্রেনিং সেন্টার বা মাল্টি-branch অপারেশন ম্যানেজমেন্ট সিস্টেম।

এখানে branch, user, role, subject, batch, income, expense, daily closing, teacher, class counting, transfer, library/book sales, requisition, notice এবং settings এক জায়গা থেকে ম্যানেজ করা যায়। অ্যাপটি admin dashboard ভিত্তিক, যেখানে role/permission অনুযায়ী sidebar, module এবং action দৃশ্যমান হয়।

## ২. প্রজেক্টের উদ্দেশ্য

প্রজেক্টের প্রধান উদ্দেশ্য হলো একটি প্রতিষ্ঠানের দৈনন্দিন প্রশাসনিক, আর্থিক, একাডেমিক এবং inventory/order related কাজগুলো digital dashboard থেকে পরিচালনা করা।

মূল উদ্দেশ্যগুলো:

1. একাধিক branch/center পরিচালনা করা।
2. User, role এবং permission দিয়ে controlled access নিশ্চিত করা।
3. Batch, subject, teacher, class count এবং transfer সম্পর্কিত academic operation ম্যানেজ করা।
4. Income, expense এবং daily closing update দিয়ে দৈনিক হিসাব রাখা।
5. Library/book inventory, publisher, library/customer, courier, order, payment এবং refund ম্যানেজ করা।
6. Requisition item এবং requisition workflow পরিচালনা করা।
7. Notice publish, target audience নির্ধারণ এবং seen tracking করা।
8. Dashboard insights, reports এবং widget permission দিয়ে management summary দেখানো।
9. CSV import/export, soft delete, restore, permanent delete এবং bulk action দিয়ে data operation সহজ করা।

## ৩. Technology Stack

Backend:

- Laravel 12
- PHP 8.2+
- Inertia Laravel
- Laravel Sanctum
- Spatie Laravel Permission
- Ziggy route helper

Frontend:

- Vue 3
- Inertia.js
- Vite
- Tailwind CSS
- Axios
- xlsx package for Excel export

Database:

- README অনুযায়ী MySQL target database: `startup`
- Repo-তে `database/database.sqlite` আছে, যা local/dev context-এ থাকতে পারে

Authentication:

- Laravel Breeze Vue/Inertia auth
- Login, register, forgot password, reset password, email verification, password confirmation, logout

## ৪. High Level Architecture

প্রজেক্টটি Laravel backend এবং Vue/Inertia frontend দিয়ে তৈরি।

প্রধান স্তরগুলো:

1. Routes: `routes/web.php`, `routes/auth.php`
2. Controllers: `app/Http/Controllers`
3. Models: `app/Models`
4. Database schema: `database/migrations`
5. Seeders: `database/seeders`
6. Frontend pages/panels: `resources/js/Pages`
7. Layout/components: `resources/js/Layouts`, `resources/js/Components`
8. Styling/assets: `resources/css`, `public/storage`

## ৫. Entry Points ও Main Flow

Root URL `/` user-কে login page-এ redirect করে।

Authenticated এবং verified user `/dashboard` route-এ main SPA dashboard পায়। Dashboard page query parameter `view` অনুযায়ী আলাদা module panel render করে, যেমন:

- `/dashboard?view=all-user`
- `/dashboard?view=branches`
- `/dashboard?view=daily-closing-updates`
- `/dashboard?view=library-orders`
- `/dashboard?view=requisitions`

Dashboard sidebar role/permission অনুযায়ী menu দেখায়। User-এর permission না থাকলে সংশ্লিষ্ট module/action দেখানো হয় না এবং backend route middleware-ও permission enforce করে।

## ৬. Project Module Summary

| Module | Approx. Feature Count | Main Files |
|---|---:|---|
| Authentication | 9 | `routes/auth.php`, `app/Http/Controllers/Auth`, `resources/js/Pages/Auth` |
| Dashboard & Insights | 8 | `DashboardController.php`, `Dashboard.vue`, `OverviewPanel.vue`, `ReportsPanel.vue` |
| User Management | 16 | `UserManagementController.php`, `UserManagementPanel.vue`, `StoreUserRequest.php`, `UpdateUserRequest.php` |
| Role & Permission Management | 8 | `UserManagementController.php`, `RoleManagementPanel.vue`, `CustomPermissionsPanel.vue` |
| Branch Management | 12 | `BranchController.php`, `BranchManagementPanel.vue`, `Branch.php` |
| Subject Management | 10 | `SubjectController.php`, `SubjectManagementPanel.vue`, `Subject.php` |
| Batch & Batch Type Management | 15 | `BatchController.php`, `BatchManagementPanel.vue`, `Batch.php`, `BatchType.php` |
| Income Management | 10 | `IncomeController.php`, `IncomeManagementPanel.vue`, `Income.php` |
| Expense Management | 10 | `ExpenseController.php`, `ExpenseManagementPanel.vue`, `Expense.php` |
| Daily Closing Updates | 18 | `DailyClosingUpdateController.php`, `DailyClosingUpdatesPanel.vue` |
| Time Slots | 10 | `TimeSlotController.php`, `TimeSlotsManagementPanel.vue`, `TimeSlot.php` |
| Teacher Management | 15 | `TeacherController.php`, `TeachersManagementPanel.vue`, `TeacherDashboardPanel.vue` |
| Banking Management | 11 | `BankingController.php`, `BankingsManagementPanel.vue`, `Banking.php` |
| Class Counting Sheets | 16 | `ClassCountingSheetController.php`, `ClassCountingSheetsPanel.vue` |
| Transfers | 13 | `TransferController.php`, `TransfersManagementPanel.vue`, `Transfer.php` |
| Library Management | 35+ | `LibraryManagementController.php`, `LibraryManagementPanel.vue`, library-related models |
| Requisition Management | 18 | `RequisitionManagementController.php`, `RequisitionManagementPanel.vue` |
| Notice Management | 14 | `NoticeManagementController.php`, `NoticeManagementPanel.vue`, `NoticeTicker.vue` |
| Settings | 8 | `SettingsController.php`, `SettingsPanel.vue`, `AppSetting.php` |
| Profile | 5 | `ProfileController.php`, `resources/js/Pages/Profile` |
| System Tools | 3 | `DashboardController@runSystemTools`, `SystemMaintenancePanel.vue` |
| Public Media | 2 | `PublicMediaController.php`, `/media/public/{path}` |

## ৭. Common Features Across Management Modules

প্রায় সব CRUD module-এ একই ধরনের feature pattern আছে:

1. List/index API
2. Create/store
3. Edit/update
4. Soft delete/trash
5. Restore
6. Permanent delete/force delete
7. Bulk restore
8. Bulk permanent delete
9. CSV sample download
10. CSV import
11. Frontend search/filter
12. Pagination
13. View/details dialog
14. CSV export
15. Excel export
16. Permission-based button visibility
17. Confirmation dialog before destructive action
18. Active/inactive status where applicable

সব module-এ সবগুলো feature একদম একইভাবে নেই, তবে অধিকাংশ management panel এই pattern অনুসরণ করে।

## ৮. Authentication Module

Feature count: 9

Features:

1. Register: guest user account create করতে পারে।
2. Login: email/password দিয়ে authenticate হয়।
3. Logout: authenticated session invalidate করে।
4. Forgot password: reset link request করা যায়।
5. Reset password: token দিয়ে নতুন password set করা যায়।
6. Email verification: verified user ছাড়া dashboard group access restricted।
7. Resend verification email: throttle সহ email verification notification পাঠায়।
8. Password confirmation: sensitive action-এর আগে password confirm support।
9. Password update: authenticated user password update করতে পারে।

Important files:

- `routes/auth.php`
- `AuthenticatedSessionController.php`
- `RegisteredUserController.php`
- `PasswordResetLinkController.php`
- `NewPasswordController.php`
- `VerifyEmailController.php`
- `PasswordController.php`
- `resources/js/Pages/Auth/*.vue`

## ৯. Dashboard & Insights Module

Feature count: 8

Purpose:

Management summary, overview metrics, charts, teacher-specific insight এবং module navigation এর কেন্দ্রীয় জায়গা।

Features:

1. Dashboard landing panel render।
2. Role/permission অনুযায়ী dashboard props পাঠানো।
3. Overview insights API: date range অনুযায়ী income, expense, admission, cash, bank deposit summary।
4. Branch collection chart data।
5. Income trend chart data।
6. Top performing branch/batch insights।
7. Teacher class counting insights: teacher user-এর class count history/summary।
8. Dashboard widget permission: total income, total expense, total admission, cash in hand, bank deposits, total branches, total batches, total teachers ইত্যাদি আলাদা permission দিয়ে control।

Main files:

- `app/Http/Controllers/DashboardController.php`
- `resources/js/Pages/Dashboard.vue`
- `resources/js/Pages/Dashboard/OverviewPanel.vue`
- `resources/js/Pages/Dashboard/ReportsPanel.vue`
- `resources/js/Pages/Dashboard/TeacherDashboardPanel.vue`

## ১০. User Management Module

Feature count: 16

Purpose:

System user create, edit, delete, restore, role assign, branch assign এবং CSV import/export।

Features:

1. User list with search/filter/sort।
2. User create with name, email, password, avatar, branch, roles, active status।
3. User update with same data and optional password/avatar update।
4. Avatar upload and remove।
5. Role assignment on create/update।
6. Branch assignment with branch-access logic।
7. Soft delete user।
8. Restore deleted user।
9. Permanent delete user।
10. Bulk soft delete।
11. Bulk restore।
12. Bulk force delete।
13. CSV sample download।
14. CSV import with headers: `name`, `email`, `branch`, `roles`, `password`, `is_active`।
15. CSV/Excel export from frontend।
16. Impersonation start for super-admin।

Data fields:

- `name`
- `email`
- `password`
- `avatar`
- `branch_id`
- `is_active`
- roles from Spatie permission

Important validations:

- Email unique।
- Password confirmed।
- Avatar image max 2MB, jpg/jpeg/png/webp।
- At least one role required।
- Role choices limited by `RoleVisibility`.

Main files:

- `app/Http/Controllers/UserManagementController.php`
- `app/Http/Requests/StoreUserRequest.php`
- `app/Http/Requests/UpdateUserRequest.php`
- `resources/js/Pages/Dashboard/UserManagementPanel.vue`
- `app/Support/BranchAccess.php`
- `app/Support/RoleVisibility.php`

## ১১. Role & Permission Management Module

Feature count: 8

Purpose:

Role create/edit/delete, permission assignment এবং custom permission management।

Features:

1. Access control data load।
2. Role list।
3. Role create।
4. Role update।
5. Role delete।
6. Permission matrix assignment।
7. Custom permission create।
8. Custom permission delete।

Important permissions:

- `view roles`
- `create roles`
- `edit roles`
- `delete roles`

Seeded roles:

- `super-admin`
- `admin`
- `manager`
- `viewer`
- Migration/backfill অনুযায়ী `teacher` role-ও ব্যবহৃত হয়।

Main files:

- `UserManagementController@accessControl`
- `UserManagementController@storeRole`
- `UserManagementController@updateRole`
- `UserManagementController@destroyRole`
- `UserManagementController@permissions`
- `RoleManagementPanel.vue`
- `CustomPermissionsPanel.vue`

## ১২. Branch Management Module

Feature count: 12

Purpose:

প্রতিষ্ঠানের branch/center information ম্যানেজ করা।

Features:

1. Branch list।
2. Search by name/code/phone/address/note।
3. Status filter: all/active/trash।
4. Create branch।
5. Edit branch।
6. View branch details।
7. Soft delete।
8. Restore।
9. Permanent delete।
10. Bulk restore/force delete।
11. CSV import/sample download।
12. CSV/Excel export।

Data fields:

- `name`
- `code`
- `address`
- `phone`
- `note`
- `is_active`

Special behavior:

- Code optional হলে name থেকে unique code generate করার helper আছে।
- Branch visibility/access `BranchAccess` support class দিয়ে controlled।

## ১৩. Subject Management Module

Feature count: 10

Purpose:

Academic subject list maintain করা।

Features:

1. Subject list।
2. Search/filter।
3. Create subject।
4. Edit subject।
5. Active/inactive status।
6. Soft delete।
7. Restore।
8. Permanent delete।
9. CSV import/sample download।
10. CSV/Excel export।

Data fields:

- `name`
- `is_active`

## ১৪. Batch & Batch Type Management Module

Feature count: 15

Purpose:

Batch, batch category/type এবং total class count maintain করা।

Features:

1. Batch type list।
2. Batch type create/edit/delete।
3. Batch type CSV import।
4. Batch type CSV/Excel export।
5. Batch list।
6. Batch search।
7. Filter by status।
8. Filter by batch type।
9. Batch create with type।
10. Batch edit।
11. Batch view/details।
12. Soft delete batch।
13. Restore/permanent delete।
14. Bulk restore/force delete।
15. CSV import/sample download/export।

Data fields:

- Batch type: `name`
- Batch: `name`, `total_class`, `batch_type_id`, `is_active`

## ১৫. Income Management Module

Feature count: 10

Purpose:

Daily closing এবং accounting entry-তে ব্যবহারের জন্য income heads/types maintain করা।

Features:

1. Income list।
2. Search/filter।
3. Create income head।
4. Edit income head।
5. Active/inactive status।
6. Soft delete।
7. Restore।
8. Permanent delete।
9. Bulk restore/force delete।
10. CSV import/sample download/export।

Data fields:

- `name`
- `is_active`

## ১৬. Expense Management Module

Feature count: 10

Purpose:

Daily closing এবং accounting entry-তে ব্যবহারের জন্য expense heads/types maintain করা।

Features:

1. Expense list।
2. Search/filter।
3. Create expense head।
4. Edit expense head।
5. Active/inactive status।
6. Soft delete।
7. Restore।
8. Permanent delete।
9. Bulk restore/force delete।
10. CSV import/sample download/export।

Data fields:

- `name`
- `is_active`

## ১৭. Daily Closing Updates Module

Feature count: 18

Purpose:

প্রতিদিনের branch-wise financial closing, admission count, income, expense, bank deposit এবং cash in hand হিসাব রাখা।

Features:

1. Daily closing list।
2. Filter by branch/date/status।
3. Create daily closing।
4. Edit daily closing।
5. Admission breakdown by batch।
6. Income items breakdown by income head।
7. Expense items breakdown by expense head।
8. Automatic figure calculation: total income, total expense, cash in hand।
9. Opening balance entry।
10. Bank deposit amount entry।
11. Receipt image upload।
12. Multiple receipt image support।
13. Bank deposit slip upload।
14. Multiple deposit slip support।
15. Image viewing endpoint।
16. Soft delete/restore/permanent delete।
17. Bulk restore/force delete।
18. CSV import/sample download/export।

Important data tables:

- `daily_closing_updates`
- `daily_closing_admissions`
- `daily_closing_income_items`
- `daily_closing_expense_items`

Important fields:

- `date`
- `branch_id`
- `admission_count`
- `opening_balance`
- `bank_deposit_amount`
- `total_income`
- `total_expense`
- `cash_in_hand`
- `receipt_paths`
- `bank_deposit_slip_paths`
- `created_by`

CSV import headers:

- `date`
- `branch`
- `opening_balance`
- `bank_deposit_amount`
- `total_income`
- `total_expense`
- `cash_in_hand`

## ১৮. Time Slots Module

Feature count: 10

Purpose:

Class schedule/time slot maintain করা।

Features:

1. Time slot list।
2. Search/filter।
3. Create time slot।
4. Edit time slot।
5. Active/inactive status।
6. View details।
7. Soft delete।
8. Restore/permanent delete।
9. Bulk restore/force delete।
10. CSV import/sample download/export।

Data fields:

- `time` in controller validation
- Migration has `name`, `start_time`, `end_time`; current controller/frontend appears to use a simplified `time` representation
- `is_active`

## ১৯. Teacher Management Module

Feature count: 15

Purpose:

Teacher profile, subject mapping, image, login account এবং teacher dashboard access maintain করা।

Features:

1. Teacher list।
2. Search/filter/status।
3. Create teacher।
4. Edit teacher।
5. Teacher image upload/remove।
6. Subject assignment।
7. Mobile/designation store।
8. Active/inactive status।
9. Super-admin দ্বারা teacher login account create।
10. Teacher login email/password store/update।
11. Encrypted generated password storage for teacher login support।
12. Soft delete।
13. Restore/permanent delete।
14. Bulk restore/force delete।
15. CSV import/sample download/export।

Data fields:

- `name`
- `designation`
- `subject_id`
- `mobile`
- `image`
- `is_active`
- `user_id`
- `login_password_encrypted`

## ২০. Banking Management Module

Feature count: 11

Purpose:

প্রতিষ্ঠানের bank account/banking information maintain করা।

Features:

1. Banking list।
2. Search by title, bank name, account no, remark।
3. Create banking record।
4. Edit banking record।
5. View banking details।
6. Active/inactive status।
7. Soft delete।
8. Restore/permanent delete।
9. Bulk restore/force delete।
10. CSV import/sample download।
11. CSV/Excel export।

Data fields:

- `bank_title`
- `bank_name`
- `account_no`
- `remark`
- `is_active`

## ২১. Class Counting Sheets Module

Feature count: 16

Purpose:

প্রতিদিন কোন branch-এ কোন batch, teacher, subject এবং time slot অনুযায়ী কত class হয়েছে তা record করা।

Features:

1. Class counting sheet list।
2. Filter by branch/date/status।
3. Create sheet।
4. Edit sheet।
5. Sheet-level date, branch, remark।
6. Multiple line items per sheet।
7. Each line item has batch, teacher, subject, time slot।
8. Lecture field।
9. Class count field।
10. Total class calculation।
11. Teacher-specific dashboard insight support।
12. Soft delete।
13. Restore/permanent delete।
14. Bulk restore/force delete।
15. CSV import/sample download।
16. CSV/Excel export।

Data tables:

- `class_counting_sheets`
- `class_counting_sheet_items`

CSV import headers:

- `date`
- `branch`
- `batch`
- `teacher`
- `subject`
- `time_slot`
- `lecture`
- `class_count`
- `remark`

## ২২. Transfers Module

Feature count: 13

Purpose:

Student/payment/record transfer tracking between branch or batch।

Features:

1. Transfer list।
2. Type filter: branch-to-branch, batch-to-batch।
3. Status/trash filter।
4. Create transfer।
5. Edit transfer।
6. View transfer details।
7. Source branch/batch।
8. Destination branch/batch।
9. Source/destination roll, MR, amount।
10. Lecture and remark।
11. Soft delete/restore/permanent delete।
12. Bulk restore/force delete।
13. CSV import/sample download/export।

Data fields:

- `type`
- `source_branch_id`
- `source_batch_id`
- `destination_branch_id`
- `destination_batch_id`
- `source_roll_no`
- `source_mr_no`
- `source_amount`
- `destination_roll_no`
- `destination_mr_no`
- `destination_amount`
- `lecture`
- `remark`

## ২৩. Library Management Module

Feature count: 35+

Purpose:

Book inventory/order ecosystem manage করা: payment method, publisher, library/customer, courier company, book, order, payment, refund এবং stock updates।

Submodules:

1. Payment Methods
2. Publishers
3. Libraries
4. Courier Companies
5. Books
6. Library Orders
7. Order Payments
8. Order Refunds

### ২৩.১ Payment Methods

Features:

1. List payment methods।
2. Create/edit/delete।
3. Bulk delete/restore/force delete।
4. CSV import/sample download/export।
5. Active/inactive support।

### ২৩.২ Publishers

Features:

1. Publisher list।
2. Create/edit/delete।
3. Contact information।
4. Active/inactive support।
5. Bulk actions।
6. CSV import/export।

### ২৩.৩ Libraries

Features:

1. Library/customer list।
2. Create/edit/delete।
3. Address/contact information।
4. Active/inactive support।
5. Bulk actions।
6. CSV import/export।

### ২৩.৪ Courier Companies

Features:

1. Courier company list।
2. Create/edit/delete।
3. Address/phone/email/note।
4. Active/inactive support।
5. Bulk actions।
6. CSV import/export।
7. Order-courier many-to-many relation।

### ২৩.৫ Books

Features:

1. Book list।
2. Create/edit/delete।
3. Book price information।
4. Stock/inventory fields।
5. Active/inactive support।
6. Bulk actions।
7. CSV import/export।

### ২৩.৬ Library Orders

Features:

1. Order list।
2. Create order with publisher and library।
3. Multiple book items per order।
4. Courier company assignment।
5. Order status: `pending`, `confirmed`, `cancelled`।
6. Order update।
7. Order delete/restore/force delete।
8. Bulk actions।
9. CSV import/export।
10. Payment capture during order create/update।
11. Separate order payment add।
12. Order payment delete।
13. Refund order।
14. Refund line with restock quantity and loss quantity।
15. Stock commit tracking via `stock_committed_at`।

Important library models:

- `BookPaymentMethod`
- `Publisher`
- `Library`
- `CourierCompany`
- `Book`
- `LibraryOrder`
- `LibraryOrderItem`
- `LibraryOrderPayment`
- `LibraryOrderRefundItem`

Important order fields:

- `publisher_id`
- `library_id`
- `courier_company_ids`
- `items.*.book_id`
- `items.*.mrp_price`
- `items.*.selling_price`
- `items.*.quantity`
- `status`
- `order_date`
- `paid_amount`
- `payment_method_id`
- `collected_from`
- `payment_date`

## ২৪. Requisition Management Module

Feature count: 18

Purpose:

Branch/user থেকে প্রয়োজনীয় item requisition, review, approve/issue workflow এবং supporting document manage করা।

Submodules:

1. Requisition Items
2. Requisitions
3. Requisition Lines

Features:

1. Requisition management data load।
2. Requisition item list।
3. Requisition item create/edit/delete।
4. Requisition item bulk delete/restore/force delete।
5. Requisition create।
6. Multiple requisition lines/items support।
7. Branch association।
8. Requested by user tracking।
9. Review/update requisition।
10. Approve/review permission support via `review requisitions`।
11. Approved by user tracking।
12. Issued by user tracking।
13. Requisition status workflow।
14. Document upload support।
15. Document delete।
16. Soft delete requisition।
17. Restore/permanent delete।
18. Bulk restore/force delete।

Important models:

- `RequisitionItem`
- `Requisition`
- `RequisitionLine`

Important permissions:

- `view requisition items`
- `create requisition items`
- `edit requisition items`
- `delete requisition items`
- `view requisitions`
- `create requisitions`
- `edit requisitions`
- `delete requisitions`
- `review requisitions`

## ২৫. Notice Management Module

Feature count: 14

Purpose:

System notice publish, targeted audience control এবং user seen/read tracking।

Features:

1. Notice list।
2. Create notice।
3. Edit notice।
4. Delete notice।
5. Bulk delete।
6. Restore।
7. Bulk restore।
8. Force delete।
9. Bulk force delete।
10. Target users।
11. Target roles।
12. Target branches।
13. Visible/applicable notice scope।
14. Mark notice as seen।

Important models:

- `Notice`
- `NoticeView`

Important frontend:

- `NoticeManagementPanel.vue`
- `NoticeTicker.vue`

## ২৬. Settings Module

Feature count: 8

Purpose:

Application branding, sidebar style এবং system-level visual settings manage করা।

Features:

1. Settings load।
2. Settings update।
3. App logo upload/store।
4. Public logo endpoint।
5. Logo size setting।
6. Sidebar background/text/hover/active style settings।
7. Settings cache via `AppSetting`।
8. Permission-protected update।

Main files:

- `SettingsController.php`
- `SettingsPanel.vue`
- `AppSetting.php`

## ২৭. Profile Module

Feature count: 5

Purpose:

Logged-in user নিজের profile update করতে পারে।

Features:

1. Profile edit page।
2. Name/email update।
3. Avatar upload।
4. Avatar remove।
5. Account delete।

Main files:

- `ProfileController.php`
- `ProfileUpdateRequest.php`
- `resources/js/Pages/Profile/Edit.vue`

## ২৮. System Tools Module

Feature count: 3

Purpose:

Admin/super-admin level maintenance utility run করা।

Features:

1. System tools panel।
2. Backend command/action run endpoint।
3. Access restricted to `super-admin|admin` role।

Main files:

- `DashboardController@runSystemTools`
- `SystemMaintenancePanel.vue`

## ২৯. Public Media Module

Feature count: 2

Purpose:

Uploaded public files controlled endpoint দিয়ে serve করা।

Features:

1. `/media/public/{path}` দিয়ে public storage media দেখানো।
2. Daily closing/teacher/avatar/settings images route helper দিয়ে frontend-এ use করা।

Main files:

- `PublicMediaController.php`
- `routes/web.php`

## ৩০. Role Based Access Control (RBAC)

এই প্রজেক্টে Spatie Laravel Permission ব্যবহার করা হয়েছে।

Core roles:

- `super-admin`
- `admin`
- `manager`
- `viewer`
- `teacher` role migration/backfill এ ব্যবহৃত

RBAC behavior:

1. Backend route middleware permission check করে।
2. Frontend sidebar permission অনুযায়ী menu দেখায়।
3. Action button যেমন create/edit/delete permission অনুযায়ী দেখায়।
4. Super-admin সব ability bypass করতে পারে via `Gate::before`।
5. Role visibility support class দিয়ে কোন user কোন role assign করতে পারবে তা সীমাবদ্ধ।
6. Branch access support class দিয়ে user visibility branch অনুযায়ী সীমিত।

Permission groups:

- Dashboard
- Users
- Roles
- Branches
- Subjects
- Batches
- Incomes
- Expenses
- Daily closings
- Time slots
- Teachers
- Bankings
- Class counting sheets
- Transfers
- Payment methods
- Books
- Publishers
- Libraries
- Library orders
- Courier companies
- Requisition items
- Requisitions
- Notices
- Settings
- Dashboard widgets/charts/cards

## ৩১. Database Modules

Important tables:

- `users`
- `roles`, `permissions`, Spatie pivot tables
- `branches`
- `subjects`
- `batch_types`
- `batches`
- `incomes`
- `expenses`
- `daily_closing_updates`
- `daily_closing_admissions`
- `daily_closing_income_items`
- `daily_closing_expense_items`
- `time_slots`
- `teachers`
- `bankings`
- `class_counting_sheets`
- `class_counting_sheet_items`
- `transfers`
- `book_payment_methods`
- `publishers`
- `libraries`
- `courier_companies`
- `books`
- `library_orders`
- `library_order_items`
- `library_order_payments`
- `library_order_refund_items`
- `library_order_courier_company`
- `requisition_items`
- `requisitions`
- `requisition_lines`
- `notices`
- `notice_views`
- `app_settings`

## ৩২. Frontend Structure

Main app:

- `resources/js/app.js`
- `resources/views/app.blade.php`

Layouts:

- `AuthenticatedLayout.vue`
- `GuestLayout.vue`

Reusable components:

- Buttons: `PrimaryButton`, `SecondaryButton`, `DangerButton`
- Forms: `TextInput`, `InputLabel`, `InputError`, `Checkbox`
- Navigation: `NavLink`, `ResponsiveNavLink`, `Dropdown`, `DropdownLink`
- Dialog: `Modal`, `ConfirmDialog`
- Branding: `ApplicationLogo`

Dashboard panels:

- `OverviewPanel.vue`
- `UserManagementPanel.vue`
- `RoleManagementPanel.vue`
- `CustomPermissionsPanel.vue`
- `BranchManagementPanel.vue`
- `SubjectManagementPanel.vue`
- `BatchManagementPanel.vue`
- `IncomeManagementPanel.vue`
- `ExpenseManagementPanel.vue`
- `DailyClosingUpdatesPanel.vue`
- `TimeSlotsManagementPanel.vue`
- `TeachersManagementPanel.vue`
- `TeacherDashboardPanel.vue`
- `BankingsManagementPanel.vue`
- `ClassCountingSheetsPanel.vue`
- `TransfersManagementPanel.vue`
- `LibraryManagementPanel.vue`
- `RequisitionManagementPanel.vue`
- `NoticeManagementPanel.vue`
- `NoticeTicker.vue`
- `ReportsPanel.vue`
- `SettingsPanel.vue`
- `SystemMaintenancePanel.vue`

## ৩৩. Import/Export System

CSV import exists in many modules:

- Users
- Branches
- Subjects
- Batches
- Batch types
- Incomes
- Expenses
- Daily closing updates
- Time slots
- Teachers
- Bankings
- Class counting sheets
- Transfers
- Library payment methods
- Publishers
- Libraries
- Courier companies
- Books
- Library orders

Common import behavior:

1. Sample CSV download route।
2. CSV/TXT upload max 5MB।
3. Header validation।
4. Row validation।
5. Transaction-based insert/update where needed।
6. Error response with row-level issues।

Frontend export:

- CSV export with visible/filtered rows।
- Excel export using `xlsx` package।

## ৩৪. Soft Delete & Data Safety

এই প্রজেক্টে অনেক module soft delete ব্যবহার করে। এর ফলে delete করলে data সরাসরি database থেকে মুছে যায় না, trash state-এ যায়।

Supported actions:

- Soft delete
- Restore
- Force delete/permanent delete
- Bulk restore
- Bulk force delete

Data safety benefit:

- ভুল delete হলে restore করা যায়।
- Admin চাইলে permanent cleanup করতে পারে।

## ৩৫. File Uploads

File/image upload areas:

1. User avatar।
2. Profile avatar।
3. Teacher image।
4. Settings logo।
5. Daily closing receipt images।
6. Daily closing bank deposit slip images।
7. Requisition documents।

Storage:

- Laravel public disk।
- Route `/media/public/{path}` দিয়ে controlled serving।
- `public/storage` symlink expected।

## ৩৬. Notifications & Counters

Implemented notification-like elements:

1. Notice ticker।
2. Notice seen tracking।
3. Requisition notification count via layout props।
4. Requisition last seen timestamp columns in migration।

## ৩৭. Security & Authorization

Security features:

1. Auth middleware।
2. Email verified middleware for dashboard।
3. Permission middleware on module routes।
4. Role middleware for system tools and impersonation।
5. CSRF token regeneration endpoint।
6. Form request validation।
7. File type/size validation।
8. Unique constraints on important fields।
9. Super-admin controlled impersonation।
10. Branch and role visibility constraints।

## ৩৮. Seeded Access

Seeder অনুযায়ী default super-admin:

- Email: `admin@startup.local`
- Password: `password`
- Role: `super-admin`

Seeder file:

- `database/seeders/RolesAndPermissionsSeeder.php`

## ৩৯. Install & Run

README অনুযায়ী run commands:

```bash
composer install
npm install
php artisan migrate --seed
php artisan storage:link
npm run dev
php artisan serve
```

Composer dev command:

```bash
composer dev
```

এটি একসাথে Laravel server, queue listener, logs এবং Vite dev server চালানোর জন্য configured।

## ৪০. গুরুত্বপূর্ণ পর্যবেক্ষণ

1. প্রজেক্টটি সাধারণ Laravel skeleton নয়; এর ওপর বড় একটি institution operation dashboard তৈরি করা হয়েছে।
2. Module সংখ্যা অনেক এবং বেশিরভাগ module mature CRUD pattern follow করে।
3. Permission design granular, অর্থাৎ view/create/edit/delete আলাদা।
4. Frontend SPA হওয়ায় dashboard panel switch করলে full page reload লাগে না।
5. Import/export এবং soft delete support প্রজেক্টকে data-heavy admin application হিসেবে ব্যবহারযোগ্য করেছে।
6. Library management এবং requisition management সবচেয়ে বড় business modules।
7. Teacher login এবং teacher dashboard support থেকে বোঝা যায় teacher-specific access intended।
8. Daily closing module আর্থিক reporting-এর কেন্দ্রীয় source।

## ৪১. A to Z Module Checklist

- Authentication: আছে
- Email verification: আছে
- Profile management: আছে
- Dashboard overview: আছে
- Reports panel: আছে
- User management: আছে
- Role management: আছে
- Custom permissions: আছে
- Branch management: আছে
- Subject management: আছে
- Batch type management: আছে
- Batch management: আছে
- Income head management: আছে
- Expense head management: আছে
- Daily closing: আছে
- Time slot management: আছে
- Teacher management: আছে
- Teacher dashboard: আছে
- Banking management: আছে
- Class counting sheets: আছে
- Transfers: আছে
- Library payment methods: আছে
- Publishers: আছে
- Libraries/customers: আছে
- Courier companies: আছে
- Books: আছে
- Library orders: আছে
- Order payments: আছে
- Order refunds: আছে
- Requisition items: আছে
- Requisitions: আছে
- Notice management: আছে
- Notice ticker/seen tracking: আছে
- Settings/logo/theme: আছে
- System tools: আছে
- Public media serving: আছে
- CSV import: আছে
- CSV/Excel export: আছে
- Soft delete/restore/force delete: আছে
- Bulk actions: আছে
- Role/permission based UI: আছে
- Backend permission middleware: আছে

## ৪২. সংক্ষিপ্ত সিদ্ধান্ত

এই প্রজেক্টটি একটি পূর্ণাঙ্গ education/institution management SPA dashboard। এর উদ্দেশ্য হলো user access control, academic data, branch operation, daily accounting, library/order inventory, requisition workflow এবং notice communication এক platform-এ আনা। প্রজেক্টের architecture পরিষ্কারভাবে Laravel API/controller layer, Vue dashboard panels, Spatie permission based RBAC এবং database-driven modules-এর ওপর দাঁড়িয়ে আছে।
