# What component serves Jupyterlab / notebook to an authentificated user and where is that code?

**URL:** https://discourse.jupyter.org/t/what-component-serves-jupyterlab-notebook-to-an-authentificated-user-and-where-is-that-code/20974
**Category:** JupyterHub
**Tags:** jupyterhub
**Created:** [August 20, 2023, 1:37pm UTC](https://discourse.jupyter.org/t/what-component-serves-jupyterlab-notebook-to-an-authentificated-user-and-where-is-that-code/20974 "2023-08-20T13:37:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Gordon\_Freeman101](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/gordon_freeman101/32/10757_2.png) [@Gordon\_Freeman101](https://discourse.jupyter.org/u/Gordon_Freeman101)
#### Post date: [August 20, 2023, 1:37pm UTC](https://discourse.jupyter.org/t/what-component-serves-jupyterlab-notebook-to-an-authentificated-user-and-where-is-that-code/20974/1 "2023-08-20T13:37:13Z")

</div>

Hello,

I’m trying to understand the general architecture of JupyterHub and how it’s various components  
interact. I’m having trouble understanding the exact responsibilities of JupyterHub single-user server.  
The documentation [singleuser.md](https://github.com/jupyterhub/jupyterhub/blob/862455ee5684e4d013646f19b6f492fada9dc9e6/docs/source/explanation/singleuser.md) states that :  
" `jupyterhub-singleuser` , launches `jupyter-server` , the same program used when you run `jupyter lab` on your laptop"  
Except that when running just `jupyter-server` on my laptop and going to the url provided in the console, there is no front-end, just a simple page that says a server is indeed running. We still need a jupyterlab / jupyter notebook front end, that JupyterHub does provide once a user connects. So necessarily, jupyterhub-singleuser must at some point run an instance of jupyterlab / jupyter notebook. I’m just having trouble understanding where this happens, in the [source code of the hub](https://github.com/jupyterhub/jupyterhub/blob/862455ee5684e4d013646f19b6f492fada9dc9e6/jupyterhub/singleuser/app.py#L96) it’s unclear exactly what’s really happening.

My question then is just : who is in charge of serving the frontend to an authentificated user  
and where is that code ?

Many Thanks,

Gordon

---

<div class="post-metadata">

### Author: ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)
#### Post date: [August 22, 2023, 7:54pm UTC](https://discourse.jupyter.org/t/what-component-serves-jupyterlab-notebook-to-an-authentificated-user-and-where-is-that-code/20974/2 "2023-08-22T19:54:01Z")

</div>

Currently the default is to launch JupyterLab (which sits on top of Jupyter Server)

> <https://github.com/jupyterhub/jupyterhub/blob/862455ee5684e4d013646f19b6f492fada9dc9e6/jupyterhub/singleuser/app.py#L74-L79>

but it’s best to be explicit by setting the `JUPYTERHUB_SINGLEUSER_APP` environment variable.

JupyterHub is intentionally decoupled from the singleuser server, so for example you can implement your own from scratch, an example is

> **[GitHub - ideonate/jhsingle-native-proxy: Wrap an arbitrary webapp so it can...](https://github.com/ideonate/jhsingle-native-proxy)**
>
> Wrap an arbitrary webapp so it can be used in place of jupyter-singleuser in a JupyterHub setting - GitHub - ideonate/jhsingle-native-proxy: Wrap an arbitrary webapp so it can be used in place of j...

---

<div class="post-metadata">

### Author: ![Gordon\_Freeman101](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/gordon_freeman101/32/10757_2.png) [@Gordon\_Freeman101](https://discourse.jupyter.org/u/Gordon_Freeman101)
#### Post date: [August 23, 2023, 12:08pm UTC](https://discourse.jupyter.org/t/what-component-serves-jupyterlab-notebook-to-an-authentificated-user-and-where-is-that-code/20974/3 "2023-08-23T12:08:43Z")

</div>

Thank you for your reply, it’s clearer now !
