GitHub user dosubot[bot] added a comment to the discussion: Assistance 
regarding redesigning the login page of the superset

<!-- Answer -->
When you install Superset as a Python package (for example, via pip), the React 
frontend source code—including the login page—is not included. Instead, only 
the pre-built static frontend files are present, typically under 
`superset/static/assets` in your Python environment. That's why you don't see a 
`superset-frontend` directory.

To customize the login page (or any frontend component), you need to:

1. Clone the Superset source code from GitHub, which includes the 
`superset-frontend` directory.
2. Make your changes to the React code, for example in 
`superset-frontend/src/pages/Login/index.tsx`.
3. Build the frontend assets by running `npm install` and `npm run build` 
inside the `superset-frontend` directory.
4. Copy the contents of the build output (usually `superset-frontend/build/`) 
into your Python package's static assets directory (e.g., 
`superset/static/assets/`), replacing the existing files.

This process is necessary because the backend serves only the static files, not 
the source code. Directly editing files in `superset/static/assets` is not 
practical, since they're compiled and minified. Any changes you make will be 
overwritten if you upgrade or reinstall Superset, so keep that in mind. For 
more details, see [this 
discussion](https://github.com/apache/superset/discussions/35571) and the 
[Superset 
config](https://github.com/apache/superset/blob/master/superset/config.py).

If you're using Docker, you can automate this process in a custom Dockerfile by 
copying your modified frontend, rebuilding, and replacing the static assets 
inside the container.

Let me know if you want step-by-step commands or more details on any part of 
this workflow!


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/6497b356-d6a0-4063-ba8f-2b5357138ecf?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/6497b356-d6a0-4063-ba8f-2b5357138ecf?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/6497b356-d6a0-4063-ba8f-2b5357138ecf?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/6497b356-d6a0-4063-ba8f-2b5357138ecf?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/6497b356-d6a0-4063-ba8f-2b5357138ecf?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/6497b356-d6a0-4063-ba8f-2b5357138ecf?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/6497b356-d6a0-4063-ba8f-2b5357138ecf?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=When%20you%20install%20Superset%20as%20a%20Python%20package%20%28for%20example%2C%20via%20pip%29%2C%20the%20React%20frontend%20source%20code%E2%80%94including%20the%20login%20page%E2%80%94is%20not%20included.%20Instead%2C%20only%20the%20pre-built%20static%20frontend%20files%20are%20present%2C%20typically%20under%20%60superset/static/assets%60%20in%20your%20Python%20environment.%20That%27s%20why%20you%20don%27t%20see%20a%20%60superset-frontend%60%20directory.%0A%0ATo%20customize%20the%20login%20page%20%28or%20any%20frontend%20component%29%2C%20you%20need%20to%3A%0A%0A1.%20Clone%20the%20Superset%20source%20code%20from%20GitHub%2C%20which%20includes%20the%20%60superset-frontend%60%20directory.%0A2.%20Make%20your%20changes%20to%20the%20React%20code%2C%20f
 
or%20example%20in%20%60superset-frontend/src/pages/Login/index.tsx%60.%0A3.%20Build%20the%20frontend%20assets%20by%20running%20%60npm%20install%60%20and%20%60npm%20run%20build%60%20inside%20the%20%60superset-frontend%60%20directory.%0A4.%20Copy%20the%20contents%20of%20the%20build%20output%20%28usually%20%60superset-frontend/build/%60%29%20into%20your%20Python%20package%27s%20static%20assets%20directory%20%28e.g.%2C%20%60superset/static/assets/%60%29%2C%20replacing%20the%20existing%20files.%0A%0AThis%20process%20is%20necessary%20because%20the%20backend%20serves%20only%20the%20static%20files%2C%20not%20the%20source%20code.%20Directly%20editing%20files%20in%20%60superset/static/assets%60%20is%20not%20practical%2C%20since%20they%27re%20compiled%20and%20minified.%20Any%20changes%20you%20make%20will%20be%20overwritten%20if%20you%20upgrade%20or%20reinstall%20Superset%2C%20so%20keep%20that%20in%20mind.%20For%20more%20details%2C%20see%20%5Bthis%20discussion%5D%28https%3A//github.com/apache/s
 
uperset/discussions/35571%29%20and%20the%20%5BSuperset%20config%5D%28https%3A//github.com/apache/superset/blob/master/superset/config.py%29.%0A%0AIf%20you%27re%20using%20Docker%2C%20you%20can%20automate%20this%20process%20in%20a%20custom%20Dockerfile%20by%20copying%20your%20modified%20frontend%2C%20rebuilding%2C%20and%20replacing%20the%20static%20assets%20inside%20the%20container.%0A%0ALet%20me%20know%20if%20you%20want%20step-by-step%20commands%20or%20more%20details%20on%20any%20part%20of%20this%20workflow%21)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/37492)

GitHub link: 
https://github.com/apache/superset/discussions/37492#discussioncomment-15771739

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to