Index: QUICK_SETUP.md
===================================================================
--- QUICK_SETUP.md	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ QUICK_SETUP.md	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,113 @@
+# 🎯 Quick Database Setup Guide
+
+## For Windows Users (Recommended Path)
+
+### Option 1: Automatic Setup (Easiest) 🚀
+
+```
+📁 Your Project Folder
+├── 📜 setup-database-windows.bat    ← Double-click this!
+├── 📜 setup-database-windows.ps1    ← Or run this in PowerShell
+└── 📄 WINDOWS_DATABASE_SETUP.md     ← Detailed guide
+```
+
+**Just double-click `setup-database-windows.bat` and follow the prompts!**
+
+### Option 2: Manual Setup 🔧
+
+1. **Download PostgreSQL** 
+   - Go to: https://www.postgresql.org/download/windows/
+   - Download the installer
+   - Run as Administrator
+
+2. **During Installation**
+   - Set postgres password (remember it!)
+   - Keep default port (5432)
+   - Install all components
+
+3. **Run Our Setup Script**
+   - Double-click `setup-database-windows.bat`
+   - Enter your postgres password when prompted
+
+## For Linux/Mac Users 🐧🍎
+
+### Automatic Setup
+```bash
+cd kupi-mk
+chmod +x start-servers.sh
+./start-servers.sh
+```
+
+### Manual Setup
+```bash
+# Install PostgreSQL (if not installed)
+sudo apt install postgresql postgresql-contrib  # Ubuntu/Debian
+# or
+brew install postgresql  # macOS
+
+# Create database
+sudo -u postgres psql
+CREATE DATABASE kupi_mk;
+CREATE USER kupi_user WITH PASSWORD 'kupi_password';
+GRANT ALL PRIVILEGES ON DATABASE kupi_mk TO kupi_user;
+\q
+```
+
+## ✅ Verification Steps
+
+After setup, you should see:
+
+1. **PostgreSQL running** ✓
+2. **Database created** ✓
+3. **User created** ✓
+4. **Connection test passed** ✓
+5. **.env file created** ✓
+
+## 🚀 Start the Application
+
+### Windows:
+```cmd
+start-servers-windows.bat
+```
+
+### Linux/Mac:
+```bash
+./kupi-mk/start-servers.sh
+```
+
+### VS Code (All platforms):
+1. `Ctrl+Shift+P` → "Tasks: Run Task"
+2. Select "Start Backend Server"
+3. Select "Start Frontend Server"
+
+## 🌐 Access Your Application
+
+- **Frontend**: http://localhost:3000
+- **Backend API**: http://localhost:5000
+- **Network**: http://192.168.100.162:3000 (for other devices)
+
+## ❓ Need Help?
+
+1. **Windows users**: See `WINDOWS_DATABASE_SETUP.md`
+2. **Connection issues**: Check if PostgreSQL service is running
+3. **Port conflicts**: Make sure ports 3000 and 5000 are free
+4. **Password issues**: Try the setup script again
+
+## 🔧 Manual Configuration
+
+If automatic setup fails, create `.env` file in `kupi-mk/backend/`:
+
+```env
+DB_HOST=localhost
+DB_PORT=5432
+DB_NAME=kupi_mk
+DB_USER=kupi_user
+DB_PASSWORD=kupi_password
+JWT_SECRET=your_secret_key_here
+PORT=5000
+NODE_ENV=development
+```
+
+---
+
+**Most users can just run `setup-database-windows.bat` and be done in 2 minutes!** 🎉
Index: README.md
===================================================================
--- README.md	(revision 7e266178b50727346a82a51f7eb256e68c1941da)
+++ README.md	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -41,4 +41,33 @@
 ## 🚀 Инсталација и поставување
 
+### Автоматски старт (препорачано)
+
+#### Windows кориснници:
+```cmd
+# Користете Batch script
+start-servers-windows.bat
+
+# Или PowerShell script
+powershell -ExecutionPolicy Bypass -File start-servers-windows.ps1
+```
+
+#### Linux/MacOS кориснници:
+```bash
+chmod +x start-servers.sh
+./start-servers.sh
+```
+
+#### VS Code Tasks (сите платформи):
+1. Отворете го проектот во VS Code
+2. Притиснете `Ctrl+Shift+P` (Windows/Linux) или `Cmd+Shift+P` (Mac)
+3. Пишете "Tasks: Run Task"
+4. Изберете:
+   - "Install Backend Dependencies" (еднаш)
+   - "Install Frontend Dependencies" (еднаш)
+   - "Start Backend Server"
+   - "Start Frontend Server"
+
+### Рачен старт
+
 ### 1. Clone на репозиториумот
 ```bash
@@ -49,5 +78,29 @@
 ### 2. Поставување на базата на податоци
 
-#### За Linux/Mac:
+#### 🚀 Автоматски начин (Windows)
+
+За Windows кориснници, најлесно е да го користите автоматскиот скрипт:
+
+```cmd
+# Стартувајте го скриптот од root директориумот на проектот
+setup-database-windows.bat
+
+# Или со PowerShell (препорачано)
+powershell -ExecutionPolicy Bypass -File setup-database-windows.ps1
+```
+
+Скриптот ќе:
+- Провери дали PostgreSQL е инсталиран
+- Креира база и корисник
+- Конфигурира .env фајл
+- Тестира врска со базата
+
+#### 📖 Детален водич
+
+За детални инструкции за инсталација на PostgreSQL на Windows, видете:
+**[WINDOWS_DATABASE_SETUP.md](WINDOWS_DATABASE_SETUP.md)**
+
+#### 🐧 Рачно поставување (Linux/Mac)
+
 ```bash
 # Стартувај PostgreSQL сервис
@@ -58,15 +111,26 @@
 
 # Во PostgreSQL shell:
-CREATE USER admin WITH PASSWORD 'password123';
-CREATE DATABASE kupi_mk OWNER admin;
-GRANT ALL PRIVILEGES ON DATABASE kupi_mk TO admin;
+CREATE DATABASE kupi_mk;
+CREATE USER kupi_user WITH PASSWORD 'kupi_password';
+GRANT ALL PRIVILEGES ON DATABASE kupi_mk TO kupi_user;
 \q
 ```
 
-#### За Windows:
+#### 🪟 Рачно поставување (Windows)
+
 ```cmd
 # Отвори Command Prompt како Administrator
 # Стартувај PostgreSQL сервис (ако не е веќе стартуван)
