How Can I write code for Webpage in CustomApp

How can I customize a webpage in ERPNext for My custom App without using the front end. i.e, all through the Backend(coding).

There are two options that might satisfy: a Portal or a Page.
https://frappeframework.com/docs/v13/user/en/portal-pages
https://frappeframework.com/docs/v13/user/en/api/page
The /login and /me URLs are portals; Stock Balance and Warehouse Capacity Summary are examples of page implementations. You can view the list of pages inside the app.

Isn’t this docs for page inside desk?
I don’t know which one @priytesh_shah needs, but…

From my understanding, cmiiw, the webpages are: Portal page and Website (www) page.
The portal can be made inside the doctype directory.
The website pages are in www directory.

@rahy You can use the page or doctype with a completely custom interface but it gets implemented on a per-page / per-doctype basis. Portals are probably the more idiomatic way to do it. I’ve implemented all three at different times and use cases; each has trade offs that led me to use a particular solution in a particular use case.

So, theoretically, we can fully customize the look of desk pages (doctype forms) by using the Page API?

There are a lot of ways to customize the interface, so the “right” way is an “it depends” answer.
Mostly simply, provide overriding styles by including them in hooks.py
If you need some sort of special input, try overriding that input.
If you want to build a completely custom interface you can do so with either the Page API or the portal API (and require login).

To me, this kind of effort should be reserved for special cases. The best example is the POS. A responsive, touch-friendly, speed-optimized interface so that the user can accomplish the same set of actions quickly - it’s not a general purpose data-over-forms interface. What should you build a completely custom interface for? I don’t know, but I’d be happy to hear about it and suggest lower-friction alternatives, if appropriate.

If the focus is on the “can” part of the question, it’s open source software, there’s is no technical limit, just an evaluation if the effort required is justified.