## **1. Server Setup and Next.js Deployment** ### Setting Up the Server 1. **Prepare the Server**: - Ensure your Linux server is up-to-date: ```bash apt update && apt upgrade -y apt install nodejs && npm -y ``` - Install Node.js and npm: Use this guide https://nodejs.org/en/download/current NOTE: Node recommended version =v23.6.0 ### Install Dependencies 1. Install the project dependencies: ```bash npm install --legacy-peer-deps ``` ### Build the Project 1. Don't Build the project after installing dependencies (Finish the next steps first then build the project): ```bash npm run build ``` ### Start the Application 1. Start the application: ```bash npm start ``` 2. Optionally, use a process manager like `PM2` to keep the application running: ```bash npm install -g pm2 pm2 start npm --name "mawrd" -- start pm2 save pm2 startup ``` ### First time to use the website go to setup page: - Go to https://website-url.com/setup Setup the password of your admin account - Access Control page: Now you can access the control https://website-url.com/control admin page by providing the password from the setup page. Admin Credential already created: https://website-url.com/control admin niEluf5yTrlqEzZp@#GF1@#!asd