# 🚀 OTIS: Personal Web System

A completely modular, production-ready Core Engine built with Pure PHP (OOP) & MySQL. No external dependencies or overhead frameworks.

---

## 📁 Final Production Folder Structure

```text
/OTIS
│
├── core/                   # ⚙️ Core System Engine
│   ├── Controller.php      # Base traffic director & View loader
│   ├── Database.php        # Secured PDO Singleton Wrapper
│   ├── Model.php           # Advanced ORM (Soft Deletes, Logging, CRUD)
│   └── Router.php          # Dynamic routing (/module/controller/method)
│
├── app/                    # 📦 Modular Application Code
│   ├── Views/              # Global UI Views
│   │   └── layouts/main.php # Bootstrap 5 RTL Master Template
│   │
│   └── Modules/            # 🧩 Completely Isolated Features
│       ├── Calendar/       # 12-Month Interactive Grid
│       ├── Education/      # Skills Matrix & Course tracking
│       ├── Finance/        # 50/20/20/10 Income Splitter & Tracker
│       ├── Health/         # Streaks & Physical Metric tracking
│       ├── System/         # Action Logs & Notifications
│       └── Todo/           # Time-traveling Daily Journal & Tasks
│
├── helpers/                # 🛠️ Utility Functions
│   └── functions.php       # helpers (CSRF, sanitize_input, session)
│
├── public/                 # 🌐 Public Web Root (Secured barrier)
│   ├── index.php           # System Bootstrap & Front Controller
│   ├── .htaccess           # Apache URL Rewriting Rules
│   └── assets/             # SCSS, CSS, JS, Fonts
│
└── database/               # 💾 SQL Schemas
    ├── main_schema.sql         # Foundation tables
    ├── health_schema.sql       # Health tables
    ├── finance_schema.sql      # Multi-finance tables
    ├── system_features.sql     # Soft Delete triggers & Action Logs
    ├── education_schema.sql    # Education tables
    ├── calendar_schema.sql     # Event tables
    └── todo_schema.sql         # Daily journal & Task tables
```

---

## 💻 XAMPP Local Setup Guide

1. **Clone the Repo**: Move the `/OTIS` folder directly inside `c:\xampp\htdocs\`.
2. **Setup the Database**:
   - Open browser and navigate to `http://localhost/phpmyadmin`
   - Create a new UTF-8 DB (e.g., `otis_db`)
   - Sequentially import **ALL SQL files** inside the `/database/` folder.
3. **Configure Environment Variables**:
   - Inside `core/Database.php` change credentials if needed (defaults to user `root`, pass `""`).
4. **Boot**: Visit `http://localhost/OTIS/public` to launch the application.

---

## 🌍 Namecheap Shared Hosting Deployment

1. **Prepare Public Folder**:
   - Compress the entire `/OTIS` project folder into a `.zip`.
2. **cPanel File Manager**:
   - Upload the `.zip` to `public_html` or within an Addon Domain root.
   - Extract the files.
   - **Crucial Security Step**: Move everything EXCEPT the `/public` folder _outside_ the `public_html/` web root. Adjust pathways in `public/index.php` respectively if you move the core root level.
3. **Update .htaccess**:
   - Ensure the `.htaccess` rules apply directly to forward all domain requests securely through your `public/index.php`.
4. **Namecheap Database Setup**:
   - Open **MySQL Databases** in cPanel.
   - Create a DB and a DB privileged user (Map them).
   - Go to **phpMyAdmin** and import your fully combined SQL structure tables.
   - Update `core/Database.php` with the live cPanel Database Name, User, and Password.
5. **SSL Activation**: Ensure AutoSSL is active in Namecheap cPanel routing to HTTPS.

**System is completely stable, optimized, and ready.**
