How gyroubounce/tomtroc works
TomTroc is a PHP/MySQL book-trading application. Visitors browse and search available books; signed-in users can list books, manage their account and profile, and message other users. The request enters through the public front controller, which starts the session, initializes the installer and dispatches routes. Controllers coordinate domain managers, persistence, image processing and rendered pages. The graph follows the sampled call paths and documented capabilities; some home, static-page and routing details are known only from the README or SOURCE INDEX.
Main entry points: VIew.php Template renderer · UserManager.php User records · Router.php Route dispatch · BookManager.php Book records
Components 25
Web entry
- HTTP front controller
public/index.php - Route dispatch
app/core/Router.php - First-run setup
app/core/Installer.php - Session state
app/core/Session.php - Home page
app/controllers/HomeController.php - Legal pages
app/controllers/StaticController.php
Accounts
- Sign-in and registration
app/controllers/AuthController.php - Account and profile
app/controllers/UserController.php - User records
app/managers/UserManager.php - User model
app/models/User.php - Account pages
app/Views/users/account.php - Authentication pages
app/Views/auth/login.php
Book exchange
- Book listing and edits
app/controllers/BookController.php - Book records
app/managers/BookManager.php - Book model
app/models/Book.php - Image processing
app/services/ImageManager.php - Book pages
app/Views/books/index.php
Messaging
- Conversation workflow
app/controllers/MessageController.php - Message records
app/managers/MessageManager.php - Message model
app/models/Message.php - Conversation pages
app/Views/messages/index.php
Persistence and rendering
- Template renderer
app/core/VIew.php - MySQL database
- Database connection
app/core/Database.php
Other components
- Visitor
Connections 46
- Visitor → HTTP front controller: requests pages
public/index.php - HTTP front controller → Session state: starts session
public/index.php - HTTP front controller → First-run setup: runs setup
public/index.php - HTTP front controller → Route dispatch: dispatches request
public/index.php - Route dispatch → Sign-in and registration: routes auth
public/index.php - Route dispatch → Account and profile: routes accounts
public/index.php - Route dispatch → Book listing and edits: routes books
public/index.php - Route dispatch → Conversation workflow: routes messages
public/index.php - Route dispatch → Home page: routes home
public/index.php - Route dispatch → Legal pages: routes legal pages
public/index.php - Sign-in and registration → User records: reads and creates users
app/controllers/AuthController.php - Sign-in and registration → Session state: sets login state
app/controllers/AuthController.php - Sign-in and registration → Template renderer: renders forms
app/controllers/AuthController.php - User records → Database connection: gets connection
app/managers/UserManager.php - User records → MySQL database: queries users
app/managers/UserManager.php - User records → User model: hydrates users
app/managers/UserManager.php - Account and profile → User records: loads and updates accounts
app/controllers/UserController.php - Account and profile → Book records: loads user books
app/controllers/UserController.php - Account and profile → Image processing: processes profile image
app/controllers/UserController.php - Account and profile → Session state: checks login
app/controllers/UserController.php - Account and profile → Template renderer: renders account
app/controllers/UserController.php - Book listing and edits → Book records: searches and changes books
app/controllers/BookController.php - Book listing and edits → User records: loads book owner
app/controllers/BookController.php - Book listing and edits → Image processing: processes book image
app/controllers/BookController.php - Book listing and edits → Session state: checks login
app/controllers/BookController.php - Book listing and edits → Template renderer: renders book pages
app/controllers/BookController.php - Book records → Database connection: gets connection
app/managers/BookManager.php - Book records → MySQL database: queries books
app/managers/BookManager.php - Book records → Book model: hydrates books
app/managers/BookManager.php - Book records → User records: loads book owner
app/managers/BookManager.php - Conversation workflow → Message records: loads and sends messages
app/controllers/MessageController.php - Conversation workflow → User records: loads conversation users
app/controllers/MessageController.php - Conversation workflow → Session state: checks login
app/controllers/MessageController.php - Conversation workflow → Template renderer: renders conversations
app/controllers/MessageController.php - Message records → Database connection: gets connection
app/managers/MessageManager.php - Message records → MySQL database: queries messages
app/managers/MessageManager.php - Home page → Book records: loads latest books
app/controllers/HomeController.php - Home page → User records: loads users
app/controllers/HomeController.php - Home page → Template renderer: renders home
- Legal pages → Template renderer: renders legal pages
- Template renderer → Account pages: renders account template
- Template renderer → Authentication pages: renders auth template
- Template renderer → Book pages: renders book template
- Template renderer → Conversation pages: renders message template
- Database connection → MySQL database: connects MySQL
app/core/Database.php - First-run setup → Database connection: uses connection
app/core/Installer.php