A Laravel 13 API with a Vue 3 single-page app: Sanctum token auth, direct and group conversations, file attachments, unread tracking and typing indicators over self-hosted WebSockets. No paid services required.
Most tutorials reach for a paid push service. This project does it with free, self-hosted parts.
Direct and group conversations, attachments, unread counts and typing indicators, not just a message box.
Only members of a conversation can read it, write to it, or listen to its channel.
A Pusher-compatible WebSocket server runs inside the app's own stack, so there are no per-message fees.
A REST API for actions and a WebSocket channel for live updates.
What the code implements.
Email and password sign-in with Sanctum tokens, plus profile status and avatar upload.
Direct and group conversations with member roles.
New messages are broadcast to other members as they are sent.
Files up to 5 MB, validated and stored locally with a public link.
Each member has a last-read timestamp per conversation.
A typing event is sent to other members of the conversation.
First-party and free components throughout.
| Layer | Technology | Why |
|---|---|---|
| Backend | Laravel 13 | Mature routing, validation, Eloquent models and broadcasting. |
| Auth | Laravel Sanctum | Simple personal access tokens for a SPA and API. |
| Realtime | beyondcode/laravel-websockets | A self-hosted, Pusher-compatible server, so no external service is needed. |
| Frontend | Vue 3 + Pinia + Vite | A small SPA with centralized auth and chat state. |
| Database | SQLite, or MySQL / PostgreSQL | SQLite for a one-command start; a production database through the .env file. |
| Tooling | Docker Compose, GitHub Actions | Optional MySQL, Redis and Mailhog, and workflow files for tests. |
The design choices that shape how the app behaves.
Using a Pusher-compatible server inside the stack removes per-message cost and keeps everything runnable locally.
conversation_user stores each member's role and last_read_at, so membership, permissions and unread counts come from one place.
Each controller action first verifies the user belongs to the conversation, and returns 403 if not.
Creating a message and updating the sender's last_read_at happen in one database transaction.
Events are sent with toOthers(), so the sender's own client does not receive a duplicate of its message.
The design problems in a real-time app.
Channels need their own authorisation, separate from HTTP routes. Channel callbacks check that the user is a participant of the conversation before they can listen.
✓ Participation checks per channelUnread counts depend on who has seen what. A last_read_at per member and a mark-as-read endpoint keep it simple and cheap.
✓ Per-member read timestampUploads are validated by size, stored under a controlled path and returned with a computed URL.
✓ Validation and controlled storageTyping is sent through a lightweight endpoint to a presence channel, kept separate from message storage.
✓ Separate event, no persistenceWhat the repository shows.
Where the project still needs work.
The test suite is still the framework's default example tests. Feature tests for auth, membership and messages are the first priority.
Message search, reactions, editing and deleting messages, and moderation tools.
Web push notifications, stricter throttling, and a CI pipeline that runs the new tests.
I'm open to full-time roles and project work in AI engineering, full-stack development, and backend systems.