Skip to content

Sofiz1/anonfeed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AnonFeed

An anonymous social feed application built with Flutter and Firebase. Share posts, interact with content, and connect with others while maintaining your privacy.

Features

  • πŸ” Google Sign-In Authentication - Secure authentication using Google accounts
  • πŸ“ Create Posts - Share text posts with optional images and hashtags
  • ❀️ Like & Comment - Interact with posts through likes and comments
  • πŸ” Search - Search posts by content, username, or hashtags
  • πŸ‘€ User Profiles - View and manage your profile
  • πŸ–ΌοΈ Image Support - Upload and display images in posts
  • ⏰ Real-time Updates - Live feed updates using Firestore streams
  • 🎨 Modern UI - Beautiful Material Design 3 interface

Tech Stack

  • Framework: Flutter 3.8.0+
  • Backend: Firebase
    • Firebase Authentication (Google Sign-In)
    • Cloud Firestore (Database)
    • Firebase Storage (Image storage)
  • State Management: Provider
  • Key Packages:
    • firebase_core, firebase_auth, cloud_firestore, firebase_storage
    • google_sign_in
    • image_picker, cached_network_image
    • provider
    • intl, timeago, uuid

Prerequisites

Before you begin, ensure you have the following installed:

Installation

1. Clone the Repository

git clone <repository-url>
cd anonfeed

2. Install Dependencies

flutter pub get

3. Firebase Setup

Follow the detailed Firebase setup instructions in FIREBASE_SETUP.md.

Quick Setup Steps:

  1. Create a Firebase project at Firebase Console
  2. Enable Authentication with Google Sign-In
  3. Create a Firestore Database (start in test mode for development)
  4. Enable Firebase Storage
  5. Run flutterfire configure to set up Firebase for your Flutter app
  6. Add SHA-1 key for Android (see FIREBASE_SETUP.md for details)

4. Run the Application

# Run on connected device/emulator
flutter run

# Run on specific platform
flutter run -d chrome        # Web
flutter run -d windows       # Windows
flutter run -d android       # Android
flutter run -d ios           # iOS (macOS only)

Project Structure

lib/
β”œβ”€β”€ main.dart                 # App entry point and authentication wrapper
β”œβ”€β”€ models/                   # Data models
β”‚   β”œβ”€β”€ user_model.dart
β”‚   β”œβ”€β”€ post_model.dart
β”‚   └── comment_model.dart
β”œβ”€β”€ screens/                  # UI screens
β”‚   β”œβ”€β”€ login_screen.dart
β”‚   β”œβ”€β”€ main_screen.dart      # Bottom navigation wrapper
β”‚   β”œβ”€β”€ home_screen.dart      # Feed of posts
β”‚   β”œβ”€β”€ search_screen.dart    # Search functionality
β”‚   β”œβ”€β”€ create_post_screen.dart
β”‚   β”œβ”€β”€ comments_screen.dart
β”‚   └── profile_screen.dart
└── services/                 # Business logic
    β”œβ”€β”€ auth_service.dart     # Authentication operations
    β”œβ”€β”€ database_service.dart # Firestore operations
    └── storage_service.dart  # Firebase Storage operations

Usage

Signing In

  1. Launch the app
  2. Tap "Sign in with Google"
  3. Select your Google account
  4. Grant necessary permissions

Creating a Post

  1. Navigate to the "Create" tab (bottom navigation)
  2. Enter your post content
  3. Optionally add an image by tapping the image icon
  4. Add hashtags (format: #hashtag)
  5. Tap "Post" to publish

Interacting with Posts

  • Like: Tap the heart icon on any post
  • Comment: Tap the comment icon to view/add comments
  • Search: Use the search tab to find posts by content, user, or hashtag
  • Profile: View your profile and posts in the Profile tab

Database Structure

Firestore Collections

users/
  {uid}/
    - uid: string
    - email: string
    - username: string
    - profile_image: string
    - created_at: timestamp

posts/
  {postId}/
    - post_id: string
    - user_id: string
    - username: string
    - content_text: string
    - image_url: string
    - hashtags: array
    - created_at: timestamp
    - likes_count: number
    - comments_count: number

comments/
  {postId}/
    postComments/
      {commentId}/
        - comment_id: string
        - post_id: string
        - user_id: string
        - username: string
        - comment_text: string
        - created_at: timestamp

likes/
  {postId}/
    userLikes/
      {userId}/
        - liked_at: timestamp

Security Rules

For development, the app uses test mode security rules. Before deploying to production, update your Firestore and Storage security rules. See FIREBASE_SETUP.md for recommended production rules.

Testing

Run the test suite:

flutter test

Building for Production

Android

flutter build apk --release
# or
flutter build appbundle --release

iOS

flutter build ios --release

Web

flutter build web --release

Windows

flutter build windows --release

Troubleshooting

Common Issues

Google Sign-In not working:

  • Verify SHA-1 key is added in Firebase Console
  • Download and replace google-services.json (Android) or GoogleService-Info.plist (iOS)
  • Clean and rebuild: flutter clean && flutter pub get

Firestore permission errors:

  • Check Firestore Security Rules in Firebase Console
  • Ensure user is authenticated
  • Verify rules allow the operation you're trying to perform

Image upload issues:

  • Check Firebase Storage Rules
  • Verify user is authenticated
  • Check file size limits (default is 5MB)

Build errors:

  • Run flutter clean
  • Delete pubspec.lock and run flutter pub get
  • Ensure all Firebase configuration files are in place

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

Acknowledgments

  • Flutter team for the amazing framework
  • Firebase team for the backend services
  • All open-source contributors

About

AnonFeed anonymous app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors