Backend API for DevHub, a developer community platform built with Laravel.
- Framework: Laravel 12 (PHP)
- API prefix:
/api/v1 - Auth: JWT (
auth:apimiddleware) - API routes:
routes/api.php - Web routes:
routes/web.php
- Local API:
http://127.0.0.1:8000/api/v1 - Production API:
https://dev-hubs.tech/api/v1
Before running the project, make sure you have:
- PHP
8.3+ - Composer
2+ - Node.js
18+and npm - MySQL (default in
.env.example) or another configured DB connection
From the project root, run:
composer setupThis script installs PHP/JS dependencies, creates .env if missing, generates APP_KEY, runs migrations, and builds frontend assets.
Open .env and replace placeholder values with real credentials.
At minimum, verify these values:
- App settings:
APP_NAME,APP_URL - Database:
DB_CONNECTION,DB_HOST,DB_PORT,DB_DATABASE,DB_USERNAME,DB_PASSWORD - JWT:
JWT_SECRET(generate withphp artisan jwt:secretif needed)
Optional services (mail, Redis, Cloudinary, Pusher, OneSignal, Algolia, AI providers) can stay unset until you use those features.
Recommended (starts API server, queue worker, logs, and Vite together):
composer devIf you only need the API server:
php artisan serveHealth endpoint:
GET /api/v1/
Example request:
curl http://127.0.0.1:8000/api/v1/Expected response includes fields like message, status, and api_docs.
# Run test suite
composer test# Run migrations
php artisan migrate
# Clear and rebuild config/cache
php artisan optimize:clear- API documentation URL in the health response:
https://devhub.apidog.io/ - Most endpoints require JWT authentication.