# 📚 StudyTrack LK - Installation Guide

## Files included:
- All PHP pages (index, login, register, dashboard, study-log, past-papers, goals, analytics, reminders, university)
- Admin panel (/admin/)
- CSS/JS assets
- Database SQL file

---

## ✅ STEP 1 — Create Database (phpMyAdmin)

1. Login to **cPanel → phpMyAdmin**
2. Click **"New"** on left sidebar
3. Create database named: `studytrack_db`
4. Click the new database → go to **SQL tab**
5. Copy everything from `database.sql` and paste → click **Go**

---

## ✅ STEP 2 — Configure Database Connection

Open `includes/db.php` and change:

```php
define('DB_HOST', 'localhost');           // Usually localhost
define('DB_USER', 'cpanelusername_db');   // cPanel username_dbname
define('DB_PASS', 'your_password');       // DB password you set
define('DB_NAME', 'cpanelusername_studytrack_db'); // Full DB name
```

> ⚠️ In cPanel, database names are prefixed with your cPanel username.
> Example: if your cPanel user is `john123`, your DB user is `john123_studytrack_db`

---

## ✅ STEP 3 — Upload Files

1. cPanel → **File Manager** → `public_html`
2. Upload the entire contents of this zip (NOT the folder, the contents inside)
3. Make sure `index.php` is directly in `public_html`

---

## ✅ STEP 4 — Test

1. Visit your domain — you should see the StudyTrack LK landing page
2. Register a new account
3. Start tracking!

---

## 🔑 Admin Login
- Email: `admin@studytrack.lk`
- Password: `admin123`
- ⚠️ Change this password immediately after first login!

---

## 📁 Folder Structure
```
public_html/
├── index.php          ← Landing page
├── login.php
├── register.php  
├── dashboard.php
├── study-log.php
├── past-papers.php
├── goals.php
├── analytics.php
├── reminders.php
├── university.php
├── logout.php
├── database.sql       ← Run this in phpMyAdmin (then delete)
├── .htaccess
├── includes/
│   ├── db.php         ← ⚠️ Edit this with your DB credentials
│   ├── functions.php
│   ├── header.php
│   └── footer.php
├── assets/
│   ├── css/style.css
│   └── js/main.js
└── admin/
    └── dashboard.php
```

---

## ❓ Common Issues

**"Connection failed"** → Check DB credentials in `includes/db.php`

**White page** → Check PHP error log in cPanel → Logs

**Can't login** → Make sure database tables were created correctly

---

Good luck with your A/Ls! 📚🎓
