Skip to content

Bildschatz: Add public image database website - #919

Draft
sascha11110 wants to merge 1 commit into
mainfrom
bildschatz
Draft

Bildschatz: Add public image database website#919
sascha11110 wants to merge 1 commit into
mainfrom
bildschatz

Conversation

@sascha11110

Copy link
Copy Markdown
Contributor

Add a public single-page website that lets anyone search for a word and browse all publicly available images assigned to the matching words.

Enhance the public /api/v2/words/ endpoint with an optional 'search' query parameter that filters words by substring and, when searching, returns all public images of a word (default image plus the images defined on its released unit relations). Search terms have to be at least 3 characters long, otherwise the request is rejected with HTTP
400. Fully backward compatible when no 'search' parameter is given.

Add a lightweight 'bildschatz' Django app serving a responsive single-page frontend that consumes the public API. The search term is read from the 'q' query parameter so result pages are shareable, and the 3-character minimum is enforced inline in the search field.

Add a public single-page website that lets anyone search for a word and
browse all publicly available images assigned to the matching words.

Enhance the public /api/v2/words/ endpoint with an optional 'search'
query parameter that filters words by substring and, when searching,
returns all public images of a word (default image plus the images
defined on its released unit relations). Search terms have to be at
least 3 characters long, otherwise the request is rejected with HTTP
400. Fully backward compatible when no 'search' parameter is given.

Add a lightweight 'bildschatz' Django app serving a responsive
single-page frontend that consumes the public API. The search term is
read from the 'q' query parameter so result pages are shareable, and
the 3-character minimum is enforced inline in the search field.
@deliverino

deliverino Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

LLM Review (verdigado-think)

1. Django correctness

  • No model fields were changed or added; the new bildschatz app contains no models, so migrations are not required.
  • No paths for creating Job, Unit, or Word objects were introduced.

2. Internationalization

  • New strings in lunes_cms/api/v2/views/word_viewset.py and lunes_cms/bildschatz/apps.py are correctly reflected in lunes_cms/locale/de/LC_MESSAGES/django.po.

3. Type safety

  • New functions and methods in lunes_cms/bildschatz/views/index.py and the new test suite are fully type-annotated.

4. Code quality gates

  • Formatting follows project standards (Black).
  • The # pylint: disable=unused-argument in tests/api/v2/test_word_search.py is justified as it refers to a fixture used for its side effects (database loading), following existing test patterns.

5. Security

  • Input validation for the search term length (MIN_SEARCH_LENGTH = 3) is correctly implemented both on the backend in WordViewSet.get_queryset and the frontend in bildschatz.html, preventing potentially expensive over-broad queries.

6. Testing

  • The new API behavior is thoroughly covered by the new test file tests/api/v2/test_word_search.py.

8. Commit message style

  • Incorrect casing: The commit message Bildschatz: Add public image database website violates the repository convention. The summary after the colon must be lowercase (e.g., Bildschatz: add public image database website).

@sascha11110
sascha11110 requested review from JoeyStk, LeandraH, david-venhoff and f1sh1918 and removed request for JoeyStk, LeandraH, david-venhoff and f1sh1918 July 22, 2026 14:01
@f1sh1918

Copy link
Copy Markdown
Contributor

Looks and works already really good @sascha11110
What i recognized is

  1. I think there should be a x button to delete search query as its standard IMO
  2. Not sure what image export quality we want but the current resolution is super low, is that intended. Not sure actually what resolutions we currently have

@f1sh1918

Copy link
Copy Markdown
Contributor

please also test how to test section @sascha11110

@LeandraH LeandraH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very cool! One thing, I tested with a word that also has an image for the unit word relation, and those images didn't show up. I guess we should show those words as well.

<meta name="description" content="Bildschatz ist die offene Bilddatenbank für Wörter. Gib ein Wort ein und finde passende, frei nutzbare Bilder.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap" rel="stylesheet">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not send Google our data 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants