DEV Community

Cover image for RodFlix Deep Dive: The PHP App That Taught Me Patience
Rodrigo De Lascio
Rodrigo De Lascio

Posted on • Originally published at rodrigodelascio.co.uk

RodFlix Deep Dive: The PHP App That Taught Me Patience

This week’s blog is a technical deep dive into my Web Application Development assignment, where I built RodFlix, a TV series catalogue web app in PHP, backed by MySQL, with an admin panel and an import flow using the TVmaze API.

It is basically IMDb’s smaller cousin, the one who does not go to the gym but has great database design and tries really hard.

What RodFlix Does

RodFlix is a database-driven TV series catalogue where users can browse series, explore seasons and episodes, and view people involved in each show. Pagination and filtering help manage larger datasets.

There is also a protected admin area that supports full CRUD over series and allows importing data directly from the TVmaze API.

Architecture and Structure

The app uses a lightweight, layered structure with server-rendered PHP, MySQL for data storage, and clean separation between public pages, admin pages, and API endpoints.

Key directories include:

  • /includes for configuration, authentication, database connection, and helpers
  • /admin for dashboard and CRUD interfaces
  • /api for JSON endpoints used by the admin UI
  • /assets for CSS, JavaScript, and images

No frameworks, no magic, just disciplined PHP.

Database Design

RodFlix uses a relational schema with tables for series, seasons, episodes, genres, people, and junction tables to model many-to-many relationships. Foreign keys and cascading deletes help maintain data integrity.

This approach avoids duplication and keeps queries readable and scalable.

Data Access and Security

Database access is handled via PDO with prepared statements. This protects against SQL injection and keeps queries consistent across the application.

A shared database helper returns a single PDO instance, avoiding unnecessary reconnections.

Authentication and Sessions

The admin area is protected using session-based authentication. Session IDs are regenerated on login, admin routes are protected server-side, and navigation adapts based on authentication state.

Simple, predictable, and secure.

The TVmaze Import Flow

One of the strongest features is the ability to search for series via the TVmaze API, preview results, and import them into the local database.

This is handled through dedicated API endpoints and JavaScript fetch calls, keeping the UI responsive while maintaining server-side control.

Helpers and Reusability

Helper functions centralise common tasks like escaping output, redirects, query parameter validation, and formatting.

These small utilities reduce repetition and improve long-term maintainability.

What This Project Taught Me

This project went beyond learning PHP. It reinforced real-world skills like:

  • Designing relational databases
  • Writing safe SQL queries
  • Structuring maintainable projects
  • Managing authentication and access control
  • Integrating external APIs responsibly

It also taught me that server-side debugging is a special kind of endurance sport.

Final Thoughts

RodFlix started as an assignment but became a solid foundation project. It is not flashy, but it is structured, secure, and realistic.

And honestly, that feels like a good metaphor for my journey into software development.

Top comments (0)