second phase of the project management dashboard

This commit is contained in:
Joren de Graaf
2026-10-13 20:37:56 +02:00
parent 3559b367e6
commit e4419b4a18
27 changed files with 1317 additions and 63 deletions
+26 -10
View File
@@ -1,24 +1,40 @@
# Unified Dashboard · design showcase
# Common Ground dashboard and projects
A Django template based design foundation using demo data only. Django 6.1, Vite, SCSS, Bootstrap, Bootstrap Icons, Chart.js, and vanilla JavaScript.
Django dashboard with an authenticated project manager, Kanban boards, Markdown specifications, and a separate Streamable HTTP MCP server. The original Today, Health, Energy, Home, and Showcase page templates remain in place.
## Run locally
## Local setup
```sh
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python manage.py migrate
.venv/bin/python manage.py createsuperuser
npm install
npm run dev
```
Open http://127.0.0.1:8765/. The dev command checks that Django port **8765** and Vite port **5174** are free before launching either server. Ports 8000 and 1234 are not used.
The dashboard runs at `http://127.0.0.1:8765/`. `npm run dev` uses the existing package scripts; `npm run dev:mcp` starts the MCP process at `http://127.0.0.1:8766/mcp`. If Node.js is unavailable, use `.venv/bin/uvicorn mcp_server.server:app --host 127.0.0.1 --port 8766`. Port 8766 is separate from TasksNest's MCP listener.
## Projects manager
`/projects/` contains active and archived projects. New projects seed editable To-do, In Progress, and Done columns. New cards use the board's selected default column and Medium priority. Cards store raw Markdown, a revision history, explicit blockers, comments, and activity. HTML output is sanitized. Git URLs are metadata; the server does not fetch or clone them.
Run `.venv/bin/python manage.py migrate` and create a local account with `.venv/bin/python manage.py createsuperuser`. All dashboard and project pages require sign-in. Projects can be created at `/projects/`; each gets an editable To-do, In Progress, Done board. New cards enter its selected default column with Medium priority. Cards store full Markdown and revision history. The project URL is metadata and is never fetched by the server.
## OAuth and MCP
Configuration: `DJANGO_SECRET_KEY` must be set for deployment; `DJANGO_DEBUG=0` enables secure session and CSRF cookies; `DJANGO_ALLOWED_HOSTS` is a comma-separated host list. Serve the site behind HTTPS in production.
The Django server hosts OAuth authorization, token, revocation, and discovery endpoints under `/o/` and `/.well-known/oauth-authorization-server`. The MCP process hosts `/mcp` and `/.well-known/oauth-protected-resource/mcp`. The server registers 51 tools; reads require `projects:read`, and writes require `projects:write`. OAuth authorization codes require PKCE. Tokens expire after one hour, can be revoked from Profile, and are stored hashed by django-oauth-toolkit.
The MCP server is a later integration. Reserve **8766** for its separate listener so it does not collide with TasksNest. Do not point an MCP client at the Django page server: OAuth discovery, token issuance, and MCP transport are not yet implemented here. The reference TasksNest implementation is in `/home/jorenmartijn/django/main/mcp_server` and uses Streamable HTTP with a separate OAuth-enabled Django API.
Authenticated dynamic client registration is enabled at `/o/register/`. A signed-in user can register a client; session requests also need a CSRF token. Anonymous registration is denied. You can also create a public authorization-code client in Django admin, setting its exact HTTPS redirect URI and the needed scopes. Profile shows active grants and revocation controls.
For a compiled frontend, run `npm run build`; Django then serves the compiled assets via its static file finder. The templates use Vite when its dev server is running, the build manifest when available, and checked-in preview assets otherwise. A Node.js 20.19+ installation is needed for Vite 7. This workspace had no system Node.js; the build was verified with a temporary Node.js binary.
Local accounts work by default. To enable separate OIDC sign-in to the dashboard, set `OIDC_OP_ISSUER`, `OIDC_OP_AUTHORIZATION_ENDPOINT`, `OIDC_OP_TOKEN_ENDPOINT`, `OIDC_OP_USER_ENDPOINT`, `OIDC_OP_JWKS_ENDPOINT`, `OIDC_RP_CLIENT_ID`, and `OIDC_RP_CLIENT_SECRET`. Register `/oidc/callback/` at the provider. OIDC identities are linked by verified issuer and subject; a matching email does not link an existing local account. The actual provider callback still needs an integration test with your provider configuration.
Set `MCP_PUBLIC_URL` and `OAUTH_ISSUER_URL` to the public HTTPS MCP endpoint and Django origin. Route `/mcp` and `/.well-known/oauth-protected-resource/mcp` to port 8766, and OAuth routes to the Django process. Preserve the Authorization header. The MCP process and Django must use the same database and `DJANGO_SECRET_KEY`.
## Deployment settings
Set `DJANGO_DEBUG=0`, a strong `DJANGO_SECRET_KEY`, `DJANGO_ALLOWED_HOSTS`, `MCP_PUBLIC_URL`, and `OAUTH_ISSUER_URL`. `DJANGO_CSRF_TRUSTED_ORIGINS` accepts a comma-separated origin list if needed behind a proxy. Production mode requires HTTPS URLs and enables secure cookies, SSL redirect, and HSTS. The local sign-in throttle uses Django's process-local cache; use a shared cache when running multiple workers.
Run checks and tests with:
```sh
.venv/bin/python manage.py check
.venv/bin/python manage.py test projects
```
For compiled frontend assets, run `npm run build`. Django uses Vite in development, the build manifest when present, and checked-in preview assets otherwise.