|
| 1 | +# Quill - Role-Based Blogging Platform |
| 2 | + |
| 3 | +## Overview |
| 4 | +Quill is a PHP + MySQL blogging platform with role-based workflows for **viewer**, **author**, and **admin** users. It demonstrates end-to-end web engineering fundamentals: authentication, content lifecycle management, media handling, and dashboard-oriented operations. |
| 5 | + |
| 6 | +## Problem Statement |
| 7 | +Most beginner blog projects only cover basic CRUD and miss role separation, moderation workflows, and operational readiness. Quill addresses this by implementing a multi-role publishing workflow with clean separation between public browsing and protected author/admin operations. |
| 8 | + |
| 9 | +## Solution Overview |
| 10 | +Quill uses server-rendered PHP views backed by MySQL (PDO). Authentication and authorization gates users into role-specific modules. Authors create and manage posts, admins oversee users/content, and viewers consume published content. |
| 11 | + |
| 12 | +## Features |
| 13 | +- Role-based access control (`viewer`, `author`, `admin`) |
| 14 | +- Authentication and session-based authorization |
| 15 | +- Author workflows: create, edit, publish/draft posts |
| 16 | +- Admin workflows: dashboard and user/content oversight |
| 17 | +- Tagging and featured image support |
| 18 | +- Public viewer pages for published articles |
| 19 | + |
| 20 | +## Architecture |
| 21 | +Application modules are organized by role and shared includes: |
| 22 | +- `index.php`: entry and route switching |
| 23 | +- `src/auth`: login/auth handling |
| 24 | +- `src/author`: author dashboards and post operations |
| 25 | +- `src/admin`: admin management dashboards |
| 26 | +- `src/viewer`: public content pages |
| 27 | +- `includes/config.php`: environment and DB bootstrap |
| 28 | +- `includes/functions.php`: shared utilities/data access helpers |
| 29 | + |
| 30 | +## Tech Stack |
| 31 | +- PHP 8+ |
| 32 | +- MySQL 8+ (PDO) |
| 33 | +- HTML/CSS/Bootstrap-style UI |
| 34 | +- Apache/XAMPP local runtime |
| 35 | + |
| 36 | +## Architecture Diagram |
| 37 | +```mermaid |
| 38 | +flowchart LR |
| 39 | + V[Viewer Browser] --> A[Apache + PHP App] |
| 40 | + AU[Author/Admin Browser] --> A |
| 41 | + A --> AUTH[Auth + Session Layer] |
| 42 | + A --> MOD[Role Modules in src/] |
| 43 | + MOD --> DAL[Data Access Helpers] |
| 44 | + DAL --> DB[(MySQL)] |
| 45 | + MOD --> FS[(uploads/ + assets/)] |
| 46 | +``` |
| 47 | + |
| 48 | +## Setup Instructions |
| 49 | +1. Clone repository into XAMPP htdocs. |
| 50 | +2. Copy `.env.example` to `.env` and set DB values. |
| 51 | +3. Create database and import `docs/schema.sql`. |
| 52 | +4. Start Apache and MySQL from XAMPP. |
| 53 | +5. Open `http://localhost/quill`. |
| 54 | + |
| 55 | +## Usage |
| 56 | +- Sign in via auth flow. |
| 57 | +- Create/edit posts from author dashboard. |
| 58 | +- Manage users/content from admin dashboard. |
| 59 | +- Review published posts from viewer pages. |
| 60 | + |
| 61 | +## API / Data Layer Notes |
| 62 | +Quill is server-rendered and does not expose a standalone REST API. Data operations are centralized in PHP utility functions under `includes/functions.php`. |
| 63 | + |
| 64 | +## Screenshots |
| 65 | +- `docs/screenshots/home.png` (placeholder) |
| 66 | +- `docs/screenshots/author-dashboard.png` (placeholder) |
| 67 | +- `docs/screenshots/admin-dashboard.png` (placeholder) |
| 68 | + |
| 69 | +## Deployment |
| 70 | +See `docs/DEPLOYMENT.md` for local and production deployment steps. |
| 71 | + |
| 72 | +## Future Improvements |
| 73 | +- CSRF middleware across all state-changing routes |
| 74 | +- Form request validation abstraction |
| 75 | +- Unit/integration tests for auth and publishing workflows |
| 76 | +- Structured logging and audit trails |
| 77 | +- Optional REST API for headless clients |
| 78 | + |
| 79 | +## Contributing |
| 80 | +See `CONTRIBUTING.md` for development workflow and quality expectations. |
| 81 | + |
| 82 | +## License |
| 83 | +MIT |
0 commit comments