Skip to content

Local Development

Niraj Gautam edited this page Jul 4, 2025 · 1 revision

As Next PMS has React based frontend, follow the steps below to setup your local.

  1. Since Frappe's CSRF token will not be available to the React App while developing we need to ignore it, You can do it by adding ignore_csrf in your site_config.json.
# sites/<site-name>/site_config.json

"ignore_csrf":1
  1. Add allowed CORS, so we don't get CORS error with React app.
# sites/<site-name>/site_config.json

"allow_cors": "*",
  1. Create .env from .env.sample
VITE_BASE_URL="http://localhost"
VITE_SOCKET_PORT=5173
VITE_SITE_NAME="localhost"
VITE_ENABLE_SOCKET=true // Always keep it true as it is used
VITE_SITE_PORT=80

If you are using Frappe Manager, please create two envs, one for development and one for production

# .env.development
VITE_BASE_URL="http://<site-name>"
VITE_SOCKET_PORT=5173
VITE_SITE_NAME="<site-name>"
VITE_ENABLE_SOCKET=true // Always keep it true as it is used
VITE_SITE_PORT=80
# .env.production
VITE_BASE_URL="http://<site-name>"
VITE_SOCKET_PORT=80 // In production mode socketio listens at 80
VITE_SITE_NAME="<site-anme>"
VITE_ENABLE_SOCKET=true // Always keep it true as it is used
VITE_SITE_PORT=80
  1. Now run the Reat app from terminal on the host machine.
npm run dev

Clone this wiki locally