Remove Jinja2 frontend (dead code after SvelteKit migration) #150

Closed
opened 2026-03-14 12:58:54 +00:00 by forgejo_admin · 0 comments
Contributor

Lineage

plan-pal-e-docs → Phase 4 → Phase 4b (Jinja2 removal)

Repo

forgejo_admin/pal-e-docs

User Story

As a platform maintainer
I want the dead Jinja2 frontend removed from the backend
So that the codebase is clean and there's no confusion about which frontend serves notes

Context

SvelteKit (pal-e-app) now renders all note types from the blocks API (PR #9 on pal-e-app, merged). The Jinja2 frontend at /browse/* is dead code — ~320 lines of Python routing + ~460 lines of HTML/CSS templates + dependencies.

File Targets

Files to delete:

  • src/pal_e_docs/routes/frontend.py — all /browse/* routes
  • src/pal_e_docs/templates/ — entire directory (base.html, note.html, landing.html, projects.html, project_notes.html, tags.html, tag_notes.html, repos.html, login.html)

Files to modify:

  • src/pal_e_docs/app.py (or wherever routers are included) — remove frontend.router include
  • pyproject.toml or requirements.txt — remove Jinja2, itsdangerous if no longer needed

Files to investigate before removing:

  • src/pal_e_docs/autolink.py — check if used by anything besides frontend.py
  • src/pal_e_docs/sanitize.py — check if used by anything besides frontend.py
  • src/pal_e_docs/wrap_tables.py — check if used by anything besides frontend.py
  • Session auth middleware — check if API routes use it or only frontend

Files NOT to touch:

  • src/pal_e_docs/routes/notes.py — API routes, still needed
  • src/pal_e_docs/routes/blocks.py — block API, still needed
  • src/pal_e_docs/blocks/ — parser, compiler, sync — still needed
  • src/pal_e_docs/models.py — no changes

Acceptance Criteria

  • /browse/* routes no longer exist
  • templates/ directory deleted
  • No broken imports (app starts cleanly)
  • All existing tests pass
  • API routes (/notes/*, /blocks/*, /boards/*, etc.) unaffected
  • Dependencies cleaned (Jinja2 removed if not used elsewhere)

Test Expectations

  • All existing tests pass: pytest tests/ -v
  • App starts without errors
  • Run command: pytest tests/ -v

Constraints

  • Do NOT remove autolink.py, sanitize.py, wrap_tables.py if they are used by non-frontend code (e.g. from_template endpoint uses sanitize). Check imports first.
  • Do NOT touch the API routes or block system
  • Do NOT remove html_content column — it's still used for search and revisions

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • pal-e-docs — project
### Lineage `plan-pal-e-docs` → Phase 4 → Phase 4b (Jinja2 removal) ### Repo `forgejo_admin/pal-e-docs` ### User Story As a platform maintainer I want the dead Jinja2 frontend removed from the backend So that the codebase is clean and there's no confusion about which frontend serves notes ### Context SvelteKit (pal-e-app) now renders all note types from the blocks API (PR #9 on pal-e-app, merged). The Jinja2 frontend at `/browse/*` is dead code — ~320 lines of Python routing + ~460 lines of HTML/CSS templates + dependencies. ### File Targets Files to delete: - `src/pal_e_docs/routes/frontend.py` — all `/browse/*` routes - `src/pal_e_docs/templates/` — entire directory (base.html, note.html, landing.html, projects.html, project_notes.html, tags.html, tag_notes.html, repos.html, login.html) Files to modify: - `src/pal_e_docs/app.py` (or wherever routers are included) — remove `frontend.router` include - `pyproject.toml` or `requirements.txt` — remove `Jinja2`, `itsdangerous` if no longer needed Files to investigate before removing: - `src/pal_e_docs/autolink.py` — check if used by anything besides frontend.py - `src/pal_e_docs/sanitize.py` — check if used by anything besides frontend.py - `src/pal_e_docs/wrap_tables.py` — check if used by anything besides frontend.py - Session auth middleware — check if API routes use it or only frontend Files NOT to touch: - `src/pal_e_docs/routes/notes.py` — API routes, still needed - `src/pal_e_docs/routes/blocks.py` — block API, still needed - `src/pal_e_docs/blocks/` — parser, compiler, sync — still needed - `src/pal_e_docs/models.py` — no changes ### Acceptance Criteria - [ ] `/browse/*` routes no longer exist - [ ] `templates/` directory deleted - [ ] No broken imports (app starts cleanly) - [ ] All existing tests pass - [ ] API routes (`/notes/*`, `/blocks/*`, `/boards/*`, etc.) unaffected - [ ] Dependencies cleaned (Jinja2 removed if not used elsewhere) ### Test Expectations - [ ] All existing tests pass: `pytest tests/ -v` - [ ] App starts without errors - Run command: `pytest tests/ -v` ### Constraints - Do NOT remove `autolink.py`, `sanitize.py`, `wrap_tables.py` if they are used by non-frontend code (e.g. `from_template` endpoint uses sanitize). Check imports first. - Do NOT touch the API routes or block system - Do NOT remove `html_content` column — it's still used for search and revisions ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `pal-e-docs` — project
forgejo_admin 2026-03-14 13:21:23 +00:00
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/pal-e-api#150
No description provided.