Clean, modern Instagram clone featuring real-time feed, image uploads, and secure authentication.
|
|
- π· Camera integration for photo capture
- π¬ Post captions and descriptions
- π₯ User profiles with follower/following counts
- π Pull-to-refresh functionality
- π± Responsive design for all screen sizes
Flutter SDK >=3.0.0
Dart SDK >=2.17.0
Firebase CLI Latest version
Android Studio or VS Code-
Clone the repository
git clone https://github.com/ahsxndev/instagram-clone.git cd instagram-clone -
Install dependencies
flutter pub get
-
Firebase Setup
Create Firebase Project:
- Go to Firebase Console
- Create a new project
- Enable Authentication (Email/Password)
- Enable Firestore Database
- Enable Firebase Storage
Add Configuration Files:
# Android # Download google-services.json from Firebase Console # Place it in: android/app/google-services.json # iOS # Download GoogleService-Info.plist from Firebase Console # Place it in: ios/Runner/GoogleService-Info.plist
Update Firebase Options:
// lib/firebase_options.dart static const FirebaseOptions android = FirebaseOptions( apiKey: 'YOUR_ANDROID_API_KEY', appId: 'YOUR_ANDROID_APP_ID', messagingSenderId: 'YOUR_MESSAGING_SENDER_ID', projectId: 'YOUR_PROJECT_ID', storageBucket: 'YOUR_STORAGE_BUCKET', );
-
Run the application
flutter run
| Package | Purpose |
|---|---|
firebase_core |
Firebase initialization |
firebase_auth |
User authentication |
cloud_firestore |
Real-time database |
firebase_storage |
Image storage |
image_picker |
Camera/gallery access |
provider |
State management |
cached_network_image |
Efficient image loading |
- Login Screen - Email/password authentication
- Signup Screen - New user registration with profile setup
- Feed Screen - Instagram-like post feed with real-time updates
- Search Screen - Find users by username
- Add Post - Upload photos with captions
- Profile Screen - User info and post grid display
// Users Collection
users: {
uid: {
username: "string",
email: "string",
bio: "string",
photoUrl: "string",
followers: ["uid1", "uid2"],
following: ["uid3", "uid4"]
}
}
// Posts Collection
posts: {
postId: {
description: "string",
uid: "string",
username: "string",
postUrl: "string",
profImage: "string",
likes: ["uid1", "uid2"],
datePublished: "timestamp"
}
}// Firestore Rules
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /posts/{postId} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.auth.uid == resource.data.uid;
}
}
}# Android APK
flutter build apk --release
# Android App Bundle (Play Store)
flutter build appbundle --release
# iOS (requires Xcode)
flutter build ios --releaseContributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Flutter/Dart style conventions
- Test your changes on multiple devices
- Update documentation for new features
- Ensure Firebase security rules are properly configured
This project is licensed under the MIT License and is intended for educational purposes.
Feel free to fork, learn, and build upon it β attribution is appreciated! π
Special Thanks:
π Flutter Team - For the amazing cross-platform framework
π₯ Firebase Team - For the powerful backend services
π Flutter Community - For tutorials and inspiration
π Open Source Contributors - For continuous improvements
Found this helpful? Give it a β on GitHub!
π§ Email: ahsanzaman.dev@gmail.com
π Issues: Report Issues
π¬ Discussions: Join Discussion
Built with β€οΈ using Flutter & Firebase
Learn β’ Build β’ Share πΈβ¨
