Laragram is a modern, open-source Telegram web client built on the Laravel framework. It's powered by MadelineProto, an asynchronous PHP client for the Telegram MTProto protocol. Our goal is to create a fast, beautiful, and feature-rich web client for Telegram.
The project has recently completed a major overhaul (Phase 1), migrating from a legacy stack to a modern, secure, and high-performance foundation.
- Backend: Upgraded to Laravel 11 & PHP 8.2+.
- Telegram API: Now using the latest MadelineProto v8.
- Frontend: Refactored with Vue 3 and a blazing-fast Vite build process.
- UI/UX: Redesigned with a responsive, themeable interface inspired by the official Telegram desktop app.
- Development Environment: Standardized on Laravel Sail for a consistent Docker-based setup.
The application now successfully handles authentication, browsing chats, sending/receiving messages (text and media), and more.
With a stable and modern foundation, we can now focus on making Laragram bigger, better, and faster. This is where we need your help. We are looking for contributors to help us tackle the next phases of development.
- Create a
TelegramServiceClass: Abstract all MadelineProto API calls out of the controllers and into a dedicated service class (app/Services/TelegramService.php). This will clean up the controllers and make the code more maintainable and testable. - Refactor Controllers: Update all controllers (
AuthController,ChatController,DashboardController) to use the newTelegramServicevia dependency injection.
- Set up a WebSocket Server: Integrate Laravel Reverb to handle real-time connections.
- Create a Long-Running Listener: Build an Artisan command (e.g.,
php artisan telegram:listen) that uses MadelineProto's event handler to listen for incoming Telegram updates persistently. - Broadcast Events from the Listener: When the listener receives a new message, it should dispatch a Laravel broadcast event (e.g.,
NewMessageReceived). - Update the Frontend: Replace all
setIntervalpolling in theChatView.vuecomponent with Laravel Echo to subscribe to WebSocket channels and update the UI instantly.
- Implement a Queue System: Refactor the "send message" functionality to dispatch a job (e.g.,
SendTelegramMessageJob) instead of executing synchronously. This will make the UI feel instantaneous. - Add New Features: Implement features like typing indicators, read receipts, displaying stickers/GIFs, and improved media previews.
- Improve the UI/UX: We welcome any improvements to the design, responsiveness, and user experience.
We welcome all contributions and love merging pull requests.
- Find an issue: Check out the Project Board and the Issues tab. The roadmap above is our main guide.
- Fork & Branch: Fork the repository and create a new branch for your feature or bug fix.
- Code! Make your changes following the setup guide below.
- Submit a Pull Request: Open a PR against the
mainbranch and describe your changes. We'll review it as soon as possible.
The easiest and recommended way to get Laragram running is with Laravel Sail. You must have Docker Desktop installed and running on your machine.
- Clone the repository:
git clone https://github.com/<your-username>/laragram.git cd laragram
- Install PHP dependencies:
composer install
- Setup your environment file:
cp .env.example .env
- Add Your Telegram Credentials:
Open the
.envfile and fill in your personal API keys from my.telegram.org.TELEGRAM_API_ID=YOUR_API_ID TELEGRAM_API_HASH=YOUR_API_HASH
- Generate an application key:
php artisan key:generate
- Start the Sail Containers:
This command will build and start the application, database, and Redis containers in the background. The first time you run this, it may take several minutes.
# (Optional, for macOS/Linux) Create a shell alias for easier commands alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail' sail up -d
- Run Database Migrations:
All
artisanandnpmcommands must now be prefixed withsail.sail artisan migrate
- Install Frontend Dependencies:
sail npm install
- Run the Vite Development Server:
sail npm run dev
You're all set! Your application is now running at http://localhost.
app/Services/MadelineProtoService.php: A crucial service that manages the MadelineProto API instance. This is where all configuration and initialization logic lives.app/Http/Controllers/DashboardController.php: Handles the initial page load for chat views.app/Http/Controllers/ChatController.php: Handles all API requests from the frontend (polling, sending messages, downloading media).resources/js/components/ChatView.vue: The generic, reusable component that renders the main chat interface for users, groups, and channels.resources/css/chat.css: Contains the custom CSS for the new Telegram-style UI.
If you have any queries, feel free to open an issue or get in touch with [email protected].
Covered under the GNU AFFERO GENERAL PUBLIC LICENSE, Version 3.
- Danog for the incredible MadelineProto library.
- All contributors who help make this project better