π Open-Source VPN Client Template - Build your own VPN app with this Flutter-based foundation
hiVPN is more than just a VPN client - it's a fully functional template that you can use to kickstart your own VPN application development. Built with Flutter, this project provides a solid foundation with:
- β Production-ready architecture
- π Modular codebase for easy customization
- π Riverpod for state management
- π Cross-platform support (Android/iOS/Web/Desktop)
- π Secure by default with best practices
- π± Beautiful, responsive UI
- π Well-documented code
- π One-tap secure connection
- π 1000+ servers in 30+ countries
- π Strong encryption (OpenVPN)
- π Built-in speed testing
- π Connection history
- π― Smart server selection
- π Dark/Light theme support
- π‘οΈ No-logs policy
- π± AdMob integration ready
| Step 1 | Step 2 | Step 3 |
|---|---|---|
![]() |
![]() |
![]() |
| Home Screen | Server Selection | Speed Test |
|---|---|---|
![]() |
![]() |
![]() |
| Settings | Splash Screen |
|---|---|
![]() |
![]() |
-
Fork & Clone
git clone https://github.com/your-username/hivpn.git cd hivpn -
Setup Environment
- Flutter SDK (>=3.13.0)
- Android Studio / Xcode for mobile development
- (Optional) Google AdMob account for ads
-
Install Dependencies
flutter pub get
-
Run the App
flutter run
-
Branding
- Update app icons in
android/app/src/main/res/andios/Runner/Assets.xcassets/ - Modify colors in
lib/theme/colors.dart - Update app name in
pubspec.yaml
- Update app icons in
-
Features
- Add/remove features in the
lib/features/directory - Customize server list in
lib/features/servers/ - Modify VPN configuration in
lib/services/vpn/
- Add/remove features in the
-
Monetization
- Setup AdMob in
lib/services/ads/ - Configure in-app purchases (coming soon)
- Setup AdMob in
We welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Check out the Issues tab for good first issues to get started!
lib/
βββ app/ # App configuration and theme
βββ core/ # Core utilities and constants
βββ features/ # Feature modules (each is self-contained)
β βββ connection/ # VPN connection logic
β βββ history/ # Connection history tracking
β βββ network/ # Network utilities and APIs
β βββ onboarding/ # User onboarding flow
β βββ servers/ # Server management and selection
β βββ settings/ # App settings and preferences
βββ services/ # Core services
β βββ vpn/ # VPN service implementation
β βββ ads/ # Ad integration
β βββ notifications/ # Local notifications
βββ main.dart # App entry point
- State Management:
flutter_riverpod - VPN:
openvpn_flutter - Ads:
google_mobile_ads - Local Storage:
shared_preferences,flutter_secure_storage - Networking:
dio,http - UI:
google_fonts,flutter_svg - Analytics:
firebase_analytics - Localization:
intl
- β OpenVPN Integration: Full tunnel management with status updates
- π Server Management: VPNGate server discovery with caching and
.ovpnimport - π Network Tools: Built-in speed testing with Fast.com and IP lookup
- β‘ Performance: Optimized connection handling with auto-reconnect
- π Notifications: Persistent session controls and Quick Settings tile
- βοΈ Auto-Connect: Smart rules for automatic VPN activation
- π¨ Theming: Light theme with dark mode in development
- π± Responsive Design: Works across different screen sizes
| Feature | Status |
|---|---|
| OpenVPN Tunnel | β Stable |
| Server Discovery | β Stable |
| Speed Testing | β Stable |
| Auto-Connect | π§ In Progress |
| Dark Mode | π§ In Development |
| Split Tunneling | π§ Planned |
| iOS Support | π Planned |
| Home Screen | Server Selection | Speed Test | Settings |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
- Download the latest APK from GitHub Releases
- Install on your Android device (enable "Unknown Sources" if needed)
- Launch the app and grant VPN permissions
- Connect with one tap or choose a specific server
- Fork & Clone the repository
- Setup Flutter environment (3.13.0+)
- Run the app:
flutter pub get flutter run
- Android 8.0+ (API 26+)
- Internet connection for server discovery
- VPN permissions (granted on first launch)
- Flutter SDK (>=3.13.0)
- Android Studio / Xcode (for mobile development)
- Java 17 JDK
- Android SDK 36
- Kotlin 1.9.22
# Install dependencies
flutter pub get
# Run tests
flutter test
# Build debug APK
flutter build apk --debug
# Build release APK
flutter build apk --release- Application ID:
com.example.hivpn - Min SDK: 26 (Android 8.0)
- Target SDK: 36 (Android 12)
- Kotlin: 1.9.22
- Gradle: 8.1.4
- Server Discovery: Automatically fetches from VPNGate
- Offline Support: Caches server list for offline access
- Custom Servers: Import
.ovpnfiles for private VPNs
- Storage: Secure storage for sensitive data
- Theme: Light/Dark mode support
- Connection: Auto-connect and auto-reconnect settings
- Environment variables for API keys
- Feature flags for experimental features
- Customizable theming and branding
graph TD
A[Flutter UI Layer] -->|State Management| B[Riverpod Providers]
B -->|Platform Channels| C[Native VPN Service]
C --> D[OpenVPN Engine]
B --> E[Network Services]
E --> F[VPNGate API]
E --> G[Speed Test]
B --> H[Local Storage]
- UI Layer: Built with Flutter widgets
- State Management: Riverpod for reactive state
- Platform Integration: Native VPN services via method channels
- Networking: Dio for HTTP requests, WebSockets for real-time updates
- Storage: SharedPreferences for settings, SQLite for local data
- Internet Access: For VPN connection and server communication
- Network State: To monitor connectivity changes
- Foreground Service: For persistent VPN connection
- Notification Access: To show connection status
- WiFi State: For network optimization
- Boot Completed: For auto-connect on device start
All permissions are used strictly for VPN functionality. The app does not collect or transmit any personal data.
- No Logs Policy: We don't log your browsing activity
- Local Storage: All data stays on your device
- Secure Connections: Encrypted communication with VPN servers
- Open Source: Transparent codebase for security review
- VPNGate: Community-powered VPN servers
- Fast.com: For speed testing
- Google AdMob: Optional ad integration (disabled by default)
- Regular dependency updates
- Secure storage for sensitive data
- Minimal permission requests
-
Connection Fails
- Check internet connection
- Try a different server
- Restart the app
-
Slow Speeds
- Connect to a closer server
- Check your base internet speed
- Try a different protocol (if available)
-
Battery Optimization
- Disable battery optimization for the app
- Enable auto-start if available
- Check the GitHub Issues for known issues
- Open a new issue if your problem isn't listed
We welcome contributions! Here's how you can help:
- Report Bugs: Open an issue with detailed steps to reproduce
- Suggest Features: Share your ideas for improvements
- Submit Code: Send pull requests for bug fixes or new features
- Follow existing code style
- Write tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
Look for issues labeled good first issue to get started!
- iOS Support
- Split Tunneling
- Dark Mode
- WireGuard Protocol
- Multi-hop VPN
- Custom DNS Support
- Basic VPN Functionality
- Server Selection
- Speed Testing
- Auto-Connect Improvements
- Cross-platform support (Windows, macOS, Linux)
- Advanced encryption options
- Custom rule-based routing
We follow Semantic Versioning:
- MAJOR for breaking changes
- MINOR for new features
- PATCH for bug fixes
- Update version in
pubspec.yaml - Update
CHANGELOG.md - Create a release tag
- Build and sign the APK
- Publish to GitHub Releases
- Automated testing on every push
- Release builds on tag push
- Automatic changelog generation
This project is licensed under the Apache License 2.0.
- GitHub Discussions - Ask questions and share ideas
- Issues - Report bugs or request features
- Contributing - Learn how to contribute
If you find this project useful, please consider giving it a βοΈ on GitHub!
Made with β€οΈ by the Open Source Community
- Flutter - Beautiful native apps in record time
- OpenVPN - Open source VPN protocol
- VPNGate - Public VPN server project
- Riverpod - State management
- Dio - HTTP client
- Shared Preferences - Local storage
- Flutter Secure Storage - Secure data storage
Thank you to all the contributors who have helped improve this project!







