Skip to content

Repository files navigation

🇺🇸 English | 🇮🇷 فارسی

HamNava 💬

A secure, fast and lightweight messaging app for users with limited internet access


📖 Overview

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.

🚀 Tech Stack

  • Flutter (Frontend/UI)
  • PocketBase (Backend, Database, & Auth)
  • BLoC (State Management)
  • Clean Architecture (Domain-Driven Design)
  • GetIt & GoRouter (Dependency Injection & Navigation)

📱 Key Features

  • 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.

📸 Screenshots

Screenshot 2026-06-15 020129 Screenshot 2026-06-15 020202 Screenshot 2026-06-15 020235 Screenshot 2026-06-15 020648 Screenshot 2026-06-15 022014 Screenshot 2026-06-15 020836 Screenshot 2026-06-15 020300 Screenshot 2026-06-15 020711 Screenshot 2026-06-15 020730 Screenshot 2026-06-15 020751 Screenshot 2026-06-15 020903

🛠️ Step-by-Step Hosting Guide

HamNava requires a backend server. Choose the method that best fits your needs:

Method 1: Localhost (For Testing & LAN)

  1. Download the latest PocketBase .

  2. 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.

Method 2: VPS (For Public Access & Stability)

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.

Method 3: Cloud (Liara / Docker)

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.

⚙️ Database Configuration (Essential)

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.

Configure API Rules:

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.

🏃 Running the Flutter App

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!

🤝 Contributing

Contributions make HamNava better. Feel free to:

Fork the project.

Create a new feature branch.

Submit a Pull Request.

📄 License

MIT License

❤️ Final Note

HamNava aims to provide a reliable and secure communication solution in challenging network conditions.

About

Hamnava(هم نوا) | modern , real-time & self host chat application powered by flutter & pocketBase. Architected with precision using Clean Artchitecture

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages