Home Projects Portfolio Dashboard Export PDF Log in

Optimizing Event Page Updates in Troncal Urbano

The Challenge

Maintaining a dynamic event page in the mcarvallorestify/troncalurbano project requires a fine balance between visual presentation and efficient data management. Recently, we focused on refining the event page templates to ensure they remain both lightweight and responsive, leveraging modern web standards.

The Approach

Our strategy involved a clean separation of concerns, ensuring that the frontend components (HTML/CSS) are decoupled from the backend logic (Python) while maintaining high availability for event data.

Refining UI Components

We updated our CSS structures to improve maintainability and performance. By moving away from bloated selectors, we reduced layout shift during page loads:

.event-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--surface-primary);
}

This CSS snippet ensures a consistent look and feel across different viewports, allowing the event card to adapt gracefully without intrusive media queries.

Dynamic Content Delivery

For the backend, we utilized structured data patterns to handle incoming requests. When integrating with external data sources—or using Supabase for persistence—we ensure that the Python layer processes data asynchronously:

# Fetching event data securely
def get_event_details(event_id):
    response = supabase.table("events").select("*").eq("id", event_id).single().execute()
    return response.data

This approach avoids blocking the main thread and keeps the user experience smooth, even during high traffic to the event page.

Key Insight

Focusing on clean CSS and efficient data fetching allows us to scale the project without technical debt. By keeping the UI logic simple and the API interactions predictable, we ensure that adding new events remains a fast, seamless process.

Actionable Takeaway

Next time you update your event pages, audit your CSS for specificity issues and ensure your backend calls are asynchronous to prevent UI blocking. Start by auditing your most visited page's load time using Lighthouse.


Generated with Gitvlg.com

Optimizing Event Page Updates in Troncal Urbano
Marco Carvallo

Marco Carvallo

Author

Share: