Using OOP PHP with MVC architecture to build a simple web page without using frameworks like Doctrine

fellow developers!

I recently started getting into PHP and was trying to build a simple web page using OOP and MVC architecture. There are plenty of tutorials on OOP and MVC out there, but they usually give the same simplified example of a Login System, which is not quite the thing I was looking for. So, I was starting to wonder, maybe I am looking for something, which is not right and should try a different approach.

In my example I will have 3 tables (Users, Books and Lending)

  1. users (user_id, user_name, user_address)
  2. books (book_id, book_name, date_of_release)
  3. lending (lending_id, book_id, user_id, lending_date, return_date)

For each of those entities I’m planning to create separate View, Model and Control classes.

My project structure currently look something like this:

-classes
   -dbh.class.php
-controllers
   -user.controller.class.php
   -book.controller.class.php
   -lending.controller.class.php
-includes
   -autoloading.inc.php
-models
   -user.model.class.php
   -book.model.class.php
   -lending.model.class.php
-views
   -user.view.class.php
   -book.view.class.php
   -lending.view.class.php
-index.php

My models will contain User, Book and Lending classes with setters, getters etc.

The home page will have a button, which will load an information about lendings from JSON file and upload it to the database. Also, I will have a form for fetching the lendings from Database and showing the results using filters.

So, my two questions are:

  1. Which file (or should I say Class) will be responsible for the main logic of the website? Should I build an extra Class (exp. Repository.class) with Model, View and Controller or is there a better way?

  2. When loading the information from JSON file, what is the best approach in doing so using the Entities classes? Right now I am thinking of writing methods inside Lending class which will create User and Book classes and then use their build in methods to update their tables, but for some reason, that approach seems to me too complicated.

I am aware of frameworks like Doctrine, which will handle the Database logic for me, but I was wondering, if there is a more plain PHP way to do this.

Thank you all in advance!