A secure, fast and lightweight messaging app for users with limited internet access
HamNava is an open-source messaging application that allows you to host your own backend (self-hosted) in any environment—from a simple laptop to powerful cloud servers. This project aims to provide secure, stable communication with zero dependency on global internet or centralized servers.
- Flutter (Frontend/UI)
- PocketBase (Backend, Database, & Auth)
- BLoC (State Management)
- Clean Architecture (Domain-Driven Design)
- GetIt & GoRouter (Dependency Injection & Navigation)
- Private & Group Chat: Real-time messaging with instant delivery.
- Friend Management: Search and add friends by their Unique ID/Username.
- Auto-Media Cleanup: Files are automatically deleted from the server after 5 minutes to keep your storage usage low.
- Modern UI: Clean, minimal design with full Dark Mode 🌙 support.
HamNava requires a backend server. Choose the method that best fits your needs:
-
Download the latest PocketBase .
-
Open your terminal/CMD in that folder and run:
.\pocketbase.exe serve --http="0.0.0.0:8090"
If you don't have an account yet, open the link at the bottom of the cmd page in your browser and register.
Open http://127.0.0.1:8090/_/ in your browser to access the admin panel.
Prepare a Linux VPS (Ubuntu 22.04+).
Transfer the PocketBase Linux binary to your server.
Use Systemd to create a background service so the server stays active.
Security: Use Nginx as a Reverse Proxy and install SSL (HTTPS) via Certbot to ensure secure data transfer.
Ensure ports 80 and 443 (or your chosen port) are open in your server firewall.
You can select Pocket Base from the ready-made programs section through Liara or Chabakan sites and access Pocket Base by clicking on Quick Build.
After accessing your Admin Panel (in any of the methods above):
Import Schema: Go to Settings > Import collections and import the pb.json file provided in this repository (Select "Merge with existing").
Setup Users Collection:
Open the users collection. Click New field:
Add userName (Type: Text).
Add friend (Type: Relation -> target: users).
Important: In friend field settings, select "multiple" to allow an unlimited friend list.
Go to the users collection and click the Lock icon (API Rules):
List/Search & View rule: @request.auth.id != ""
Create rule: (Leave empty)
Update rule: id = @request.auth.id
Click Save changes.
Clone & Setup:
git clone [https://github.com/your-username/hamnava.git](https://github.com/your-username/hamnava.git)
cd hamnava
flutter pub get
flutter run
Connect to Server:Open the app. On the Login screen, tap the Settings icon (gear).
Enter your server address (e.g., http://192.168.1.5:8090 or https://api.yourdomain.ir).
Tap "Connect", sign up, and enjoy!
Contributions make HamNava better. Feel free to:
Fork the project.
Create a new feature branch.
Submit a Pull Request.
MIT License
HamNava aims to provide a reliable and secure communication solution in challenging network conditions.