# cPanel Deployment Guide

## Prerequisites
- cPanel hosting with Node.js support
- Node.js version 18 or higher
- SSH access (recommended)

## Deployment Steps

### 1. Prepare Your Files
- Build your application: `npm run build`
- Ensure all files are ready for upload

### 2. Upload to cPanel
1. Log into your cPanel account
2. Go to "File Manager"
3. Navigate to your domain's root directory (usually `public_html`)
4. Upload all project files to the root directory

### 3. Set Up Node.js App
1. In cPanel, go to "Setup Node.js App"
2. Create a new Node.js application:
   - **Node.js version**: 18.x or higher
   - **Application mode**: Production
   - **Application root**: Your domain root
   - **Application URL**: Your domain
   - **Application startup file**: `server.js`
   - **Node.js package manager**: npm

### 4. Install Dependencies
1. In the Node.js App interface, click "Run NPM Install"
2. Wait for the installation to complete

### 5. Start the Application
1. In the Node.js App interface, click "Restart App"
2. Your application should now be running

### 6. Configure Domain
1. Make sure your domain points to the correct directory
2. The application will be available at your domain

## Important Notes

- The application runs on port 3000 by default
- cPanel will automatically handle the port configuration
- Make sure your hosting provider supports Node.js applications
- The `.htaccess` file handles routing for the Next.js application

## Troubleshooting

- If the app doesn't start, check the error logs in cPanel
- Ensure all dependencies are installed
- Verify Node.js version compatibility
- Check that the `server.js` file is in the root directory

## File Structure for Upload
```
public_html/
├── .next/
├── app/
├── components/
├── lib/
├── public/
├── server.js
├── package.json
├── next.config.mjs
└── .htaccess
``` 