PickBazar Documentation
WelcomeHow It Works
Prerequisite
Installation
Available Scripts & Command
How Can I use this app
Demo Deploy
Features
Settings
Payment
Flash Sale
Shop Transfer
Social LoginOTP (Mobile Number Verification)WalletEmail ConfigurationEmail VerificationSubscribeTerms and conditions
SEO and Analytics
Refund
Real-time Notification
Multilingual & Translation
Third-party Integrations
Deployment
AWSVirtual Private Server (Automated Script)cPanel/Managed ServerVercelVirtual Private Server (Manual)Re-build AdminAdmin build script - RUN on Local PCAndRe-build Shop
API
Back-End Integration
Customizations
Update & Upgrade Guide
FAQ PageContactQuestion & AnswerFAQBreaking ChangesSupportChange Log

How to rebuild admin?

When you upload the code to the server as a production, NextJS fetch its code from the build file. So after deployed, when you update or change code on scripts, the updated scripts don't work at admin end until you rebuild the project again. NextJs works this way.

Now there are two ways you can follow to rebuild admin,

If your server has more than 2+ CPU core and 6GB+ of memory, then you can directly edit code at your server then rebuild the project from the server directly using this command,

For admin,

Go to /var/www/pickbazar-laravel/admin/rest

yarn build

After completing the build, restart the PM2 process using this command,

pm2 restart 'all'

But suppose your server doesn't have that processing power, and you try to build your scripts directly from the server. In that case, your server will be shut down during the build, and you've to restart the server.

In that case, you can rebuild the admin at your local computer and upload them to your server.

Admin build script - RUN on Local PC

This is not recommended

Make sure that your domain name is set in .env file

adminenv.png

And

Make sure that your domain and basePath:`/admin ` is set in next.config.js file

adminconfig.png

Then run the below command from your pickbazar-laravel project root

zx deployment/rebuildadmin.mjs

If your code not upgraded the server then you can try manual process or other. Becouse we don't recommended this process.