How johandhana/blog-ci4 works
This is a CodeIgniter 4 blog app: visitors browse, search, and filter posts; authenticated users manage posts and categories, while users can log in or register. Routes dispatch requests to controllers, which assemble views and use models for content data. The sampled post controller confirms post queries, category associations, and image uploads. User, category, and role details beyond the routes and README are not shown in the sampled source, so their internal wiring is left unspecified.
Main entry points: PostController.php Post controller · Routes.php Route definitions · Categories.php Category controller · Users.php Users controller
Components 19
Request and access
- Route definitions
app/Config/Routes.php - Auth filter
app/Filters/Auth.php
Blog content
- Post controller
app/Controllers/PostController.php - Post model
app/Models/Post.php - Comment model
app/Models/Comment.php - Application database
app/Config/Database.php - Post image uploads
app/Controllers/PostController.php
Users and categories
- Category model
app/Models/Category.php - Category controller
app/Controllers/Categories.php - Users controller
app/Controllers/Users.php - User model
app/Models/User.php
Rendered interface
- Home page
app/Views/pages/home.php - Post pages
app/Views/posts - Post admin forms
app/Views/admin - Category pages
app/Views/categories.php - Category admin
app/Views/admin/categories - Login and registration
app/Views/users - Page templates
app/Views/templates
Other components
- Visitor
Connections 22
- Visitor → Route definitions: requests pages
- Route definitions → Auth filter: filters admin routes
- Route definitions → Post controller: dispatches post routes
- Route definitions → Category controller: dispatches category routes
- Route definitions → Users controller: dispatches account routes
- Auth filter → Users controller: redirects to login
- Post controller → Post model: queries and writes
- Post controller → Category model: loads categories
- Post controller → Application database: writes category links
- Post controller → Post image uploads: moves image files
- Post model → Application database: persists posts
- Category controller → Category model: manages categories
- Users controller → User model: manages accounts
- Post controller → Home page: renders home
- Post controller → Post pages: renders post pages
- Post controller → Post admin forms: renders admin forms
- Category controller → Category pages: renders category pages
- Category controller → Category admin: renders admin forms
- Users controller → Login and registration: renders account pages
- Post controller → Page templates: renders page chrome
- Category controller → Page templates: renders page chrome
- Users controller → Page templates: renders page chrome