# START HERE - Installation Instructions

## What You Have

This is a **modernized, complete website with admin portal** for Aakash Digital. It's ready to deploy!

## Contents Overview

```
📦 Aakash Digital Website Package
├── 📄 Admin Portal (7 management pages)
├── 🌐 Public Website (5 modern pages)  
├── 🔌 REST APIs (5 endpoints)
├── 💾 MySQL Database (with schema)
├── 📚 Complete Documentation
└── 🚀 Ready to Deploy
```

## Quick Start (Choose One)

### Option A: Local Development (Windows/Mac/Linux)

**Requirements:**
- PHP 8.0+
- MySQL/MariaDB
- Web server (Apache/Nginx) OR PHP built-in server

**Steps:**

1. **Extract Files**
   - Unzip `v0-project-modernized.tar.gz`
   - Navigate to project folder

2. **Create Database**
   ```bash
   # Open MySQL
   mysql -u root -p
   
   # Run this (paste all):
   CREATE DATABASE aakash_digital CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
   GRANT ALL PRIVILEGES ON aakash_digital.* TO 'admin_user'@'localhost' IDENTIFIED BY 'admin123';
   FLUSH PRIVILEGES;
   USE aakash_digital;
   # Then paste contents of database/schema.sql
   ```

3. **Configure App**
   - Open `config/config.php`
   - Update these lines:
   ```php
   define('DB_HOST', 'localhost');
   define('DB_USER', 'admin_user');
   define('DB_PASS', 'admin123');
   define('DB_NAME', 'aakash_digital');
   define('APP_URL', 'http://localhost:8000');
   ```

4. **Run Server**
   ```bash
   cd project/public
   php -S localhost:8000
   ```

5. **Access Sites**
   - Public: `http://localhost:8000`
   - Admin: `http://localhost:8000/admin/login.php`
   - Login: `admin` / `admin123`

---

### Option B: Shared Hosting (Bluehost, Hostinger, etc.)

**Requirements:**
- PHP 8.0+ hosting
- MySQL database
- FTP/SFTP access

**Steps:**

1. **Upload Files**
   - Extract ZIP locally
   - Delete `node_modules/` folder (large)
   - Upload `public/`, `admin/`, `api/`, `config/`, `database/` folders via FTP
   - Point document root to `public/` folder in hosting control panel

2. **Create Database**
   - Go to hosting control panel (cPanel, Plesk, etc.)
   - Create new MySQL database
   - Create user for that database
   - Note credentials

3. **Configure**
   - Edit `config/config.php` via FTP
   - Enter database credentials from step 2
   - Set `APP_URL` to your domain

4. **Import Schema**
   - Go to hosting control panel → phpMyAdmin
   - Select your database
   - Import SQL from `database/schema.sql`

5. **Test**
   - Visit your domain
   - Go to `/admin/login.php`

---

### Option C: Heroku / Modern Cloud Platform

**Requirements:**
- Heroku account (free tier available)
- Heroku CLI installed

**Steps:**

1. **Prepare for Cloud**
   - Delete `node_modules/` folder
   - Create `.gitignore`:
   ```
   node_modules/
   .env
   *.log
   ```

2. **Deploy**
   ```bash
   # Initialize git
   git init
   git add .
   git commit -m "Initial commit"
   
   # Create Heroku app
   heroku create your-app-name
   
   # Add database
   heroku addons:create cleardb:ignite
   
   # Set environment variables
   heroku config:set APP_URL=https://your-app-name.herokuapp.com
   
   # Deploy
   git push heroku main
   ```

3. **Access**
   - Your site: `https://your-app-name.herokuapp.com`
   - Admin: `https://your-app-name.herokuapp.com/admin/login.php`

---

## File Structure Reference

```
public/                 ← Website files (users see this)
  index.php            ← Home page
  about.php            ← About page
  services.php         ← Services (dynamic)
  team.php             ← Team (dynamic)
  contact.php          ← Contact form
  uploads/             ← Place for user uploads

admin/                 ← Admin panel (protected)
  login.php            ← Admin login
  dashboard.php        ← Dashboard
  team.php             ← Manage team
  services.php         ← Manage services
  partners.php         ← Manage partners
  content.php          ← Edit page content
  submissions.php      ← View contact messages

api/                   ← Backend APIs
  team.php             ← Team data API
  services.php         ← Services API
  content.php          ← Content API
  partners.php         ← Partners API
  contact.php          ← Contact submission API

config/
  config.php           ← Database configuration (EDIT THIS!)

database/
  schema.sql           ← Database structure (import this)

📚 Documentation
  README.md            ← Full documentation
  QUICKSTART.md        ← Quick setup guide
  DEPLOYMENT.md        ← Production deployment
  BUILD_SUMMARY.md     ← What was built
```

---

## First Login

**Admin URL**: `yoursite.com/admin/login.php`
- **Username**: `admin`
- **Password**: `admin123`

⚠️ **Change this immediately after login!**

---

## Admin Panel - What You Can Do

Once logged in:

### 1. Add Team Member
- Admin → Team Members → "+ Add Member"
- Fill: Name, Position, Email, Bio
- Click Save
- Shows on public site instantly

### 2. Add Service
- Admin → Services → "+ Add Service"
- Fill: Title, Description, Icon
- Click Save
- Shows on Services page

### 3. Edit Website Content
- Admin → Page Content
- Select a page (Home, About, Services, etc.)
- Edit title, description, content
- Click Save

### 4. View Contact Messages
- Admin → Contact Submissions
- See all messages from contact form
- Click "View" to see full message

### 5. Manage Partners
- Admin → Partners → "+ Add Partner"
- Add company logos and links

---

## Common Problems & Solutions

### Q: "Database connection failed"
**A:** Check `config/config.php` - verify:
- DB_HOST is correct
- DB_USER exists and has access
- DB_PASS is correct
- DB_NAME exists

### Q: "404 Page Not Found"
**A:** Make sure:
- Web server document root points to `public/` folder
- `.htaccess` is in `public/` folder (Apache)
- Nginx rewrite rules configured (see DEPLOYMENT.md)

### Q: "Contact form not working"
**A:** Check:
- `public/uploads/` folder exists and is writable
- Database has `contact_submissions` table
- Database connection works

### Q: "Admin login not working"
**A:** 
- Username is `admin` (lowercase)
- Password is `admin123` (default)
- Check database has `admins` table
- Check browser cookies aren't blocked

### Q: "API returns empty"
**A:** 
- Database might be empty
- Try adding content via admin panel first
- Check browser console for errors

---

## What to Do Next

1. **✅ Set up database** (see Quick Start above)
2. **✅ Test public site** - view home, about, services pages
3. **✅ Test admin** - login and add sample data
4. **✅ Test contact form** - submit test message
5. **✅ Customize content** - add your team, services, text
6. **✅ Change admin password** - update immediately!
7. **✅ Enable HTTPS** - for production (see DEPLOYMENT.md)
8. **✅ Deploy live** - follow DEPLOYMENT.md for your host

---

## Documentation Files

Read these in order:

1. **QUICKSTART.md** - 5-minute setup (start here!)
2. **README.md** - Full feature documentation
3. **DEPLOYMENT.md** - Production deployment
4. **BUILD_SUMMARY.md** - What was built (reference)

---

## Key URLs Once Deployed

| URL | Purpose |
|-----|---------|
| `/` | Home page |
| `/about.php` | About us |
| `/services.php` | Services listing |
| `/team.php` | Team members |
| `/contact.php` | Contact form |
| `/admin/login.php` | Admin login |
| `/api/team.php` | Team data API |
| `/api/services.php` | Services API |
| `/api/content.php?page=home` | Page content API |

---

## Support

- Check documentation files (README.md, QUICKSTART.md, DEPLOYMENT.md)
- Review code comments in PHP files
- Check database/schema.sql for table structure
- Email: info@aakashdigital.com

---

## Technology Stack Summary

- **Frontend**: HTML5, Tailwind CSS, Alpine.js, DaisyUI
- **Backend**: PHP 8.0+
- **Database**: MySQL 5.7+
- **APIs**: RESTful JSON
- **Security**: Bcrypt passwords, prepared statements, input validation

---

## Next Steps

👉 **Go to QUICKSTART.md** for detailed setup instructions!

---

**You're ready to go!** 🚀

This is a complete, production-ready website. Follow the setup guide, add your content, and you're live!
