ERPNext as backend API

Is it possible to use ERPNext solely as a backend API? I’m looking to avoid using all its functionalities because it includes a lot of features that I don’t need. Instead, I’d like to develop my own custom frontend.
To achieve this, I initially tried installing only the ERPNext repository. However, I soon realized that I also needed the Frappe repository since it’s the framework ERPNext relies on. So, I created a new directory with both repositories and attempted to run it using Docker. I set up a Dockerfile, requirements.txt, and other necessary files to initialize the API. Despite my efforts, I haven’t been able to get it running.
I have two questions:

  1. Is it feasible to set up ERPNext as a backend API in the way I’m envisioning?
  2. If so, how can I accomplish this?

Hi @cirojb:

Build the whole frontend for Erpnext would be challenging :slight_smile: Anyway, you can use all the backend methods, doctypes, etc …

Check this:
https://docs.frappe.io/framework/user/en/api/rest

Hope this helps.

Why install it then?

You can simply install Frappe Framework as a backend service and utilize its built-in functionalities, APIs included.

You can also develop your own custom Frappe app and only include your needed schemas and logic.

Frappe Framework as Backend API is possible.

General practice with frappe frontends is packing static assets, service workers, login experience and all other things as frappe www route. That means the frontend and backend is served through same site, it is using cookies and session created on the same domain. Packing the js/css/html in www pages will only allow you to serve frontend tied with the backend. Check frappe/hrms, frappe/helpdesk.

If you are looking to serve the frontend from separate domain/sub-domain altogether and just expose /api/* routes for frappe site’s domain so no one can visit /desk or /app on frappe site, you will need something like following with oauth2/oidc.

Optionally you can expose full desk/app view under your VPN for your admins.

Someone shared their achievement with this type of setup here, Issues with OAuth Bearer Token Validation When Using Keycloak for API Access - #3 by naikun