NewsRoom API
A headless CMS REST API for a company newsroom, built with Laravel 12: writers publish articles, readers comment, and admins review content. Web clients use v1, mobile clients use v2.
Try it in three steps
- Open the interactive docs and send
POST /api/login; it is pre-filled with the writer account. - Copy the
access_tokenfrom the response. - Open any protected endpoint, paste the token as the Bearer token, and press Send API Request.
Demo accounts
| Role | Password | |
|---|---|---|
| Writer | writer@technova.com | password |
| Reader | reader@technova.com | password |
| Admin | admin@technova.com | password |
Public endpoints (no token needed)
GET /api/v1/articles | Published articles for web clients (paginated) |
GET /api/v2/articles | The same articles with reading time, tags and comment counts |
GET /api/v2/articles/1 | One article with its comments |
GET /api/v1/dashboard | Newsroom statistics and top tags (cached) |
What's inside
Versioned APIv1 and v2 share one codebase; v2 adds fields for mobile without breaking web clients.
Contextual bindingAdmin and writer controllers get different notification senders from the container.
No cache stampedeAn atomic lock lets one request rebuild the dashboard cache while the others wait.
Rate limiting60 requests per minute per user or IP address.
Events and jobsPublishing an article notifies employees through queued jobs; scheduled jobs archive old articles and build reports.
TestedPest feature tests run on every push with GitHub Actions.
Free hosting: the server sleeps when idle, so the first request can take up to a minute. The demo database is reset on every restart.