REST API built with Slim 4, Eloquent ORM, Redis and JWT authentication.
| Layer | Technology |
|---|---|
| Framework | Slim 4 |
| ORM | Illuminate Eloquent 11 |
| Cache | Illuminate Cache + Redis |
| Auth | Custom JWT (HS256) |
| Container | Illuminate Container |
| CLI | Symfony Console |
| Web server | Nginx + PHP 8.4-FPM |
| Database | MySQL 8 |
make initThis will:
- Copy
.env.example→.env - Build Docker images
- Start all containers
- Wait for MySQL to be ready
- Run migrations
| Service | URL |
|---|---|
| API | http://localhost:8080 |
| Swagger UI | http://localhost:8082 |
make up # start containers
make down # stop containers
make logs # stream logs
make migrate # run pending migrations
make rollback # rollback last batch
make migration name=create_tags_table # create new migration
make shell # bash into app container
make shell-mysql # MySQL CLI
make shell-redis # Redis CLIPOST /api/v1/auth/register
POST /api/v1/auth/login
POST /api/v1/auth/refresh
POST /api/v1/auth/logout [auth]
GET /api/v1/posts
GET /api/v1/posts/my [auth]
GET /api/v1/posts/{id}
POST /api/v1/posts [auth]
PUT /api/v1/posts/{id} [auth]
DELETE /api/v1/posts/{id} [auth]
GET /api/v1/posts/{id}/comments
GET /api/v1/comments/my [auth]
POST /api/v1/posts/{id}/comments [auth]
PUT /api/v1/comments/{id} [auth]
DELETE /api/v1/comments/{id} [auth]
Full spec available in openapi.yaml and at Swagger UI.
src/
├── Contracts/ # Interfaces (IMigrationTool)
├── Dto/ # Data Transfer Objects
├── Handlers/
│ ├── API/ # HTTP handlers (Auth, Post, Comment)
│ ├── Console/ # CLI commands (migrate, rollback, make:migration)
│ ├── Middleware/ # AuthMiddleware
│ └── Response/ # ApiResponse
├── Migrations/ # Database migrations
├── Models/ # Eloquent models (User, Post, Comment)
├── Repository/ # Data access layer
└── Services/ # Business logic (Auth, JWT, User, Post, Comment, Credential)
config/ # database, cache, container
routes/ # api.php, console.php
docker/ # Dockerfile, nginx config