Skip to content

ahsxndev/instagram-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Έ Instagram Clone

A modern Instagram clone built with Flutter & Firebase

Flutter Firebase Dart

Open Source Love svg1 GitHub Forks GitHub Issues contributions welcome

Clean, modern Instagram clone featuring real-time feed, image uploads, and secure authentication.

Banner


✨ Features

πŸ” Authentication & Security

  • Firebase Email/Password Authentication
  • Secure user registration & login
  • Password reset functionality
  • User session management

πŸ“± Core Functionality

  • Real-time feed with Firestore updates
  • Image upload with Firebase Storage
  • User search by username
  • Profile management with post grid

🎯 Additional Features

  • πŸ“· 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

πŸš€ Getting Started

Prerequisites

Flutter SDK     >=3.0.0
Dart SDK        >=2.17.0
Firebase CLI    Latest version
Android Studio  or VS Code

πŸ”§ Installation & Setup

  1. Clone the repository

    git clone https://github.com/ahsxndev/instagram-clone.git
    cd instagram-clone
  2. Install dependencies

    flutter pub get
  3. 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',
    );
  4. Run the application

    flutter run

πŸ“¦ Dependencies

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

🎨 Screens & Features

πŸ” Authentication

  • Login Screen - Email/password authentication
  • Signup Screen - New user registration with profile setup

πŸ“± Main App

  • 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

πŸ”§ Firebase Configuration

Firestore Database Structure

// 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"
  }
}

Security Rules

// 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;
    }
  }
}

πŸš€ Building for Production

# Android APK
flutter build apk --release

# Android App Bundle (Play Store)
flutter build appbundle --release

# iOS (requires Xcode)
flutter build ios --release

🀝 Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Guidelines

  • Follow Flutter/Dart style conventions
  • Test your changes on multiple devices
  • Update documentation for new features
  • Ensure Firebase security rules are properly configured

πŸ“„ License

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! πŸ™Œ


πŸ™ Acknowledgments

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


πŸ“ž Support

Found this helpful? Give it a ⭐ on GitHub!

πŸ“§ Email: ahsanzaman.dev@gmail.com
πŸ› Issues: Report Issues
πŸ’¬ Discussions: Join Discussion

GitHub followers GitHub stars


Built with ❀️ using Flutter & Firebase

Learn β€’ Build β€’ Share πŸ“Έβœ¨

About

A simple Instagram clone created in Flutter using Firebase and Provider State Management.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors