# ⚡ Quick Start Guide - 5 Minutes to Running

## Step 1: Start the Backend Server

Open **Terminal/PowerShell** in your project folder:

```bash
cd cardingcentral\server
npm start
```

✅ You should see:
```
✓ Database connected
✓ Database schema initialized
🚀 CardingCentral Server running on http://localhost:5000
```

**Keep this terminal open!**

## Step 2: Start the Frontend Client

Open a **new Terminal/PowerShell** window:

```bash
cd cardingcentral\client
npm run dev
```

✅ You should see:
```
  ➜  Local:   http://localhost:3000
```

## Step 3: Open in Browser

Visit: **http://localhost:3000**

You should see the CardingCentral homepage with:
- 💳 Logo and navigation
- 📝 Latest posts grid
- 🔗 Categories in header

## Step 4: Login to Admin

Click **"Admin"** button in top-right, then:

**Username:** `admin`
**Password:** `admin123`

Click **Login**

## Step 5: Create Your First Post

1. Click **"Dashboard"** or the 📝 icon
2. Click **"✍️ Create Post"** button
3. Fill in:
   - **Title**: "How to Protect Your Credit Card"
   - **Category**: "Card Security"
   - **Excerpt**: "Learn the best practices for keeping your cards secure online"

4. **Add Content Blocks**:
   - Click **"+ Add Block"**
   - Select **"📝 Paragraph"**
   - Type your content
   - Click **"+ Add Block"** again for more sections

5. **Add Images** (optional):
   - Click **"+ Add Block"**
   - Select **"🖼️ Image"**
   - Paste image URL (or use `/uploads/image.webp`)

6. **Optimize for SEO**:
   - Fill **Meta Title** (max 60 chars)
   - Fill **Meta Description** (max 160 chars)
   - Add **Keywords** (comma-separated)

7. Click **"Save Draft"**

## Step 6: View Your Post

1. Go to Homepage (click logo)
2. Your post should appear in grid
3. Click to read the full post

## 🎮 Try These Features

### Create Multiple Posts
- Create posts in different categories
- See them sorted by category

### Upload Images
- Go to **Admin → Media**
- Click **"Upload"** area
- Images auto-optimize to WebP + JPG

### Manage Categories
- Go to **Admin → Categories**
- Create a new category (e.g., "FAQ")
- Add it with color and SEO description

### Setup Telegram (Optional)
1. Get bot token from [@BotFather](https://t.me/botfather)
2. Go to **Admin → Settings**
3. Paste bot token
4. Enter chat ID (group or channel)
5. Click **"🧪 Test Connection"**
6. When you publish a post, Telegram gets notified!

## 🌐 URLs You'll Use

- **Homepage**: http://localhost:3000
- **Admin Dashboard**: http://localhost:3000/admin
- **API**: http://localhost:5000/api
- **Sitemap**: http://localhost:5000/sitemap.xml

## 📱 View Your Site Structure

After creating posts, your URLs will be:
- `/` - Homepage (shows all posts)
- `/card-security` - Category page (shows posts in this category)
- `/card-security/how-to-protect-your-credit-card` - Individual post

## ⚙️ Admin Features

**Dashboard** 📊
- View total posts, views, categories
- See chart of published vs draft
- Quick access buttons

**Posts** 📝
- List all posts (draft/published)
- Edit existing posts
- Delete posts
- Publish to go live

**Categories** 🗂️
- Create/edit categories
- Set colors and SEO info
- Categories appear in header automatically

**Media** 🖼️
- Upload and manage images
- Copy URL for use in posts
- WebP optimized (smaller, faster)

**Settings** ⚙️
- Configure site name
- Setup Telegram bot
- Test Telegram connection

## 🎯 SEO Optimization

Every post has SEO fields:

- **Meta Title** - Shows in Google search results (30-60 chars)
- **Meta Description** - Snippet under title (120-160 chars)
- **Keywords** - Helps with search ranking (comma-separated)
- **OG Image** - Preview when shared on social media
- **Reading Time** - Auto-calculated from content
- **URL Slug** - Auto-generated from title (changeable)

## 🚀 Pro Tips

1. **Organize with Categories** - Create categories first, then add posts
2. **Use Block Types** - Don't put everything in paragraphs:
   - Use `Heading` for sections
   - Use `Info` boxes for tips
   - Use `Warning` boxes for cautions
   - Use `Code` for snippets
3. **SEO Fields Matter** - Fill them for better Google ranking
4. **Banner Images** - Use 1200x600px for best results
5. **Test Before Publish** - Save as draft, preview, then publish
6. **Telegram Auto-Posts** - Once configured, posts auto-notify

## 🐛 Stuck?

### Server won't start?
- Check if port 5000 is free: `netstat -an | find "5000"`
- Check Node version: `node --version` (should be v22+)

### Client shows blank page?
- Check browser console for errors (F12)
- Make sure server is running on localhost:5000
- Try `npm run dev` again

### Can't login?
- Username: `admin`
- Password: `admin123`
- These are hardcoded in the demo

### Images not showing?
- Check `/uploads` folder exists
- Make sure full URL path is used
- Use `/uploads/filename.webp` format

## 📖 Next: Read Full README

Once you've tried the basics, check `README.md` for:
- Complete feature list
- API documentation
- Deployment instructions
- Database schema
- Advanced configuration

---

**Ready to build? Start with Step 1 above!** 🚀
