feat: add Jinja2 server-side rendering with template components and locust load testing

Introduce a full server-side rendering pipeline using Jinja2Templates, including base layout, navigation, modals, and rant card components. Add a classic.html static fallback page and a locustfile.py for load testing the new endpoints. Update main.py to mount static files, create template directories on startup, and add a format_time helper for relative timestamps.
This commit is contained in:
2025-08-05 01:07:46 +00:00
parent 069f7aea57
commit 7ee3cb1699
13 changed files with 3983 additions and 32 deletions
+23
View File
@@ -0,0 +1,23 @@
{% extends 'base.html' %}
{% from 'components/rant_card.html' import render_rant_card %}
{% block content %}
<div class="search-box">
<form class="search-form" action="/search" method="GET">
<input type="text" name="term" placeholder="Search rants..." value="{{ search_term or '' }}" required>
<button type="submit" class="btn">Search</button>
</form>
</div>
<div id="searchResults">
{% if search_term %}
{% if results %}
{% for rant in results %}
{{ render_rant_card(rant) }}
{% endfor %}
{% else %}
<p style="text-align: center; color: var(--text-dim);">No results found</p>
{% endif %}
{% endif %}
</div>
{% endblock %}