How jupyter-server/jupyter_server works
Project type and purpose
• Jupyter Server is a backend framework that provides core services, REST endpoints, and WebSocket support for Jupyter web applications (Notebook, Lab, Voilà).
• It is not a full‐stack UI application itself but a modular server “engine” that client UIs talk to over HTTP/WebSocket.
File structure
• Top-level module “jupyter_server/”: the monolithic server package.
• subpackages for authentication (auth), base handlers (base), extension hooks (extension), file services (files), gateway support (gateway), internationalization (i18n), kernelspec management (kernelspecs), nbconvert endpoints (nbconvert), Prometheus metrics (prometheus), general services (services/*), static assets (static), templates (templates), terminal support (terminal), view endpoints (view).
• “jupyter_server/serverapp.py” and “__main__.py” define the application entrypoint.
• “services/…” subdirectory implements a service-layer API for contents, kernels, sessions, events, config, nbconvert, security, etc.
• “handlers.py” files define HTTP request handlers, tied to Tornado routing.
• “tests/” covers unit and integration tests for each component.
• “examples/” show extension usage and configuration.
• Configuration files (pyproject.toml, package.json) and CI/workflows indicate Python package + npm static builds, ReadTheDocs docs.
README for additional insights
• Confirms purpose as a backend server for Jupyter frontends.
• Mentions REST endpoints, core services, versioning, installation and launch via “jupyter server”.
• No database: uses local filesystem for contents, in-memory for session and kernel state.
Elements
• Clear labels (e.g., “Tornado HTTP Server”, “ContentsService”, “KernelService”, “Auth Decorator”).
• Transport Layer (blue)
• Handler Layer (green)
• Service Layer (orange)
• Resource Managers (yellow)
• Extensions & Plugins (purple)
• External systems (gray)
Be detailed but focused
• Do not attempt to show every Python module file.
• Logical component (Auth, Contents, Kernels, Sessions, Nbconvert, Gateway, Extensions, Metrics).
• How they plug together in the running server process.