-net start postgresql-x64-13
+net start postgresql-x64-15
+
+# Поврзи се со PostgreSQL
+psql -U postgres -h localhost
+
+# Во PostgreSQL shell:
+CREATE DATABASE kupi_mk;
+CREATE USER kupi_user WITH PASSWORD 'kupi_password';
+GRANT ALL PRIVILEGES ON DATABASE kupi_mk TO kupi_user;
+\q
+```
 
 # Поврзи се со psql
Index: SETUP_INDEX.md
===================================================================
--- SETUP_INDEX.md	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ SETUP_INDEX.md	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,130 @@
+# 📚 Complete Setup Documentation Index
+
+Welcome to Kupi.mk! This page helps you find the right setup guide for your needs.
+
+## 🚀 Quick Start (Most Users)
+
+**Just want to get started quickly?**
+
+### Windows Users:
+1. Download and install PostgreSQL from [official website](https://www.postgresql.org/download/windows/)
+2. Double-click `setup-database-windows.bat` in the project root
+3. Double-click `start-servers-windows.bat` to start everything
+4. Open http://localhost:3000 in your browser
+
+### Linux/Mac Users:
+1. Install PostgreSQL: `sudo apt install postgresql` (Ubuntu) or `brew install postgresql` (Mac)
+2. Run: `./kupi-mk/start-servers.sh`
+3. Open http://localhost:3000 in your browser
+
+## 📖 Detailed Documentation
+
+Choose the guide that fits your situation:
+
+### 🪟 Windows Users
+- **[WINDOWS_DATABASE_SETUP.md](WINDOWS_DATABASE_SETUP.md)** - Complete PostgreSQL setup guide for Windows
+  - Multiple installation methods (Official installer, Docker, pgAdmin)
+  - Step-by-step screenshots and instructions
+  - Troubleshooting section
+  - Environment configuration
+
+### 🚀 All Platforms
+- **[QUICK_SETUP.md](QUICK_SETUP.md)** - Fast setup guide for all operating systems
+  - Automated scripts for Windows/Linux/Mac
+  - Visual guide with file structure
+  - Verification steps
+  - Common issues and solutions
+
+- **[README.md](README.md)** - Main project documentation
+  - Project overview and features
+  - Technology stack
+  - Manual installation steps
+  - Development workflow
+
+## 🛠️ Setup Scripts Reference
+
+### Automated Database Setup
+| Platform | Script | Description |
+|----------|--------|-------------|
+| Windows (Batch) | `setup-database-windows.bat` | Simple batch script with prompts |
+| Windows (PowerShell) | `setup-database-windows.ps1` | Advanced script with colors and validation |
+| Linux/Mac | Manual setup in start script | Integrated into start-servers.sh |
+
+### Server Management
+| Platform | Start Script | Stop Script |
+|----------|-------------|------------|
+| Windows | `start-servers-windows.bat` | `stop-servers-windows.bat` |
+| Windows | `start-servers-windows.ps1` | Built into PowerShell script |
+| Linux/Mac | `kupi-mk/start-servers.sh` | `kupi-mk/stop-servers.sh` |
+
+### VS Code Integration
+- **Tasks**: Use `Ctrl+Shift+P` → "Tasks: Run Task"
+  - Install Backend Dependencies
+  - Install Frontend Dependencies  
+  - Start Backend Server
+  - Start Frontend Server
+  - Stop All Servers
+
+## 🎯 What Each File Does
+
+```
+📁 Project Root
+├── 📄 README.md                      # Main project documentation
+├── 📄 WINDOWS_DATABASE_SETUP.md      # Detailed Windows PostgreSQL guide
+├── 📄 QUICK_SETUP.md                 # Fast setup for all platforms
+├── 📄 SETUP_INDEX.md                 # This file - documentation index
+├── 🚀 setup-database-windows.bat     # Windows database setup (simple)
+├── 🚀 setup-database-windows.ps1     # Windows database setup (advanced)
+├── 🚀 start-servers-windows.bat      # Windows server startup
+├── 🚀 start-servers-windows.ps1      # Windows server startup (PowerShell)
+├── 🚀 stop-servers-windows.bat       # Windows server shutdown
+├── 📦 package.json                   # Root workspace configuration
+└── 📁 .vscode/
+    ├── 📄 tasks.json                 # VS Code tasks (cross-platform)
+    ├── 📄 launch.json                # VS Code debugging config
+    └── 📄 settings.json              # VS Code workspace settings
+```
+
+## 🎯 Recommended Setup Path
+
+### For Beginners:
+1. **Windows**: Use `setup-database-windows.bat` → `start-servers-windows.bat`
+2. **Mac/Linux**: Follow [QUICK_SETUP.md](QUICK_SETUP.md)
+
+### For Developers:
+1. Read [README.md](README.md) for project overview
+2. Use VS Code tasks for development workflow
+3. Refer to [WINDOWS_DATABASE_SETUP.md](WINDOWS_DATABASE_SETUP.md) for troubleshooting
+
+### For Advanced Users:
+1. Use PowerShell scripts on Windows
+2. Customize `.env` configuration
+3. Set up Docker if preferred
+4. Use VS Code debugging configuration
+
+## 🆘 Getting Help
+
+### Common Issues:
+1. **PostgreSQL not installed**: See [WINDOWS_DATABASE_SETUP.md](WINDOWS_DATABASE_SETUP.md)
+2. **Port conflicts**: Check if other apps use ports 3000, 5000, 5432
+3. **Permission errors**: Run scripts as Administrator (Windows)
+4. **Path issues**: Ensure PostgreSQL is in system PATH
+
+### Support Resources:
+- 📖 Check the troubleshooting sections in each guide
+- 🔍 Search for error messages in the documentation
+- 🛠️ Try the alternative setup methods
+- 💻 Use VS Code tasks for consistent behavior
+
+## 🎉 Success Indicators
+
+You know setup worked when:
+- ✅ PostgreSQL service is running
+- ✅ Database `kupi_mk` exists
+- ✅ Backend starts without errors ("PostgreSQL Connected")
+- ✅ Frontend loads at http://localhost:3000
+- ✅ You can register/login to the application
+
+---
+
+**Most users can be up and running in under 5 minutes with the automated scripts!** 🚀
Index: WINDOWS_DATABASE_SETUP.md
===================================================================
--- WINDOWS_DATABASE_SETUP.md	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ WINDOWS_DATABASE_SETUP.md	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,327 @@
+# 🗄️ PostgreSQL Database Setup Guide for Windows
+
+This guide will walk you through setting up PostgreSQL database for the Kupi.mk project on Windows.
+
+## 📋 Prerequisites
+
+- Windows 10 or later
+- Administrator privileges on your computer
+- At least 1GB of free disk space
+
+## 🚀 Method 1: PostgreSQL Official Installer (Recommended)
+
+### Step 1: Download PostgreSQL
+
+1. Visit the official PostgreSQL website: https://www.postgresql.org/download/windows/
+2. Click on "Download the installer"
+3. Choose the latest stable version (PostgreSQL 15.x or 16.x)
+4. Download the Windows x86-64 installer
+
+### Step 2: Install PostgreSQL
+
+1. **Run the installer** as Administrator (right-click → "Run as administrator")
+2. **Installation Directory**: Keep default (`C:\Program Files\PostgreSQL\15\`)
+3. **Components Selection**: Check all boxes:
+   - ✅ PostgreSQL Server
+   - ✅ pgAdmin 4
+   - ✅ Stack Builder
+   - ✅ Command Line Tools
+4. **Data Directory**: Keep default (`C:\Program Files\PostgreSQL\15\data`)
+5. **Password**: Enter a strong password for the `postgres` superuser
+   - ⚠️ **IMPORTANT**: Remember this password! You'll need it later
+   - Example: `postgres123` (use a stronger password in production)
+6. **Port**: Keep default (`5432`)
+7. **Advanced Options**: Keep default locale
+8. **Pre Installation Summary**: Review and click "Next"
+9. **Ready to Install**: Click "Next" to begin installation
+10. **Installation Progress**: Wait for completion (5-10 minutes)
+11. **Completing Setup**: Uncheck "Launch Stack Builder" and click "Finish"
+
+### Step 3: Verify Installation
+
+1. **Open Command Prompt** as Administrator
+2. **Add PostgreSQL to PATH** (if not already added):
+   ```cmd
+   setx PATH "%PATH%;C:\Program Files\PostgreSQL\15\bin" /M
+   ```
+3. **Close and reopen Command Prompt**
+4. **Test PostgreSQL**:
+   ```cmd
+   psql --version
+   ```
+   You should see: `psql (PostgreSQL) 15.x`
+
+### Step 4: Create Database for Kupi.mk
+
+1. **Open Command Prompt** as Administrator
+2. **Connect to PostgreSQL**:
+   ```cmd
+   psql -U postgres -h localhost
+   ```
+3. **Enter the password** you set during installation
+4. **Create the database**:
+   ```sql
+   CREATE DATABASE kupi_mk;
+   ```
+5. **Create a user for the project**:
+   ```sql
+   CREATE USER kupi_user WITH PASSWORD 'kupi_password';
+   ```
+6. **Grant privileges**:
+   ```sql
+   GRANT ALL PRIVILEGES ON DATABASE kupi_mk TO kupi_user;
+   ```
+7. **Exit PostgreSQL**:
+   ```sql
+   \q
+   ```
+
+### Step 5: Configure Environment Variables
+
+1. **Create `.env` file** in `kupi-mk/backend/` folder:
+   ```cmd
+   cd "C:\path\to\your\project\kupi-mk\backend"
+   echo. > .env
+   ```
+
+2. **Edit the `.env` file** with Notepad:
+   ```cmd
+   notepad .env
+   ```
+
+3. **Add the following configuration**:
+   ```env
+   # Database Configuration
+   DB_HOST=localhost
+   DB_PORT=5432
+   DB_NAME=kupi_mk
+   DB_USER=kupi_user
+   DB_PASSWORD=kupi_password
+
+   # JWT Secret (change this to a random string)
+   JWT_SECRET=your_super_secret_jwt_key_here_change_this
+
+   # Server Configuration
+   PORT=5000
+   NODE_ENV=development
+
+   # File Upload Configuration
+   UPLOAD_PATH=uploads/products
+   MAX_FILE_SIZE=5242880
+   ```
+
+4. **Save and close** the file
+
+## 🐳 Method 2: Using Docker (Alternative)
+
+If you prefer using Docker:
+
+### Step 1: Install Docker Desktop
+
+1. Download Docker Desktop from: https://www.docker.com/products/docker-desktop/
+2. Install and restart your computer
+3. Start Docker Desktop
+
+### Step 2: Run PostgreSQL Container
+
+1. **Open Command Prompt**
+2. **Run PostgreSQL container**:
+   ```cmd
+   docker run --name kupi-postgres ^
+   -e POSTGRES_DB=kupi_mk ^
+   -e POSTGRES_USER=kupi_user ^
+   -e POSTGRES_PASSWORD=kupi_password ^
+   -p 5432:5432 ^
+   -d postgres:15
+   ```
+
+3. **Verify container is running**:
+   ```cmd
+   docker ps
+   ```
+
+### Step 3: Configure Environment
+
+Use the same `.env` configuration as Method 1.
+
+## 🔧 Method 3: Using pgAdmin 4 (GUI Method)
+
+If you prefer a graphical interface:
+
+### Step 1: Open pgAdmin 4
+
+1. **Find pgAdmin 4** in Start Menu
+2. **Launch pgAdmin 4**
+3. **Set master password** (first time only)
+
+### Step 2: Connect to PostgreSQL
+
+1. **Right-click "Servers"** in the left panel
+2. **Create > Server...**
+3. **General Tab**:
+   - Name: `Kupi MK Server`
+4. **Connection Tab**:
+   - Host: `localhost`
+   - Port: `5432`
+   - Username: `postgres`
+   - Password: [your postgres password]
+5. **Click "Save"**
+
+### Step 3: Create Database
+
+1. **Right-click "Databases"** under your server
+2. **Create > Database...**
+3. **Database name**: `kupi_mk`
+4. **Click "Save"**
+
+### Step 4: Create User
+
+1. **Right-click "Login/Group Roles"**
+2. **Create > Login/Group Role...**
+3. **General Tab**:
+   - Name: `kupi_user`
+4. **Definition Tab**:
+   - Password: `kupi_password`
+5. **Privileges Tab**:
+   - ✅ Can login?
+   - ✅ Create databases?
+6. **Click "Save"**
+
+## 🧪 Testing the Database Connection
+
+### Test 1: Command Line Test
+
+```cmd
+cd "C:\path\to\your\project\kupi-mk\backend"
+psql -h localhost -U kupi_user -d kupi_mk
+```
+
+### Test 2: Node.js Test
+
+1. **Create test file** `test-db.js` in backend folder:
+   ```javascript
+   const { Pool } = require('pg');
+   require('dotenv').config();
+
+   const pool = new Pool({
+     user: process.env.DB_USER,
+     host: process.env.DB_HOST,
+     database: process.env.DB_NAME,
+     password: process.env.DB_PASSWORD,
+     port: process.env.DB_PORT,
+   });
+
+   async function testConnection() {
+     try {
+       const client = await pool.connect();
+       console.log('✅ Database connected successfully!');
+       
+       const result = await client.query('SELECT NOW()');
+       console.log('Current time:', result.rows[0].now);
+       
+       client.release();
+       process.exit(0);
+     } catch (err) {
+       console.error('❌ Database connection failed:', err.message);
+       process.exit(1);
+     }
+   }
+
+   testConnection();
+   ```
+
+2. **Run the test**:
+   ```cmd
+   cd kupi-mk\backend
+   npm install pg dotenv
+   node test-db.js
+   ```
+
+## 🚨 Troubleshooting
+
+### Problem 1: "psql is not recognized"
+
+**Solution**: Add PostgreSQL to PATH manually
+```cmd
+set PATH=%PATH%;C:\Program Files\PostgreSQL\15\bin
+```
+
+### Problem 2: "Connection refused"
+
+**Solutions**:
+1. **Check if PostgreSQL service is running**:
+   ```cmd
+   services.msc
+   ```
+   Look for "postgresql-x64-15" and start it if stopped
+
+2. **Check firewall settings**:
+   - Allow PostgreSQL through Windows Firewall
+   - Default port: 5432
+
+### Problem 3: "Authentication failed"
+
+**Solutions**:
+1. **Reset postgres password**:
+   ```cmd
+   # Stop PostgreSQL service first
+   net stop postgresql-x64-15
+   
+   # Start in single user mode and reset password
+   # (This is complex - easier to reinstall)
+   ```
+
+2. **Or reinstall PostgreSQL** with a new password
+
+### Problem 4: "Database does not exist"
+
+**Solution**: Create the database again:
+```sql
+psql -U postgres
+CREATE DATABASE kupi_mk;
+```
+
+## ✅ Final Verification Checklist
+
+Before starting the Kupi.mk application:
+
+- [ ] PostgreSQL is installed and running
+- [ ] Database `kupi_mk` is created
+- [ ] User `kupi_user` exists with proper permissions
+- [ ] `.env` file is configured in `kupi-mk/backend/`
+- [ ] Database connection test passes
+- [ ] Node.js can connect to the database
+
+## 🎯 Next Steps
+
+After database setup is complete:
+
+1. **Start the backend server**:
+   ```cmd
+   cd kupi-mk\backend
+   npm install
+   npm run dev
+   ```
+
+2. **Check backend logs** for "PostgreSQL Connected" message
+
+3. **The database tables will be created automatically** when you start the backend for the first time
+
+## 📞 Need Help?
+
+If you encounter issues:
+
+1. **Check the error messages** carefully
+2. **Verify your `.env` file** configuration
+3. **Ensure PostgreSQL service is running**
+4. **Try restarting your computer** after installation
+5. **Consider using Docker method** if installation issues persist
+
+## 🔐 Security Notes
+
+For production use:
+- Use stronger passwords
+- Restrict database access
+- Use environment-specific configurations
+- Enable SSL connections
+- Regular backups
Index: kupi-mk/backend/routes/products.js
===================================================================
--- kupi-mk/backend/routes/products.js	(revision 7e266178b50727346a82a51f7eb256e68c1941da)
+++ kupi-mk/backend/routes/products.js	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -230,5 +230,63 @@
     }
 
-    res.json({ message: 'Product deleted successfully' });
+    res.json({ message: 'Product deactivated successfully' });
+
+  } catch (err) {
+    console.error(err);
+    res.status(500).json({ message: 'Server error' });
+  }
+});
+
+// Reactivate product (requires authentication and ownership)
+router.patch('/:id/reactivate', auth, async (req, res) => {
+  try {
+    const { id } = req.params;
+    const sellerId = req.user.userId;
+
+    const reactivatedProduct = await pool.query(
+      'UPDATE products SET is_active = true WHERE id = $1 AND seller_id = $2 RETURNING *',
+      [id, sellerId]
+    );
+
+    if (reactivatedProduct.rows.length === 0) {
+      return res.status(404).json({ message: 'Product not found or unauthorized' });
+    }
+
+    res.json({ message: 'Product reactivated successfully' });
+
+  } catch (err) {
+    console.error(err);
+    res.status(500).json({ message: 'Server error' });
+  }
+});
+
+// Permanently delete product (requires authentication and ownership)
+router.delete('/:id/permanent', auth, async (req, res) => {
+  try {
+    const { id } = req.params;
+    const sellerId = req.user.userId;
+
+    // First check if the product exists and belongs to the user
+    const productCheck = await pool.query(
+      'SELECT * FROM products WHERE id = $1 AND seller_id = $2',
+      [id, sellerId]
+    );
+
+    if (productCheck.rows.length === 0) {
+      return res.status(404).json({ message: 'Product not found or unauthorized' });
+    }
+
+    // Check if product is deactivated (safety check)
+    if (productCheck.rows[0].is_active) {
+      return res.status(400).json({ message: 'Cannot permanently delete an active product. Deactivate it first.' });
+    }
+
+    // Permanently delete the product
+    const deletedProduct = await pool.query(
+      'DELETE FROM products WHERE id = $1 AND seller_id = $2 RETURNING *',
+      [id, sellerId]
+    );
+
+    res.json({ message: 'Product permanently deleted successfully' });
 
   } catch (err) {
Index: kupi-mk/frontend/src/pages/EditProduct.js
===================================================================
--- kupi-mk/frontend/src/pages/EditProduct.js	(revision 7e266178b50727346a82a51f7eb256e68c1941da)
+++ kupi-mk/frontend/src/pages/EditProduct.js	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -1,3 +1,3 @@
-import React, { useState, useEffect } from 'react';
+import React, { useState, useEffect, useCallback } from 'react';
 import { useParams, useNavigate } from 'react-router-dom';
 import { useProducts } from '../context/ProductContext';
@@ -26,8 +26,7 @@
   useEffect(() => {
     fetchCategories();
-    loadProduct();
-  }, [id, fetchCategories]); // eslint-disable-line react-hooks/exhaustive-deps
-
-  const loadProduct = async () => {
+  }, []); // eslint-disable-line react-hooks/exhaustive-deps
+
+  const loadProduct = useCallback(async () => {
     try {
       const response = await api.get(`/products/${id}`);
@@ -50,5 +49,9 @@
       setLoadingProduct(false);
     }
-  };
+  }, [id]);
+
+  useEffect(() => {
+    loadProduct();
+  }, [loadProduct]);
 
   const handleChange = (e) => {
Index: kupi-mk/frontend/src/pages/ProductDetail.js
===================================================================
--- kupi-mk/frontend/src/pages/ProductDetail.js	(revision 7e266178b50727346a82a51f7eb256e68c1941da)
+++ kupi-mk/frontend/src/pages/ProductDetail.js	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -9,4 +9,23 @@
   const [loading, setLoading] = useState(true);
   const [currentImageIndex, setCurrentImageIndex] = useState(0);
+  const [showShareMessage, setShowShareMessage] = useState(false);
+
+  const copyProductLink = () => {
+    const productUrl = window.location.href;
+    navigator.clipboard.writeText(productUrl).then(() => {
+      setShowShareMessage(true);
+      setTimeout(() => setShowShareMessage(false), 3000);
+    }).catch(() => {
+      // Fallback for older browsers
+      const textArea = document.createElement('textarea');
+      textArea.value = productUrl;
+      document.body.appendChild(textArea);
+      textArea.select();
+      document.execCommand('copy');
+      document.body.removeChild(textArea);
+      setShowShareMessage(true);
+      setTimeout(() => setShowShareMessage(false), 3000);
+    });
+  };
 
   useEffect(() => {
@@ -169,4 +188,17 @@
                 Пораќај преку WhatsApp
               </button>
+              
+              <button 
+                onClick={copyProductLink}
+                className="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition-colors flex items-center justify-center gap-2"
+              >
+                📋 Сподели линк
+              </button>
+              
+              {showShareMessage && (
+                <div className="text-center p-3 bg-green-100 text-green-800 rounded-lg">
+                  ✅ Линкот е копиран!
+                </div>
+              )}
             </div>
           </div>
Index: kupi-mk/frontend/src/pages/Profile.js
===================================================================
--- kupi-mk/frontend/src/pages/Profile.js	(revision 7e266178b50727346a82a51f7eb256e68c1941da)
+++ kupi-mk/frontend/src/pages/Profile.js	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -26,13 +26,43 @@
 
   const handleDeleteProduct = async (productId, productTitle) => {
-    if (window.confirm(`Дали сте сигурни дека сакате да го избришете производот "${productTitle}"?`)) {
+    if (window.confirm(`Дали сте сигурни дека сакате да го деактивирате производот "${productTitle}"? (може да се реактивира подоцна)`)) {
       try {
         await api.delete(`/products/${productId}`);
         // Refresh the products list
         fetchUserProducts();
-        alert('Производот е успешно избришан!');
+        alert('Производот е успешно деактивиран!');
       } catch (error) {
-        console.error('Error deleting product:', error);
-        alert('Грешка при бришење на производот');
+        console.error('Error deactivating product:', error);
+        alert('Грешка при деактивирање на производот');
+      }
+    }
+  };
+
+  const handleReactivateProduct = async (productId, productTitle) => {
+    if (window.confirm(`Дали сте сигурни дека сакате да го реактивирате производот "${productTitle}"?`)) {
+      try {
+        await api.patch(`/products/${productId}/reactivate`);
+        // Refresh the products list
+        fetchUserProducts();
+        alert('Производот е успешно реактивиран!');
+      } catch (error) {
+        console.error('Error reactivating product:', error);
+        alert('Грешка при реактивирање на производот');
+      }
+    }
+  };
+
+  const handlePermanentDelete = async (productId, productTitle) => {
+    if (window.confirm(`⚠️ ПРЕДУПРЕДУВАЊЕ: Дали сте сигурни дека сакате ТРАЈНО да го избришете производот "${productTitle}"? Оваа акција НЕ МОЖЕ да се врати!`)) {
+      if (window.confirm('Последно предупредување: Производот ќе биде трајно избришан. Продолжи?')) {
+        try {
+          await api.delete(`/products/${productId}/permanent`);
+          // Refresh the products list
+          fetchUserProducts();
+          alert('Производот е трајно избришан!');
+        } catch (error) {
+          console.error('Error permanently deleting product:', error);
+          alert('Грешка при трајно бришење на производот');
+        }
       }
     }
@@ -182,10 +212,27 @@
                       ✏️
                     </button>
-                    <button 
-                      onClick={() => handleDeleteProduct(product.id, product.title)}
-                      className="flex-1 bg-red-600 text-white px-2 py-1.5 rounded text-xs hover:bg-red-700 transition-colors"
-                    >
-                      🗑️
-                    </button>
+                    {product.is_active ? (
+                      <button 
+                        onClick={() => handleDeleteProduct(product.id, product.title)}
+                        className="flex-1 bg-red-600 text-white px-2 py-1.5 rounded text-xs hover:bg-red-700 transition-colors"
+                      >
+                        🚫
+                      </button>
+                    ) : (
+                      <>
+                        <button 
+                          onClick={() => handleReactivateProduct(product.id, product.title)}
+                          className="flex-1 bg-green-600 text-white px-2 py-1.5 rounded text-xs hover:bg-green-700 transition-colors"
+                        >
+                          ✅
+                        </button>
+                        <button 
+                          onClick={() => handlePermanentDelete(product.id, product.title)}
+                          className="flex-1 bg-red-800 text-white px-2 py-1.5 rounded text-xs hover:bg-red-900 transition-colors"
+                        >
+                          🗑️
+                        </button>
+                      </>
+                    )}
                   </div>
                 </div>
Index: kupi-mk/start-servers.sh
===================================================================
--- kupi-mk/start-servers.sh	(revision 7e266178b50727346a82a51f7eb256e68c1941da)
+++ kupi-mk/start-servers.sh	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# Colors for output
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+CYAN='\033[0;36m'
+NC='\033[0m' # No Color
+
+echo -e "${GREEN}Starting Kupi.mk Development Environment...${NC}"
+echo ""
+
+# Function to check if command was successful
+check_status() {
+    if [ $? -ne 0 ]; then
+        echo -e "${RED}$1${NC}"
+        exit 1
+    fi
+}
+
+# Install backend dependencies
+echo -e "${YELLOW}Installing Backend Dependencies...${NC}"
+cd backend
+npm install
+check_status "Failed to install backend dependencies"
+
+# Install frontend dependencies
+echo -e "${YELLOW}Installing Frontend Dependencies...${NC}"
+cd ../frontend
+npm install
+check_status "Failed to install frontend dependencies"
+
+# Start backend server in background
+echo -e "${YELLOW}Starting Backend Server...${NC}"
+cd ../backend
+npm run dev > ../backend.log 2>&1 &
+BACKEND_PID=$!
+echo "Backend PID: $BACKEND_PID"
+
+# Wait for backend to start
+echo -e "${YELLOW}Waiting for backend to start...${NC}"
+sleep 3
+
+# Check if backend is still running
+if ! kill -0 $BACKEND_PID 2>/dev/null; then
+    echo -e "${RED}Backend failed to start. Check backend.log for details.${NC}"
+    exit 1
+fi
+
+# Start frontend server
+echo -e "${YELLOW}Starting Frontend Server...${NC}"
+cd ../frontend
+export HOST=0.0.0.0
+npm start > ../frontend.log 2>&1 &
+FRONTEND_PID=$!
+echo "Frontend PID: $FRONTEND_PID"
+
+echo ""
+echo -e "${GREEN}Both servers are starting up...${NC}"
+echo -e "${CYAN}Backend: http://localhost:5000${NC}"
+echo -e "${CYAN}Frontend: http://localhost:3000${NC}"
+echo -e "${CYAN}Network: http://0.0.0.0:3000${NC}"
+echo ""
+echo -e "${GREEN}Process IDs:${NC}"
+echo "Backend PID: $BACKEND_PID"
+echo "Frontend PID: $FRONTEND_PID"
+echo ""
+echo -e "${YELLOW}To stop the servers, run:${NC}"
+echo "kill $BACKEND_PID $FRONTEND_PID"
+echo ""
+echo -e "${YELLOW}Logs are available in:${NC}"
+echo "Backend: $(pwd)/../backend.log"
+echo "Frontend: $(pwd)/../frontend.log"
+echo ""
+echo -e "${GREEN}Press Ctrl+C to stop monitoring or close this terminal.${NC}"
+
+# Monitor processes
+while true; do
+    if ! kill -0 $BACKEND_PID 2>/dev/null; then
+        echo -e "${RED}Backend process died!${NC}"
+        break
+    fi
+    if ! kill -0 $FRONTEND_PID 2>/dev/null; then
+        echo -e "${RED}Frontend process died!${NC}"
+        break
+    fi
+    sleep 5
+done
Index: kupi-mk/stop-servers.sh
===================================================================
--- kupi-mk/stop-servers.sh	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ kupi-mk/stop-servers.sh	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Colors for output
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+YELLOW='\033[1;33m'
+NC='\033[0m' # No Color
+
+echo -e "${YELLOW}Stopping Kupi.mk Development Servers...${NC}"
+echo ""
+
+# Stop all node processes related to the project
+echo -e "${YELLOW}Stopping Node.js processes...${NC}"
+pkill -f "npm run dev" 2>/dev/null
+pkill -f "npm start" 2>/dev/null
+pkill -f "node.*server.js" 2>/dev/null
+pkill -f "react-scripts" 2>/dev/null
+
+# Wait a moment for processes to terminate
+sleep 2
+
+# Check if any node processes are still running
+REMAINING=$(pgrep -f "npm|node.*kupi-mk" 2>/dev/null | wc -l)
+
+if [ $REMAINING -eq 0 ]; then
+    echo -e "${GREEN}All servers have been stopped successfully.${NC}"
+else
+    echo -e "${RED}Some processes may still be running. You may need to stop them manually.${NC}"
+    echo -e "${YELLOW}Running processes:${NC}"
+    pgrep -f "npm|node.*kupi-mk" -l 2>/dev/null || echo "None found"
+fi
+
+# Clean up log files
+if [ -f "../backend.log" ]; then
+    rm ../backend.log
+    echo -e "${GREEN}Cleaned up backend.log${NC}"
+fi
+
+if [ -f "../frontend.log" ]; then
+    rm ../frontend.log
+    echo -e "${GREEN}Cleaned up frontend.log${NC}"
+fi
+
+echo ""
Index: package.json
===================================================================
--- package.json	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ package.json	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,49 @@
+{
+  "name": "kupi-mk-workspace",
+  "version": "1.0.0",
+  "description": "Kupi.mk E-commerce Platform - Development Workspace",
+  "scripts": {
+    "install:all": "npm run install:backend && npm run install:frontend",
+    "install:backend": "cd kupi-mk/backend && npm install",
+    "install:frontend": "cd kupi-mk/frontend && npm install",
+    "start": "npm run start:backend & npm run start:frontend",
+    "start:backend": "cd kupi-mk/backend && npm run dev",
+    "start:frontend": "cd kupi-mk/frontend && cross-env HOST=0.0.0.0 npm start",
+    "stop": "npm run stop:windows || npm run stop:unix",
+    "stop:windows": "taskkill /f /im node.exe",
+    "stop:unix": "pkill -f 'npm run dev' && pkill -f 'npm start'",
+    "build": "cd kupi-mk/frontend && npm run build",
+    "test": "npm run test:backend && npm run test:frontend",
+    "test:backend": "cd kupi-mk/backend && npm test",
+    "test:frontend": "cd kupi-mk/frontend && npm test",
+    "lint": "npm run lint:backend && npm run lint:frontend",
+    "lint:backend": "cd kupi-mk/backend && npm run lint",
+    "lint:frontend": "cd kupi-mk/frontend && npm run lint",
+    "dev": "concurrently \"npm run start:backend\" \"npm run start:frontend\"",
+    "clean": "npm run clean:backend && npm run clean:frontend",
+    "clean:backend": "cd kupi-mk/backend && rm -rf node_modules package-lock.json",
+    "clean:frontend": "cd kupi-mk/frontend && rm -rf node_modules package-lock.json",
+    "setup": "npm run install:all && echo Setup complete! Run 'npm run dev' to start the development servers."
+  },
+  "devDependencies": {
+    "concurrently": "^8.2.2",
+    "cross-env": "^7.0.3"
+  },
+  "engines": {
+    "node": ">=14.0.0",
+    "npm": ">=6.0.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/AleksandarGr123/IT_project.git"
+  },
+  "keywords": [
+    "ecommerce",
+    "react",
+    "nodejs",
+    "postgresql",
+    "macedonia"
+  ],
+  "author": "Aleksandar",
+  "license": "MIT"
+}
Index: setup-database-windows.bat
===================================================================
--- setup-database-windows.bat	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ setup-database-windows.bat	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,190 @@
+@echo off
+title Kupi.mk Database Setup for Windows
+color 0A
+
+echo ===============================================
+echo    Kupi.mk Database Setup Assistant
+echo ===============================================
+echo.
+
+REM Check if PostgreSQL is installed
+echo [1/5] Checking PostgreSQL installation...
+psql --version >nul 2>&1
+if %errorlevel% equ 0 (
+    echo ✓ PostgreSQL is installed
+) else (
+    echo ✗ PostgreSQL is not installed or not in PATH
+    echo.
+    echo Please install PostgreSQL first:
+    echo 1. Download from: https://www.postgresql.org/download/windows/
+    echo 2. Run the installer as Administrator
+    echo 3. Remember the postgres user password
+    echo 4. Add PostgreSQL to PATH if needed
+    echo.
+    pause
+    exit /b 1
+)
+
+echo.
+echo [2/5] Testing PostgreSQL service...
+sc query postgresql-x64-15 | find "RUNNING" >nul
+if %errorlevel% equ 0 (
+    echo ✓ PostgreSQL service is running
+) else (
+    echo ! PostgreSQL service is not running
+    echo Starting PostgreSQL service...
+    net start postgresql-x64-15 >nul 2>&1
+    if %errorlevel% equ 0 (
+        echo ✓ PostgreSQL service started
+    ) else (
+        echo ✗ Failed to start PostgreSQL service
+        echo Please start it manually from Services
+        pause
+        exit /b 1
+    )
+)
+
+echo.
+echo [3/5] Creating database and user...
+echo.
+echo Please enter your PostgreSQL postgres user password:
+set /p postgres_password="Password: "
+
+REM Create database setup script
+echo CREATE DATABASE kupi_mk; > temp_setup.sql
+echo CREATE USER kupi_user WITH PASSWORD 'kupi_password'; >> temp_setup.sql
+echo GRANT ALL PRIVILEGES ON DATABASE kupi_mk TO kupi_user; >> temp_setup.sql
+echo \q >> temp_setup.sql
+
+REM Execute the setup script
+echo.
+echo Executing database setup...
+psql -U postgres -h localhost -f temp_setup.sql
+
+if %errorlevel% equ 0 (
+    echo ✓ Database and user created successfully
+) else (
+    echo ✗ Failed to create database. Please check your postgres password.
+    del temp_setup.sql
+    pause
+    exit /b 1
+)
+
+REM Clean up
+del temp_setup.sql
+
+echo.
+echo [4/5] Creating .env configuration file...
+
+REM Check if backend directory exists
+if not exist "kupi-mk\backend" (
+    echo ✗ Backend directory not found
+    echo Please run this script from the project root directory
+    pause
+    exit /b 1
+)
+
+REM Create .env file
+echo # Database Configuration > kupi-mk\backend\.env
+echo DB_HOST=localhost >> kupi-mk\backend\.env
+echo DB_PORT=5432 >> kupi-mk\backend\.env
+echo DB_NAME=kupi_mk >> kupi-mk\backend\.env
+echo DB_USER=kupi_user >> kupi-mk\backend\.env
+echo DB_PASSWORD=kupi_password >> kupi-mk\backend\.env
+echo. >> kupi-mk\backend\.env
+echo # JWT Secret ^(change this to a random string^) >> kupi-mk\backend\.env
+echo JWT_SECRET=your_super_secret_jwt_key_here_change_this_in_production >> kupi-mk\backend\.env
+echo. >> kupi-mk\backend\.env
+echo # Server Configuration >> kupi-mk\backend\.env
+echo PORT=5000 >> kupi-mk\backend\.env
+echo NODE_ENV=development >> kupi-mk\backend\.env
+echo. >> kupi-mk\backend\.env
+echo # File Upload Configuration >> kupi-mk\backend\.env
+echo UPLOAD_PATH=uploads/products >> kupi-mk\backend\.env
+echo MAX_FILE_SIZE=5242880 >> kupi-mk\backend\.env
+
+echo ✓ .env file created in kupi-mk\backend\.env
+
+echo.
+echo [5/5] Testing database connection...
+cd kupi-mk\backend
+
+REM Check if node_modules exists
+if not exist "node_modules" (
+    echo Installing backend dependencies...
+    call npm install
+)
+
+REM Create a simple test script
+echo const { Pool } = require^('pg'^); > test-connection.js
+echo require^('dotenv'^).config^(^); >> test-connection.js
+echo. >> test-connection.js
+echo const pool = new Pool^({ >> test-connection.js
+echo   user: process.env.DB_USER, >> test-connection.js
+echo   host: process.env.DB_HOST, >> test-connection.js
+echo   database: process.env.DB_NAME, >> test-connection.js
+echo   password: process.env.DB_PASSWORD, >> test-connection.js
+echo   port: process.env.DB_PORT, >> test-connection.js
+echo }^); >> test-connection.js
+echo. >> test-connection.js
+echo async function testConnection^(^) { >> test-connection.js
+echo   try { >> test-connection.js
+echo     const client = await pool.connect^(^); >> test-connection.js
+echo     console.log^('✓ Database connected successfully!'^); >> test-connection.js
+echo     client.release^(^); >> test-connection.js
+echo     process.exit^(0^); >> test-connection.js
+echo   } catch ^(err^) { >> test-connection.js
+echo     console.error^('✗ Database connection failed:', err.message^); >> test-connection.js
+echo     process.exit^(1^); >> test-connection.js
+echo   } >> test-connection.js
+echo } >> test-connection.js
+echo. >> test-connection.js
+echo testConnection^(^); >> test-connection.js
+
+REM Test the connection
+node test-connection.js
+
+if %errorlevel% equ 0 (
+    echo.
+    echo ===============================================
+    echo           🎉 SETUP COMPLETED SUCCESSFULLY! 🎉
+    echo ===============================================
+    echo.
+    echo Database Configuration:
+    echo - Database: kupi_mk
+    echo - Username: kupi_user
+    echo - Password: kupi_password
+    echo - Host: localhost
+    echo - Port: 5432
+    echo.
+    echo Next steps:
+    echo 1. Start the backend: npm run dev
+    echo 2. Start the frontend: cd ..\frontend ^&^& npm start
+    echo 3. Open http://localhost:3000 in your browser
+    echo.
+    echo Configuration saved in: kupi-mk\backend\.env
+    echo.
+) else (
+    echo.
+    echo ===============================================
+    echo              ⚠️ SETUP INCOMPLETE ⚠️
+    echo ===============================================
+    echo.
+    echo Database connection test failed.
+    echo Please check:
+    echo 1. PostgreSQL is running
+    echo 2. Postgres user password is correct
+    echo 3. Firewall settings allow port 5432
+    echo.
+    echo For detailed troubleshooting, see:
+    echo WINDOWS_DATABASE_SETUP.md
+    echo.
+)
+
+REM Clean up test file
+del test-connection.js
+
+cd ..\..
+echo.
+echo Press any key to exit...
+pause >nul
Index: setup-database-windows.ps1
===================================================================
--- setup-database-windows.ps1	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ setup-database-windows.ps1	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,280 @@
+# Kupi.mk Database Setup Script for Windows PowerShell
+# Run this script as Administrator for best results
+
+param(
+    [string]$PostgresPassword = "",
+    [switch]$SkipInstallCheck = $false
+)
+
+# Set console colors
+$Host.UI.RawUI.BackgroundColor = "Black"
+$Host.UI.RawUI.ForegroundColor = "Green"
+Clear-Host
+
+function Write-Header {
+    param([string]$Message)
+    Write-Host "===============================================" -ForegroundColor Cyan
+    Write-Host "   $Message" -ForegroundColor Yellow
+    Write-Host "===============================================" -ForegroundColor Cyan
+    Write-Host ""
+}
+
+function Write-Step {
+    param([string]$Step, [string]$Message)
+    Write-Host "[$Step] $Message" -ForegroundColor White
+}
+
+function Write-Success {
+    param([string]$Message)
+    Write-Host "✓ $Message" -ForegroundColor Green
+}
+
+function Write-Error {
+    param([string]$Message)
+    Write-Host "✗ $Message" -ForegroundColor Red
+}
+
+function Write-Warning {
+    param([string]$Message)
+    Write-Host "! $Message" -ForegroundColor Yellow
+}
+
+Write-Header "Kupi.mk Database Setup Assistant"
+
+# Step 1: Check PostgreSQL Installation
+Write-Step "1/6" "Checking PostgreSQL installation..."
+
+if (-not $SkipInstallCheck) {
+    try {
+        $psqlVersion = & psql --version 2>$null
+        if ($LASTEXITCODE -eq 0) {
+            Write-Success "PostgreSQL is installed: $psqlVersion"
+        } else {
+            throw "PostgreSQL not found"
+        }
+    } catch {
+        Write-Error "PostgreSQL is not installed or not in PATH"
+        Write-Host ""
+        Write-Host "Please install PostgreSQL first:" -ForegroundColor Yellow
+        Write-Host "1. Download from: https://www.postgresql.org/download/windows/" -ForegroundColor White
+        Write-Host "2. Run the installer as Administrator" -ForegroundColor White
+        Write-Host "3. Remember the postgres user password" -ForegroundColor White
+        Write-Host "4. Ensure 'Add to PATH' is checked during installation" -ForegroundColor White
+        Write-Host ""
+        Read-Host "Press Enter to exit"
+        exit 1
+    }
+}
+
+# Step 2: Check PostgreSQL Service
+Write-Step "2/6" "Checking PostgreSQL service..."
+
+$pgService = Get-Service -Name "postgresql*" -ErrorAction SilentlyContinue | Select-Object -First 1
+
+if ($pgService) {
+    if ($pgService.Status -eq "Running") {
+        Write-Success "PostgreSQL service is running"
+    } else {
+        Write-Warning "PostgreSQL service is stopped. Attempting to start..."
+        try {
+            Start-Service $pgService.Name
+            Write-Success "PostgreSQL service started"
+        } catch {
+            Write-Error "Failed to start PostgreSQL service"
+            Write-Host "Please start it manually from Services (services.msc)" -ForegroundColor Yellow
+            Read-Host "Press Enter to exit"
+            exit 1
+        }
+    }
+} else {
+    Write-Warning "PostgreSQL service not found. It might be installed differently."
+}
+
+# Step 3: Get PostgreSQL Password
+Write-Step "3/6" "Getting PostgreSQL credentials..."
+
+if ([string]::IsNullOrEmpty($PostgresPassword)) {
+    Write-Host ""
+    $securePassword = Read-Host "Enter your PostgreSQL 'postgres' user password" -AsSecureString
+    $PostgresPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePassword))
+}
+
+# Step 4: Create Database and User
+Write-Step "4/6" "Creating database and user..."
+
+$sqlCommands = @"
+CREATE DATABASE kupi_mk;
+CREATE USER kupi_user WITH PASSWORD 'kupi_password';
+GRANT ALL PRIVILEGES ON DATABASE kupi_mk TO kupi_user;
+"@
+
+# Create temporary SQL file
+$tempSqlFile = [System.IO.Path]::GetTempFileName() + ".sql"
+$sqlCommands | Out-File -FilePath $tempSqlFile -Encoding UTF8
+
+# Set PGPASSWORD environment variable
+$env:PGPASSWORD = $PostgresPassword
+
+try {
+    Write-Host "Executing database setup commands..." -ForegroundColor White
+    & psql -U postgres -h localhost -f $tempSqlFile 2>&1 | Out-Host
+    
+    if ($LASTEXITCODE -eq 0) {
+        Write-Success "Database and user created successfully"
+    } else {
+        throw "psql command failed"
+    }
+} catch {
+    Write-Error "Failed to create database. Please check your postgres password."
+    Remove-Item $tempSqlFile -ErrorAction SilentlyContinue
+    Read-Host "Press Enter to exit"
+    exit 1
+} finally {
+    # Clean up
+    Remove-Item $tempSqlFile -ErrorAction SilentlyContinue
+    Remove-Item Env:PGPASSWORD -ErrorAction SilentlyContinue
+}
+
+# Step 5: Create .env Configuration
+Write-Step "5/6" "Creating .env configuration file..."
+
+$backendPath = "kupi-mk\backend"
+if (-not (Test-Path $backendPath)) {
+    Write-Error "Backend directory not found: $backendPath"
+    Write-Host "Please run this script from the project root directory" -ForegroundColor Yellow
+    Read-Host "Press Enter to exit"
+    exit 1
+}
+
+$envContent = @"
+# Database Configuration
+DB_HOST=localhost
+DB_PORT=5432
+DB_NAME=kupi_mk
+DB_USER=kupi_user
+DB_PASSWORD=kupi_password
+
+# JWT Secret (change this to a random string in production)
+JWT_SECRET=your_super_secret_jwt_key_here_change_this_in_production
+
+# Server Configuration
+PORT=5000
+NODE_ENV=development
+
+# File Upload Configuration
+UPLOAD_PATH=uploads/products
+MAX_FILE_SIZE=5242880
+"@
+
+$envPath = Join-Path $backendPath ".env"
+$envContent | Out-File -FilePath $envPath -Encoding UTF8
+
+Write-Success ".env file created at: $envPath"
+
+# Step 6: Test Database Connection
+Write-Step "6/6" "Testing database connection..."
+
+Push-Location $backendPath
+
+# Check if node_modules exists
+if (-not (Test-Path "node_modules")) {
+    Write-Host "Installing backend dependencies..." -ForegroundColor White
+    & npm install
+    if ($LASTEXITCODE -ne 0) {
+        Write-Error "Failed to install dependencies"
+        Pop-Location
+        Read-Host "Press Enter to exit"
+        exit 1
+    }
+}
+
+# Create test script
+$testScript = @"
+const { Pool } = require('pg');
+require('dotenv').config();
+
+const pool = new Pool({
+  user: process.env.DB_USER,
+  host: process.env.DB_HOST,
+  database: process.env.DB_NAME,
+  password: process.env.DB_PASSWORD,
+  port: process.env.DB_PORT,
+});
+
+async function testConnection() {
+  try {
+    const client = await pool.connect();
+    console.log('✓ Database connected successfully!');
+    
+    const result = await client.query('SELECT version()');
+    console.log('PostgreSQL version:', result.rows[0].version.split(' ')[0] + ' ' + result.rows[0].version.split(' ')[1]);
+    
+    client.release();
+    await pool.end();
+    process.exit(0);
+  } catch (err) {
+    console.error('✗ Database connection failed:', err.message);
+    process.exit(1);
+  }
+}
+
+testConnection();
+"@
+
+$testScriptPath = "test-connection.js"
+$testScript | Out-File -FilePath $testScriptPath -Encoding UTF8
+
+# Run the test
+Write-Host "Testing database connection..." -ForegroundColor White
+& node $testScriptPath
+
+$connectionSuccess = $LASTEXITCODE -eq 0
+
+# Clean up
+Remove-Item $testScriptPath -ErrorAction SilentlyContinue
+Pop-Location
+
+# Final Results
+Write-Host ""
+if ($connectionSuccess) {
+    Write-Header "🎉 SETUP COMPLETED SUCCESSFULLY! 🎉"
+    
+    Write-Host "Database Configuration:" -ForegroundColor White
+    Write-Host "- Database: kupi_mk" -ForegroundColor Gray
+    Write-Host "- Username: kupi_user" -ForegroundColor Gray
+    Write-Host "- Password: kupi_password" -ForegroundColor Gray
+    Write-Host "- Host: localhost" -ForegroundColor Gray
+    Write-Host "- Port: 5432" -ForegroundColor Gray
+    Write-Host ""
+    
+    Write-Host "Next steps:" -ForegroundColor White
+    Write-Host "1. Start the backend server:" -ForegroundColor Gray
+    Write-Host "   cd kupi-mk\backend" -ForegroundColor Cyan
+    Write-Host "   npm run dev" -ForegroundColor Cyan
+    Write-Host ""
+    Write-Host "2. Start the frontend server:" -ForegroundColor Gray
+    Write-Host "   cd kupi-mk\frontend" -ForegroundColor Cyan
+    Write-Host "   npm start" -ForegroundColor Cyan
+    Write-Host ""
+    Write-Host "3. Open your browser to:" -ForegroundColor Gray
+    Write-Host "   http://localhost:3000" -ForegroundColor Cyan
+    Write-Host ""
+    Write-Host "Configuration saved in: kupi-mk\backend\.env" -ForegroundColor Yellow
+    
+} else {
+    Write-Header "⚠️ SETUP INCOMPLETE ⚠️"
+    
+    Write-Host "Database connection test failed." -ForegroundColor Red
+    Write-Host ""
+    Write-Host "Please check:" -ForegroundColor White
+    Write-Host "1. PostgreSQL is running" -ForegroundColor Gray
+    Write-Host "2. Postgres user password is correct" -ForegroundColor Gray
+    Write-Host "3. Firewall settings allow port 5432" -ForegroundColor Gray
+    Write-Host "4. No other application is using port 5432" -ForegroundColor Gray
+    Write-Host ""
+    Write-Host "For detailed troubleshooting, see:" -ForegroundColor White
+    Write-Host "WINDOWS_DATABASE_SETUP.md" -ForegroundColor Cyan
+}
+
+Write-Host ""
+Read-Host "Press Enter to exit"
Index: start-servers-windows.bat
===================================================================
--- start-servers-windows.bat	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ start-servers-windows.bat	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,44 @@
+@echo off
+echo Starting Kupi.mk Development Environment...
+echo.
+
+echo Installing Backend Dependencies...
+cd kupi-mk\backend
+call npm install
+if %errorlevel% neq 0 (
+    echo Failed to install backend dependencies
+    pause
+    exit /b 1
+)
+
+echo.
+echo Installing Frontend Dependencies...
+cd ..\frontend
+call npm install
+if %errorlevel% neq 0 (
+    echo Failed to install frontend dependencies
+    pause
+    exit /b 1
+)
+
+echo.
+echo Starting Backend Server...
+cd ..\backend
+start "Backend Server" cmd /k "npm run dev"
+
+echo.
+echo Waiting for backend to start...
+timeout /t 3 /nobreak > nul
+
+echo.
+echo Starting Frontend Server...
+cd ..\frontend
+start "Frontend Server" cmd /k "set HOST=0.0.0.0 && npm start"
+
+echo.
+echo Both servers are starting up...
+echo Backend: http://localhost:5000
+echo Frontend: http://localhost:3000
+echo.
+echo Press any key to close this window...
+pause > nul
Index: start-servers-windows.ps1
===================================================================
--- start-servers-windows.ps1	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ start-servers-windows.ps1	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,46 @@
+# PowerShell script to start Kupi.mk development environment
+Write-Host "Starting Kupi.mk Development Environment..." -ForegroundColor Green
+Write-Host ""
+
+Write-Host "Installing Backend Dependencies..." -ForegroundColor Yellow
+Set-Location "kupi-mk\backend"
+npm install
+if ($LASTEXITCODE -ne 0) {
+    Write-Host "Failed to install backend dependencies" -ForegroundColor Red
+    Read-Host "Press Enter to exit"
+    exit 1
+}
+
+Write-Host ""
+Write-Host "Installing Frontend Dependencies..." -ForegroundColor Yellow
+Set-Location "..\frontend"
+npm install
+if ($LASTEXITCODE -ne 0) {
+    Write-Host "Failed to install frontend dependencies" -ForegroundColor Red
+    Read-Host "Press Enter to exit"
+    exit 1
+}
+
+Write-Host ""
+Write-Host "Starting Backend Server..." -ForegroundColor Yellow
+Set-Location "..\backend"
+Start-Process powershell -ArgumentList "-NoExit", "-Command", "npm run dev" -WindowStyle Normal
+
+Write-Host ""
+Write-Host "Waiting for backend to start..." -ForegroundColor Yellow
+Start-Sleep -Seconds 3
+
+Write-Host ""
+Write-Host "Starting Frontend Server..." -ForegroundColor Yellow
+Set-Location "..\frontend"
+$env:HOST = "0.0.0.0"
+Start-Process powershell -ArgumentList "-NoExit", "-Command", "`$env:HOST='0.0.0.0'; npm start" -WindowStyle Normal
+
+Write-Host ""
+Write-Host "Both servers are starting up..." -ForegroundColor Green
+Write-Host "Backend: http://localhost:5000" -ForegroundColor Cyan
+Write-Host "Frontend: http://localhost:3000" -ForegroundColor Cyan
+Write-Host "Network: http://192.168.100.162:3000" -ForegroundColor Cyan
+Write-Host ""
+Write-Host "Press any key to close this window..." -ForegroundColor Gray
+Read-Host
Index: stop-servers-windows.bat
===================================================================
--- stop-servers-windows.bat	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
+++ stop-servers-windows.bat	(revision 65be0725ca7d5c8f5e0679e3088e41ea41abfcec)
@@ -0,0 +1,20 @@
+@echo off
+echo Stopping Kupi.mk Development Servers...
+echo.
+
+echo Stopping Node.js processes...
+taskkill /f /im node.exe 2>nul
+if %errorlevel% equ 0 (
+    echo Successfully stopped Node.js processes
+) else (
+    echo No Node.js processes were running
+)
+
+echo.
+echo Stopping npm processes...
+taskkill /f /im npm.cmd 2>nul
+
+echo.
+echo All servers have been stopped.
+echo.
+pause
